Android 12.0 字体大小默认设置为“大”

Android 12.0 字体大小默认设置为“大”

现需要在Android 12.0版本上,将字体大小默认设置为“大”,具体修改点如下:

/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/display/FontSizePreferenceController.java:

public CharSequence getSummary() {

中增加

	    //*/start
        final float currentScale = Settings.System.getFloat(mContext.getContentResolver(),
                Settings.System.FONT_SCALE, 1.15f);
        //*/end

/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/display/ToggleFontSizePreferenceFragment.java:

    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        final Resources res = getContext().getResources();
        final ContentResolver resolver = getContext().getContentResolver();
        // Mark the appropriate item in the preferences list.
        mEntries = res.getStringArray(R.array.entries_font_size);
        final String[] strEntryValues = res.getStringArray(R.array.entryvalues_font_size);

中增加

        //*/start
        final float currentScale =
                Settings.System.getFloat(resolver, Settings.System.FONT_SCALE, 1.15f);
        //*/end

重新编译验证,修改生效,字体的大小已经默认设置为“大”

你可能感兴趣的:(Android,android)