Modify the Android system font size

Source: Internet
Author: User

/*********************************************************************** * Edit the android system font Size * Description: * Originally thought that directly modified the settings inside the system font size can be, the results found that the font size changed * big, lancher the name of the app is cut off half, the following half can not be displayed, and then * in order to solve this problem, find appscustomize related configuration. * 2016-5-12 Shenzhen Nanshan Ping Shan village Zengjianfeng ************************************************************* *********/First, reference article:1. Android4.1To Modify the default font size http://blog.csdn.net/yicao821/article/details/8733493    2. How Android modifies the system default font size http://Www.tuicool.com/articles/vi6Fra    3. Launcher Modify the app icon and the font size of the app icon http://blog.csdn.net/pishum/article/details/20524413?utm_source=tuicool&utm_medium=referral    4. Android change desktop icon capacity and layout size http://blog.csdn.net/guoguo295/article/details/12772531Second, modify the Android system font size:1. Cat frameworks/Base/core/java/android/content/res/Configuration.java PublicFinalclassConfiguration implements Parcelable, comparable<configuration> {            ......             Public voidsettodefaults () {Fontscale=1.7f;//Default was 1.0fMCC = MNC =0; Locale=NULL; Usersetlocale=false;            ......            }    ......        } 2. Cat packages/apps/settings/res/values/Arrays.xml<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string-array name="entries_font_size"> <item msgid="6490061470416867723">Small</item> <item msgid="3579015730662088893">Normal</item> <item msgid="1678068858001018666">Large</item> <item msgid="490158884605093126">Huge</item> </string-array> <string-array name="entryvalues_font_size"translatable="false"> <!--<item>0.85</item> <item>1.0</item> <item>1.15</item> <item>1.30</item> <item>1.15</item> <item>1.30</item> <item>1.50</item> <item>1.70</item> </string-array> </resources>Third, modify the launcher in the application name body display is not complete:1due to the above changes, the app's name only shows the top half, and the bottom half is truncated;2. See which files are related to app_icon_size: [email protected]:~/myandroid/packages/apps/launcher2/res$ grep app_icon_size *-R Layout-land/launcher.xml:android:layout_height="@dimen/app_icon_size"Values/dimens.xml: <dimen name="app_icon_size">48dp</dimen>Values-sw600dp/dimens.xml: <dimen name="app_icon_size">64dp</dimen>Values-sw720dp/dimens.xml: <dimen name="app_icon_size">72dp</dimen>3because I do not know that the system used the Dimens.xml file, so simply app_icon_size all modified consistent:1all changed to 80DP, the result icon becomes bigger, completely can't see the name of the app;2all changed to 48DP, the result icon has become smaller, the app name all show up;3. Inference: each icon +The app name is in a fixed size range, so the next step is to find out where the fixed range is described. 4Depending on the situation above, you can finally determine that the system uses the configuration in the following directory: Packages/apps/launcher2/res/values-sw720dp/5. Therefore, the app icon size changes must be in: packages/apps/launcher2/res/values-sw720dp/Dimens.xml6the possible modifications are: Cat packages/apps/launcher2/res/values-sw720dp/dimens.xml ...<resources>                ......                <!--appscustomize--<dimen name="Apps_customize_cell_width">96dp</dimen> <dimen name="Apps_customize_cell_height">96dp</dimen> <integer name="Apps_customize_maxcellcountx">-1</integer> <integer name="Apps_customize_maxcellcounty">-1</integer> <dimen name="all_apps_button_vertical_padding">4dip</dimen>                ......                <!--Workspace cell Size--<dimen name="Workspace_cell_width_land">96dp</dimen> <dimen name="Workspace_cell_width_port">96dp</dimen> <dimen name="Workspace_cell_height_land">96dp</dimen> <dimen name="Workspace_cell_height_port">96dp</dimen> <dimen name="Workspace_width_gap_land">50dp</dimen> <dimen name="Workspace_width_gap_port">0dp</dimen> <dimen name="Workspace_height_gap_land">16dp</dimen> <dimen name="Workspace_height_gap_port">70dp</dimen> </resources>            ......    7after confirmation, the final program adopted the setting is: Cat packages/apps/launcher2/res/values-sw720dp/Dimens.xml<resources> <dimen name="Apps_customize_cell_width">96dp</dimen> <dimen name="Apps_customize_cell_height">96dp</dimen> </resources>8. Modify the following: Cat packages/apps/launcher2/res/values-sw720dp/Dimens.xml<resources> <dimen name="Apps_customize_cell_width">120dp</dimen> <dimen name="Apps_customize_cell_height">120dp</dimen> </resources>Four, why landscape is 5 app display:1. Cat packages/apps/launcher2/res/values-sw720dp/config .<resources> <integer name="cell_count_x">8</integer> <integer name="cell_count_y">5</integer>            ...        </resources>2it can be seen from here that our program is a little bit wrong, because we are horizontal 5, longitudinal 8, opposite;3The test is changed to 4 apps per line:<resources> <integer name="cell_count_x">8</integer> <integer name="cell_count_y">4</integer>            ...        </resources>

Modify the Android system font size

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.