[Fascinate Themes and Apps] nitsuj17:
*3.31.11*

Ok, I have the tools...now what???

:confused:

I. Working with regular images in your framework-res (and in a TW Rom, tw-framework-res)

A.

Where do I get a stock framework-res.apk and twframework-res.apk?

-a few options here...in an "ideal" scenario a dev or someone else has put out a stock but deodexed rom that you can just unzip and remove the frameworks/system apps/jars from...ie i generally grab mine out of something like jt1134's super clean roms or the equivalent. if a new os/update is out and that hasnt happened yet then move onto:

B.

How do I deodex my framework so I can theme it?

have you downloaded xultimate

-I'm not going to further update this, as xultimate is kinda self explanatory and virtually all of our releases are predeodexed. 3.18.11

C. Where are most of the images in a theme located??? (touchwiz-based roms)

-For some stupid reason, Samsung thought it would be a good idea to split the framework-res.apk into 2 files: framework-res.apk and twframework-res.apk (in all fairness htc kinda does this with htc.resources.apk and now gingerbread does this with systemui.apk). Therefore there are *2* places that the framework images are generally located.

II.

Working with the magical/infamous .9's

A.

What is a .9 image exactly?

-Well heres google's explanation :rolleyes:

-My less technical breakdown: basically .9 images are ones that are used either more than once in an .apk. If android had to define every single thing with a unique image, there would be a whole lot more going on in the framework and quite repetitive (it already is cluttered enough). By making an image that can be used in several places and stretched/resized in more than one way, it solves that issue.

1. 2.

1=Image with defined "patches" telling where to stretch/resize

2=stock/compiled .9 image

In example 1 we see a png image that is "patched" (but not compiled) the black lines on the very outside of the frame are telling android where it is allowed to stretch the image to make it fit where its needed. General rule of the thumb is a line all along the bottom of the frame where the image is and all along the right side, with a single dot in the top middle and the middle left of the frame. This differs depending on the shape. If you are patching in draw 9, on the right side of the screen it will show you the possible shapes the image can be stretched based upon your patches.

***Most of the force close problems people report when first getting into theming are a direct result of not understanding .9s. They simply try and edit the compiled 9 and then replace it in the framework, not understanding that when you edit the image in gimp/ps/whatever it strips the patches from the image and make it a standard png image, which does not tell the os the information it needs.

B.

Now that I know what .9s are (hopefully) how do i work with them?

-Well there are a few ways of going about this. For simplicity sake, I'm going to outline the method that I personally use. At some point if someone who does things the other way(s) wants to do a write up, I'll include that as an addendum.

1.

Editing pre-existing pngs.

a. You've opened up your framework/apk and taken a look at the images in there...you see a bunch that you want to change the color of or edit in some manner but you release that many of them have the .9 honor. best way to deal with these suckers is to decompile the framework with the images.

-put the apk in apkmanager...decompile it (see my write up on using apkmanager..coming soon)...and go into projects...navigate to the folder with the images and you ll notice that they now have their 9 patches showing....

feel free to now edit these images accordingly while preserving the patches. however...depending on your image software changing transparency levels will change the black patches as well.

*example* here is an .9 image that was decompiled (notice the black patches already there). in this instance ive used the rectangle tool in gimp to select the area inside of the 9 patches to colorize/color change to fit my theme. this is one way to edit .9s without using draw9 patch.

C.

Now that I've edited my .9 pngs

(either cheating them or patching them)

How Do I compile them?

1. The previously accepted method required using eclipse....but thanks to xeudoxus we have the awesome xUltimate Draw9Patch Compiler !

a. Download the program....and unpack it somewhere that you'll remember where it is (if you have adb/java in your PATH it doesn't have to be in the SDK-tools folder).

b. You will see examples (1, 2, and music) on how how to work with the program. Basically (after getting rid of the examples, but not the folders there in) put the .9s in one of the folders..(I use example1 generally, but it doesn't matter)..then run the program