Theming Guide for changing system text settings.

Discussion in 'Team Inversion Conversion' started by thebowers, Jul 30, 2010.

  1. thebowers
    Offline

    thebowers Premium Member Theme Developer Premium Member

    Joined:
    Nov 24, 2009
    Messages:
    2,548
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Iowa
    Taking some time from theme to get all of this info out right now before I forget it. This is going to be a place to put system text edits and what they affect. Right now I only have a couple but will add to it as I go. As always feel free to add ones that you have found.

    Things needed to accomplish these changes.
    Apk Manager - http://forum.xda-developers.com/showthread.php?t=695701
    7-zip - http://www.7-zip.org/ Great tools for opening .apks and extracting them with out changing the extension.
    framework-res.apk from your phone (since it holds the system settings)

    Getting started.
    1. Pull framework-res.apk from phone by using ADB or however you would like to do this.
    2. Download and extract Apk Manager. I usually place this in the tools directory of the Android SDK. If you do this you need to set the environment path for the directory for aapt.exe of apktool.jar to work correctly.
    3. Take the framework-res.apk and place it in the place-apk-here-for-modding folder withing the Apk Manager folder.

    Now for the fun
    1. Click on Script.bat within the Apk Manager folder to open and run the tool.
    2. Should ask you about clearing workspace and then something about finding ADB. Once you get passed those screens you should be at one that has number options.
    3. For this walk through we are only concerned with the middle portion.
    4. Select 9 and hit enter. It should tell you that it is decompiling the .apk. When it is done it will ask you to make a selection.
    5. Now go to the Apk Manager folder and you should see an folder labelled "out". Open it to find your decompiled .apk
    6. Go to the /res/values folder. Then go to a .xml file called styles.xml. Open this and any xml file that you decompile with notepad or notepad++
    7. This is a big xml file which controls many aspects of the system. Don't worry I am not even going to try and explain things here. Just going to give you the areas I know and what to change.

    Things within styles.xml that I know.


    First off is the text on buttons.


    Do a ctrl+f to bring up the find button.
    Type widget.button and click find next. (hit find next 6 times)
    You should now be at this portion of the .xml

    Code:
     <style name="Widget.Button" parent="@style/Widget">
            <item name="textAppearance">?textAppearanceSmallInverse</item>
            <item name="textColor">@color/primary_text_light</item>
            <item name="gravity">center</item>
            <item name="background">@drawable/btn_default</item>
            <item name="focusable">true</item>
            <item name="clickable">true</item>
        </style>
    Where it says primary_text_light (black) change to primary_text_dark (white).
    Also you could delete the whole @color/primary_text_light and just put #ffff00ae as an example for the color code you desire.
    If that is all you need save and look down for the completing instructions.


    Next is the menu text (when you hit he soft key for menu)


    Do ctrl + f and put in TextAppearance.Widget.IconMenu.Item and click find next.
    You should now be at this area

    Code:
        <style name="TextAppearance.Widget.IconMenu.Item" parent="@style/TextAppearance.Small">
            <item name="textColor">?textColorPrimary</item>
        </style>
    Change textColorPrimaryInverse (black) to textColorPrimary (white and then black when pressed)
    Also you could delete the whole ?textColorPrimary and just put #ffff00ae as an example for the color code you desire.
    If that is all you need save and look down for the completing instructions.


    Keyboard text (the actually text on the soft keyboard keys)


    Do ctrl + f and put in Widget.KeyboardView and click find next twice
    You should now be at this section

    Code:
        <style name="Widget.KeyboardView" parent="@style/Widget">
            <item name="background">@drawable/keyboard_background</item>
            <item name="shadowColor">#bb000000</item>
            <item name="shadowRadius">2.75</item>
            <item name="keyBackground">@drawable/btn_keyboard_key</item>
            <item name="keyTextSize">22.0sp</item>
            <item name="labelTextSize">14.0sp</item>
            <item name="keyTextColor">#ffffffff</item>
            <item name="keyPreviewLayout">@layout/keyboard_key_preview</item>
            <item name="keyPreviewOffset">-12.0dip</item>
            <item name="keyPreviewHeight">80.0dip</item>
            <item name="verticalCorrection">-10.0dip</item>
            <item name="popupLayout">@layout/keyboard_popup_keyboard</item>
        </style>
    Pretty simple, where it says keyTextColor, change that to whatever you want.
    If you want to change the key text on the pop up or preview, that is located in /res/layout/keyboard_key_preview.
    If that is all you need save and look down for the completing instructions.


    Text highlight color


    Do crtl + f and put (style name="TextAppearance") in the find box and click find next.
    You should now be at this section.

    Code:
        <style name="TextAppearance">
            <item name="textSize">16.0sp</item>
            <item name="textStyle">normal</item>
            <item name="textColor">?textColorPrimary</item>
            <item name="textColorHighlight">#ffc0c0c0</item>
            <item name="textColorHint">?textColorHint</item>
            <item name="textColorLink">#ff5c5cff</item>
        </style>
    Just change the textColorHighlight to whatever color you desire.
    If that is all you need save and look down for the completing instructions.


    Edit Text (what shows when you type in any textfield like talk, facebook, twitter, and such)

    Do crtl+F for Widget.EditText and hit find next twice.
    You should now be at this area.

    Code:
        <style name="Widget.EditText" parent="@style/Widget">
            <item name="textAppearance">?textAppearanceMediumInverse</item>
            <item name="textColor">@color/primary_text_light</item>
            <item name="gravity">center_vertical</item>
            <item name="background">@drawable/edit_text</item>
            <item name="focusable">true</item>
            <item name="focusableInTouchMode">true</item>
            <item name="clickable">true</item>
        </style>
    Where is says primary_text_light, you can change it to primary_text_dark for white text. Otherwise just do this "textColor">#ffff0000< that code is for red. Just replace with what color you want.
    If you are done save and continue to finishing instructions


    Lockscreen Text

    This is located in the /res/layout folder as keyguard_screen_tab_unlock.xml and keyguard_screen_tab_unlock_land.xml.
    To help out I have added a color values string to the text areas (they don't have them by default)
    Grab the Lockscreen Text xmls.zip found at the bottom. Unzip
    Open these files in a Hex editor like HxD.
    Do a hex-string search of 08 00 00 1c. The first one is for a background color skip it.
    The next eight are for the text on the screen. By default I have them set at FF FF FF FF for white.
    Just remember in hex editing the color values are backwards. Save the files and add to your framework-res.apk.
    I will add more later. Just wanted to get these out right now.


    Statusbar for Music.apk

    http://www.droidforums.net/forum/dr...anging-system-text-settings-4.html#post686506 download this attached file.
    Change the .zip to .xml.
    Open with hex editor like HxD.
    Do a search for 08 00 00 1c, there will be two in this file.
    Right now the default is for white FF FF FF FF. change to desired hex color and save.
    Then place in /res/layout folder of Music.apk and push to phone.


    Completing the process.
    Once you are done with that file don't forget to save.
    Go back to the Apk Manager grey command prompt window.
    Do option 11 to compile the .apk. When that is done it will change from compiling .apk to asking you to make a decision.
    Then do option 12 to sign the .apk. This is very important. Forgetting to do this will result in a boot loop.
    Now go to place-apk-here-for-modding folder within the Apk Manager folder. There should now be a new file called repackaged-signed.apk . Move this file to the desktop or somewhere to rename. Rename to framework-res.apk.
    You now have a new framework-res.apk with the edits you did. Either add images and what not that you want to it or go ahead and push to phone by using ADB, an update.zip, MM theme format, or move to sdcard and use Root Explorer.
    If you are going to add images use 7-zip to open the .apk as an archive and navigate to the appropriate folder. I haven't tried it but you should be able to put the image file in the appropriate folder before doing option 11 to compile. Just keep in mind that if they are .9 images they will need the guides on them. Since the folders are decompiled images within them until compiled.

    Enjoy your need settings. Again if you know of anything in this file or some other usefully system text edits in the framework-res.apk, let us know.
    Last edited: Aug 9, 2010
  2. kook
    Offline

    kook Premium Member Theme Developer Premium Member

    Joined:
    Dec 29, 2009
    Messages:
    2,041
    Likes Received:
    0
    Trophy Points:
    0
    Sub'd....thank you SO much for doing this.
  3. thebowers
    Offline

    thebowers Premium Member Theme Developer Premium Member

    Joined:
    Nov 24, 2009
    Messages:
    2,548
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Iowa
    It's better to do this then to answer the questions a million times...lol.
  4. stratt
    Offline

    stratt New Member

    Joined:
    Jan 15, 2010
    Messages:
    614
    Likes Received:
    0
    Trophy Points:
    0
    Man.... This is awesome. answered so many of my questions! For the following though...
    <item name="keyTextColor">#ffffffff</item

    My color code is 0000FF. What would that look like in the above?

    Thanks
  5. thebowers
    Offline

    thebowers Premium Member Theme Developer Premium Member

    Joined:
    Nov 24, 2009
    Messages:
    2,548
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Iowa
    So you want it that code of 0000ff? Just put it as so. This isn"t like hex editing where things are backwards. This is regular hex code of ARGB (alpha, red, green, blue)
  6. stratt
    Offline

    stratt New Member

    Joined:
    Jan 15, 2010
    Messages:
    614
    Likes Received:
    0
    Trophy Points:
    0
    so if would be ff0000?

    Do i start at the first ff or the second set of ff?
  7. thebowers
    Offline

    thebowers Premium Member Theme Developer Premium Member

    Joined:
    Nov 24, 2009
    Messages:
    2,548
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Iowa
    Right now the code is for white with alpha. I edited what I put in the other post. It isn't backwards. You want 0000ff = blue right?
    Here is the break down

    first ff is alpha
    second ff is for red
    third ff is for green
    fourth ff is for blue

    Yours would be

    ff for alpha
    00 for red
    00 for green
    ff for blue

    Just do it as the regular hex code you would normally do for any graphics. This xml is decompiled back to original code.
  8. stratt
    Offline

    stratt New Member

    Joined:
    Jan 15, 2010
    Messages:
    614
    Likes Received:
    0
    Trophy Points:
    0
    Thanks, but now compiling gives me error 21?
  9. thebowers
    Offline

    thebowers Premium Member Theme Developer Premium Member

    Joined:
    Nov 24, 2009
    Messages:
    2,548
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Iowa
    Are you using a custom framework-res.apk (one that you modified)? The reason I ask is that if I use one that doesn't have the .9 guides on the files like it needs (I don't have them on the statusbar_background) it errors out. I use the default framework-res.apk and edit from there.
  10. stratt
    Offline

    stratt New Member

    Joined:
    Jan 15, 2010
    Messages:
    614
    Likes Received:
    0
    Trophy Points:
    0
    Yes. That is what I was thinking. I will start with a fresh framework, edit the keyboard and throw my stuff in then. Thanks for your help man. I will report back in a bit.
  11. stratt
    Offline

    stratt New Member

    Joined:
    Jan 15, 2010
    Messages:
    614
    Likes Received:
    0
    Trophy Points:
    0
    after framework signs, the hdpi folders still have the -4 beside it. Does that mean that i have to repatch the .9's?, cause it boot looped on the boot ani. Is that system xml anywhere else( does it have to be decompiled)?
    Last edited: Jul 30, 2010
  12. thebowers
    Offline

    thebowers Premium Member Theme Developer Premium Member

    Joined:
    Nov 24, 2009
    Messages:
    2,548
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Iowa
    Mine have that too but work fine.
  13. stratt
    Offline

    stratt New Member

    Joined:
    Jan 15, 2010
    Messages:
    614
    Likes Received:
    0
    Trophy Points:
    0
    K will just transfer my files in there and try to push
  14. stratt
    Offline

    stratt New Member

    Joined:
    Jan 15, 2010
    Messages:
    614
    Likes Received:
    0
    Trophy Points:
    0
    still boot loops
  15. thebowers
    Offline

    thebowers Premium Member Theme Developer Premium Member

    Joined:
    Nov 24, 2009
    Messages:
    2,548
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Iowa
    Ok, you are doing 9 to decompile. Go to /res/values to edit styles.xml. Save the file and go back to apk manager. Then do 11 to compile, and then 12 to sign. Taking the repacked-signed.apk and renaming to framework-res.apk.

    How are you pushing it to the system?
  16. stratt
    Offline

    stratt New Member

    Joined:
    Jan 15, 2010
    Messages:
    614
    Likes Received:
    0
    Trophy Points:
    0
    yes. I am just renaming it to framework-res, not framework-res.apk as it should already be an apk, right? I am pushing it with adb and pushing to system/framework
  17. thebowers
    Offline

    thebowers Premium Member Theme Developer Premium Member

    Joined:
    Nov 24, 2009
    Messages:
    2,548
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Iowa
    Don't assume, turn you extensions on to make sure.
  18. stratt
    Offline

    stratt New Member

    Joined:
    Jan 15, 2010
    Messages:
    614
    Likes Received:
    0
    Trophy Points:
    0
    I just looked... it renamed it framework-res.apk.... so it looks like it has a double extension will try again. lol.
  19. stratt
    Offline

    stratt New Member

    Joined:
    Jan 15, 2010
    Messages:
    614
    Likes Received:
    0
    Trophy Points:
    0
    still loops
  20. tjkriegel
    Offline

    tjkriegel New Member

    Joined:
    Mar 6, 2010
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    0
    Same here as well... boot loops after adding modified drawable-hdpi and layout folders in the apk. Does boot with the -V4 extensions on the folders before changing .pngs and layout .xml's but getting multiple fc's. I'm using HxD to modify the styles.xml, could that be causing the issue?
    Last edited: Jul 31, 2010
Search tags for this page
android permanently change sys text
,
cara merubah warna text pada setting di android
,
change font color settings.apk
,
change system settings color of android phone
,
change text color framework-res.apk
,
change text color settings.apk
,

change text settings

,
changing font color system text settings
,
fonts style setting.apk
,
how to change default font color in android device
,
how to change font color in framework xda
,
how to change font color of settings apk
,
how to edit color settings.apk
,
script color for android sytem
,
text style change apk