[Android Themes] anthonycr:
THEME TEMPLATE

-

CM9

​

WARNING: MAY CAUSE A SEVERE ADDICTION TO THEMING​

I have received numerous requests about theming CM9 from various people, and after directing them all to my home forum where I have a template, a member here (ebs512) suggested that I post the template here because it was so useful.

Some up-and-coming themers have indicated that some of the experienced themers have been reluctant to help them too much with creating new themes so in order to alleviate both the flood of PMs that experienced themers have and the lack of help that the newbies receive, here is a CM9 Template for everyone.

It's currently only for MDPI and HDPI but Anyone can easily add XHDPI compatibility by using my XML generator, see directions at the bottom concerning Density and Compatibility

PREREQUISITES: YOU MUST HAVE APKTOOL INSTALLED

There are many, many tutorials on how to install apktool, just google it.

Directions:

1. Download the template from Mediafire (updated 7/20/2012)

2. Unzip the code to a convenient location

3. Edit the images, change colors, do everything you want to it

4. Choose the Compatibility you want by following the directions of your choice (See below 4.1-4.4)

5. Open up your command prompt

6. Enter the following command:

apktool b location_of_the_source_code_folder

and it will build.

7. Don't forget to sign the apk before installing it

8. Publish your theme here or on Google Play

DISCLAIMER: I am not responsible for negative comments you receive if you create a terrible theme. Everyone has full permission to create themes off this template and distribute them (if you plan on creating paid themes, please also provide a free download in the spirit of open source).

DIRECTIONS FOR XHDPI COMPATIBILITY

​

Since you are using apktool to build your theme, there are inherent problems that are unfixable. The problem lies in the location of the Preview.png that shows up when you open up the theme chooser. Leaving it out will let your theme be compatible with all densities, but you will not be able to show a preview.

4.1 To make compatible with HDPI and MDPI (and LDPI)

1. Install a framework-res.apk from a Samsung Galaxy S2 CM9 ROM by downloading the apk and typing:

apktool if location_of_SGS2_ICS_framework\framework-res.apk

2. Make sure you have HDPI and MDPI folders in the theme folder with the proper images

3. Place the Preview.png in the XHDPI folder, that's right, the XHDPI folder

4. Compile

4.2 To make compatible with MDPI only

1. Delete the contents of the HDPI folder

2. Move the Preview.png from the XHDPI folder (its default location) to the HDPI folder

3. Compile

4.3 To make compatible with XHDPI and HDPI

1. Delete the MDPI Folder

2. Install an XHDPI framework-res.apk from an XHDPI CM9 ROM (Like the Galaxy Nexus):

apktool if location_of_XHDPI_framework\framework-res.apk

3. Add Images for XHDPI to the XHDPI Folder (make sure they are named correctly)

4. Move the Preview.png from drawable-XHDPI to the drawable folder

5. Compile

4.4 To make compatible with everything

1. Open up the AndroidManifest.xml and add a backslash "\" before "@drawable/preview"

2. Add XHDPI images

3. Install an XHDPI framework-res.apk from an XHDPI CM9 ROM (Like the Galaxy Nexus):

apktool if location_of_XHDPI_framework\framework-res.apk

4. Compile

More information on how to theme certain elements is located in this wonderful guide by xda member nhnt11

I do not have a donation button, but if you feel like it, purchase one of my CM9 Themes (available on several forums for free) off google play

Please visit the original thread on my home forum also.

And... if you are really stuck and need to talk to me, send me a PM or hit me up on gtalk at anthonyrestaino11@gmail.com​