[Epic 4G Themes] dreamsforgotten:
Learn To Theme Putting The Tools To Use Part 2 .9.pngs

We are going to walk through editing a .9 file and getting it back in place to do this as you read the guide.

Before you begin, check out this video from fxn

http://www.youtube.com/watch?v=KNvGgmJDqPQ

Now the guide will get you lined up with the instructions in the video.

Open "my computer" and navigate to C:\apk manager\.

In another window open C:\*\Documents\Themes\

Browse to the folder in Themes that holds your theme template

Right click and Browse your stock di18 theme template or rom.

Navigate to system/framework/

In your apk manager window, open the folder called place here for modding

Click and hold framework-res.apk in your second window which is the 7zip browing the zip file.

Drag the apk into place here for modding folder.

Now you can close the zip file window.

Back out of the place here for modding window and you should be back in the apk manager folder.

Run Script.bat and choose the option "9" and hit enter.

Click open the folder called projects

Click open the folder named framework-res.apk

Click open the folder named drawable-hdpi.

Find the file icon_highlight_rectangle.9.png Pay attention to the screen while your scrolling. Apk manager decompiled all the .9.png files exposing the lines that were used in draw9patch by default.

Right Click the file and choose edit with gimp.

Now in gimp you will see the picture, and the lines drawn in for draw9patch. This will save you time. Edit the picture as you see fit. Change the color, or completely redesign the image. Then when you goto save it, choose file save as. Keep the same file name but save it on your desktop, creating another folder naming it new theme nine files. Save the image.

Open up Eclipse.

Click on file-new-android project

When it Opens, click in the field named Project Name type "nine files"

In the field called "Built Target", choose Android 1.5, click the check box next to it.

In the field called "Application Name" type "ninefiles"

In the field called "Package Name" type "com.example.ninefiles"

No Quotes in any field.

Uncheck the box labeled "Create Activity".

Now your Workspace should be open in eclipse, and on the left pane there should be a folder labeled ninefiles. Double click on it and it will expand a folder tree. Look for res. Then click it if it's not expanded as well. Look for drawable. There will be a file in there called icon.png. Leave that file alone. Now on your desktop, open the folder called new theme nines. Click, drag and drop the edited icon_highlight_rectangle.9 file right into that drawable folder in eclipse. You are skipping using draw9patch because the lines were there from the start.

Now go back to the parent folder in Eclipse, the one labaled ninefiles where all the other folders come from. Right click on it and choose android tools all the way near the bottom. Then slide over and choose export unsigned application. This will bring up the save prompt on your screen, choose the desktop once again, and export it. It will show a message about the export and telling you to zip align it and sign it with a device key. Ignore all this, your just using Eclipse to target that .9.png. Keep in mind every time you open Eclipse now, it will show you the workspace with ninefiles. Expand the folders, delete the last image you used Eclipse to work on and add new ones in, bypassing the need to create a new android project each time.

Lets say your new .9.png image is nothing like the original and it won't display correctly using the lines on it after decompiling in apk manager. You need to feed the image through draw9patch.bat located in c:\android-sdk-windows\tools\

Double click it and a shell will open, then another one will open on top of it that has a square with a down arrow in it. Save your image from gimp into the folder on the desktop called new theme nines, like you did above. Then Drag and drop the saved image on top of the windows inside the square, and on top the arrow lol.

The picture will be transformed in draw9patch concentrate on the outer edges along the entire image. Bring your mouse over to the left of image around dead center. Click once and draw a pixel. Next go dead center on the top just like you did on the left and draw the 1 pixel. Now expand that line up and down on the left side looking at your 3 preview pictures on your right hand side. If there is no gradient or fade effect to your image the center pixel will be about good enough but if your image fades, expand that line up and down and your 3 previews will give you an idea if you capture it or not. Once you have the left side of the image looking good, begin the same process on the top. Use as little line as possible to have the image looking right. Never have a gap in the line that you draw.

Now focus on the right side and the bottom. The two lines drawn there should be about the size of the entire image minus a few pixels at the very end. You can get the idea from the one you pulled from apk manager and adjust the lines to work on your changes. When your done with draw9patch, click file save 9 patch. It will save in the folder on your desktop. Now drag and drop this image into the drawable folder of Eclipse/ninefiles as described above.

This should be a shortcut to getting you busy with 9 files. Any questions or anything noticed missing, please let me know.

One last bit of advice. Sometimes when you open a file in draw9patch, the image is zoomed in too big and you can't get to the outer edges to draw the top and bottom lines. There is a bar at the bottom of the program that will allow you to zoom in and out of the main image and zoom in more to the 3 preview images. Use these to adjust the image to where you can work with them.

All these introduction guides should get you started, your own drive should take you the rest of the way. I'm not the first to write a theme guide I'm just sharing with the Epic community because the amount of new users who are requesting how to do these things. All my information came from asking questions to those that were theming before me like Khanning, Crake, Chibucks, the list is never ending. Also this list of videos here have helped a lot:

http://xdaforums.com/showthread.php?t=593932