New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
theecho
Old
(Last edited by theecho; 19th October 2010 at 09:28 AM.)
#1  
theecho's Avatar
Senior Member - OP
Thanks Meter 3
Posts: 321
Join Date: May 2009
Location: Chesapeake, VA

 
DONATE TO ME
Default [TUT]How to change colors of fonts for themes on stock ROM 2.2 and above

Required Items
APK Manager - http://forum.xda-developers.com/showthread.php?t=695701
Notepad++ - http://notepad-plus-plus.org/download (or equivalent editor)
Some sort of archive utility to open your theme (e.g. Winzip, WinRar, 7-zip, etc.)

Instructions

1. Copy your framework-res.zip to the folder that is labeled "place-apk-here-for-modding".

2. Open APK Manager by running the file that is labeled "Script.bat".

3. You will see the APK Manager now open. We first need to set the project with which we will be working. Type in option 22 to set the project.

4. You will see that it says "1-framework-res.apk". We want to choose this as our project so choose 1 and press enter.

5. Now that we have set our project, we want to decompile the apk so that we can see the xml code. Choose option 9 to decompile the apk.

6. When this is done running you can minimize APK Manager as we will not be utilizing this for a little while. Navigate to the folder that is labeled "projects" and open the folder labeled "framework-res.apk". Open the folder that is labeled "res". Open the folder that is labeled "values".

7. Open the Notepad++.

8. Click and drag the xml file that is named "colors" from the values folder that we navigated to earlier. You will see a whole bunch of items that look like this:

PHP Code:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
    <color name="darker_gray">#ffaaaaaa</color>
    <color name="white">#ffffffff</color>
    <color name="black">#ff000000</color>
    <color name="transparent">#00000000</color>
    <color name="background_dark">#ff000000</color>
    <color name="background_light">#ff555555</color>
    <color name="safe_mode_text">#80555555</color>
    <color name="bright_foreground_dark">#ff555555</color>
    <color name="bright_foreground_dark_disabled">#80555555</color>
    <color name="bright_foreground_dark_inverse">#ff999999</color>
    <color name="dim_foreground_dark">#ff555555</color>
    <color name="dim_foreground_dark_disabled">#80555555</color>
    <color name="dim_foreground_dark_inverse">#ff555555</color>
    <color name="dim_foreground_dark_inverse_disabled">#80555555</color>
    <color name="hint_foreground_dark">#ff808080</color>
    <color name="bright_foreground_light">#ff999999</color>
    <color name="bright_foreground_light_inverse">#ff555555</color>
    <color name="bright_foreground_light_disabled">#80000000</color>
    <color name="dim_foreground_light">#ff555555</color>
    <color name="dim_foreground_light_disabled">#80555555</color>
    <color name="dim_foreground_light_inverse">#ff555555</color>
    <color name="dim_foreground_light_inverse_disabled">#80555555</color>
    <color name="hint_foreground_light">#ff808080</color>
    <color name="lighter_gray">#ffdddddd</color>
    <color name="perms_dangerous_grp_color">#ffdd6826</color>
    <color name="perms_dangerous_perm_color">#ffdd6826</color>
    <color name="shadow">#cc222222</color>
    <color name="search_url_text_normal">#ff7fa87f</color>
    <item type="color" name="search_url_text_selected">@color/black</item>
    <item type="color" name="search_url_text_pressed">@color/black</item>
    <item type="color" name="search_widget_corpus_item_background">@color/lighter_gray</item>
    <item type="color" name="sliding_tab_text_color_active">@color/black</item>
    <item type="color" name="sliding_tab_text_color_shadow">@color/black</item>
    <color name="keyguard_text_color_normal">#ff555555</color>
    <color name="keyguard_text_color_unlock">#ffa7d84c</color>
    <color name="keyguard_text_color_soundoff">#ff555555</color>
    <color name="keyguard_text_color_soundon">#ffe69310</color>
    <color name="keyguard_text_color_decline">#fffe0a5a</color>
    <color name="config_defaultNotificationColor">#ff00ff00</color>
</resources>
9. We will be changing the primary text color, so we will be modifying the color of:
PHP Code:
<color name="bright_foreground_dark">#ff555555</color>
<color name="bright_foreground_dark_disabled">#80555555</color>
<color name="bright_foreground_dark_inverse">#ff999999</color> 
10. The items above are listed in their hex form. The first 2 hexadecimal places "ff" signify the alpha or transparency of the text. The next six are going to signify the color. Pick what ever color you want for the 2 items from any hexadecimal chart (http://html-color-codes.com/). I am going to be using bright pink and light blue for the example.

11. We would change the code of the bright_foreground_dark as this is the primary text color and we want it to be hot pink. We would have the following:
PHP Code:
<color name="bright_foreground_dark">#ffff00ff</color>
<color name="bright_foreground_dark_disabled">#80ff00ff</color> 
12. Next we need to set the inverse to the light blue so we would have the following:
PHP Code:
<color name="bright_foreground_dark_inverse">#ff66ccff</color> 
13. We now want to save this file by pressing either Ctrl+S or clicking the disk icon at the top. We can close Notepad++ after we save.

14. Restore APK Manager and run option 11 which will recompile the apk that we decompiled earlier.

15. Go to the folder that is labeled "place-apk-here-for-modding" and you will now see the file "unsignedframework-res.apk".

16. Delete you file that is labeled "framework-res.apk" and rename "unsignedframework-res.apk" to "framework-res.apk". Copy this back into whatever theme you would like and flash the zip as normal by mounting the system and then installing the zip from SD-Card.
 
roboots21
Old
#2  
Member
Thanks Meter 3
Posts: 94
Join Date: Aug 2010
Is this similar to changing actual fonts? I'd love to play around with some different fonts ..

Sent from my DROID2 using XDA App
 
theecho
Old
#3  
theecho's Avatar
Senior Member - OP
Thanks Meter 3
Posts: 321
Join Date: May 2009
Location: Chesapeake, VA

 
DONATE TO ME
Quote:
Originally Posted by roboots21 View Post
Is this similar to changing actual fonts? I'd love to play around with some different fonts ..

Sent from my DROID2 using XDA App
no it is not