[Android Themes] kroz:
BASICS INSIDE THE APK

3 basic file types/extensions we will be dealing with most of the time

1. .xml - color codes, image redirections, are inside this file (use Notepadd++ to open such files)

2. .png - these are the images/icons we usually see on most part of the phone ui (open using photoshop/gimp and dont edit using paint or you will lose its transparency background)

3. .9.png - stretchable pngs that expand or shrink depending on the usage (these images has a black pixel boarder that needs to be preserved, or else you will be having error in compiling)

color codes (hex codes)

quick overview of color hexcodes (range - 0 1 2 3 4 5 6 7 8 9 A B C D E F)

#FF000000 as an example (represents black while white is #FFFFFFFF)

FF or the first two letters of the code represents its transparency 00 means full transparent while FF is opaque (im using 88 or 80 for semi transparent)

next 6 digits are the RGB color code, look at this way #FFRRGGBB

if you want solid red, use #FFFF0000, solid green #FF00FF00, solid blue #FF0000FF

just play with the color codes (im sure you have just played with it in most of the rom options)

decompiled apk

once you decompiled apk, you will noticed a folder named res (this is our main concern, we will be working with this folder all the time)

inside the res folder...

there are lots of drawable-** folder that contains all of our images (.png and .9.png),

most of the icons are located in drawable-xhdpi and drawable-hdpi,

you can also find values folder containing some xmls such as

styles.xml - this xml is where i usually make my inverts of ui (from holo.light to holo for example)

drawables.xml - some color codes were redirected here

colors.xml - some of the hex codes inside styles.xml were redirected here, most color codes inside drawable folder and color folder are also redirected here, so i can only have one place of editing when converting color codes on my color versions of themes

next is the xml folder

xmls inside this folder controls the apps being themed, you can find package names of the apps as the xmls filenames

if you will noticed, there are some xmls here having upper cases, that's why we need the modified aapt.exe (again thanks titanic_fanatic)

last is the mipmap-** folder

this folder contains all the themed launcher icons, i already redirected all my themed app's launcher icons here

file names

how do i named the images? let's put an example

go to res/xml and look for com_android_calculator2.xml

now this is the xml that controls my themed calculator, if you open up the xml via Notepad++ you will notice the original png file names being replaced by my own themed png through a line code

this line for example (this is the delete icon in calculator)

<item name="drawable/calc_clear_symbol">@drawable/calculator_calc_clear_symbol</item>

the stock/original png which is calc_clear_symbol.png under drawable-xhdpi folder

<item name="[B][COLOR="Red"]drawable/calc_clear_symbol[/COLOR][/B]">@drawable/calculator_calc_clear_symbol</item>

is now being replaced by my themed icon calculator_calc_clear_symbol.png under drawable-xhdpi folder

<item name="drawable/calc_clear_symbol">@[B][COLOR="Red"]drawable/calculator_calc_clear_symbol[/COLOR][/B]</item>

i just put a prefix calculator_ so i can easily locate where they are when modifying

**most of the themes out there uses the app's package name as their prefix

for example...

in my theme i use

<item name="drawable/calc_clear_symbol">@drawable/[B][COLOR="Red"]calculator_[/COLOR][/B]calc_clear_symbol</item>

but others and most of them use

<item name="drawable/calc_clear_symbol">@drawable/[B][COLOR="Red"]com_android_calculator2_[/COLOR][/B]calc_clear_symbol</item>

i just make it simple the way i can easily search them in my drawables folder