[Galaxy S II Android Development] Tired Storeman:
Centered Settings Sub Headers Tutorial

My Tutorial making skills are pretty average, and this is a pretty rough tutorial, but i hope you can understand what i am saying.

This tutorial assumes you know how to Decompile/Compile files, and edit xml files

I use Apktool 1.5.2 to Decompile and Compile files and Notepad++ to edit xml files,

Steps may be different if you use other software.

This is for stock theme only

PLEASE MAKE A BACKUP BEFORE YOU START

Step 1. On your phone, in system/framework make a new folder and name it Frame.

Step 2. On your desktop make a new folder and name it Center,open it and leave open

Step 3. Obtain framework-res.apk from your phone, NOT FROM UNZIPED ROM ON YOU COMPUTER by ether pulling with adb or copy from system/framework with Root Explorer to your desktop

Step 4. Decompile framework-res.apk (I use Apktool 1.5.2)

Step 5. Open the decompiled framework-res folder

Step 6. Open the res folder

Step 7. Open the values folder

Step 8. Open the styles xml file with what ever you use to open xml files (I use Notepad++)

Step 9. Search for tw_list_section_divider (you should find 2 results, i found lines 3908 and 3968, and edited 3908 your results may differ)

You need to edit the folowing

<style name="Widget.DeviceDefault.TextView.ListSeparator" parent="@style/Widget.Holo.TextView.ListSeparator">
<item name="textSize">17.0dip</item>
<item name="textStyle">normal</item>
<item name="textColor">#ffd2d2d2</item>
<item name="background">@drawable/tw_list_section_divider_holo_dark</item>
<item name="paddingLeft">16.0dip</item>
<item name="textAllCaps">false</item>
</style>

Your file might look slightly different, i have changed the text color.

Step 10. Add

<item name="gravity">center</item>

After

<item name="textColor">#ffd2d2d2</item>

Ending up with

<style name="Widget.DeviceDefault.TextView.ListSeparator" parent="@style/Widget.Holo.TextView.ListSeparator">
<item name="textSize">17.0dip</item>
<item name="textStyle">normal</item>
<item name="textColor">#ffd2d2d2</item>
[COLOR=Red]<item name="gravity">center</item>[/COLOR]
<item name="background">@drawable/tw_list_section_divider_holo_dark</item>
<item name="paddingLeft">16.0dip</item>
<item name="textAllCaps">false</item>
</style>

Here you can also change the text color and size if you want,

You can also change the textStyle from normal to bold, if you want bold text

or change textAllCaps from false to true if you want All Capital text.

Step 11. Save changes.

Step 12. Compile framework-res.apk.(you should not recieve any errors)

Step 13. Open the folder where it was compiled to (in Apktool it is the build/apk folder).

and replace the META-INF folder and the AndroidManifest.xml file from this folder with the META-INF folder and the AndroidManifest.xml file

from the original framework-res.apk, that you placed on your desktop.

Step 14. Compile framework-res.apk again.(again you should not recieve any errors)

You need to do the following steps to avoid bootloop

Step 15. Open the compiled framework-res.apk DO NOT UNZIP IT(in Apktool.it is in the dist folder)

Drag the

assets

META-INF

res

AndroidManifest.xml

resources.arsc

folders and files into the previously opened Center folder which you created on your desktop.

Step 16. If it is not already opened, open the Center folder

Step 17. Highlight all of the folders and files in the Center folder and right click on them(if using windows) and click add to archive (i am using Winrar)

In the window that pops up for Archive Format use Zip

and compression method use Store

Change Archive name to framework-res.apk

and hit ok.

Step 18. Once framework-res.apk has been made, copy/push it to the frame folder you made in the /system/framework folder previously on your phone, NOT THE FRAMEWORK FOLDER

Step 19. Set permissions to rw-r--r-- the same as the permissions for the framework-res.apk in /system/framework folder.

Step 20. Copy framework-res.apk from the /system/framework/frame folder to /system/framework folder replacing the original one,

Step 21 Hold the power button in until phone restarts.

Step 22. Enjoy

If phone bootloops, restore backup and try again

This process will have to be repeated everytime Goldie makes an update, or new version of his rom

Screenshot 1 Centered text normal

Screenshot 2 Centered text bold

Screenshot 3 Centered text All Capitals