[Q] GB OTA - 9patch images not working - T-Mobile LG G2x

I'm theming my own handset by modifying the images in the SystemUI.apk and framework-res.apk from the GB OTA.
While doing this, I'm noticing that NONE of the images have the .9 pixels included in the image. When I run through the draw9patch tool and create an image it doesn't interpret the 9patch and instead shows me the 9patch pixels in the image. WTF?
If I pull a 9patch from the SDK and slap it into the APK, it does the same ****, so I'm pretty confident that it's nothing that I've done wrong.
Anyone know what's up with this? Did LG kill the 9patch thing because they were to incompetent to figure it out or what?

Related

Location of an input field image file

EDIT: SOLVED.
Thanks to all the amazing threads on this site, I'm able to and in the process of theme-ing my phone (blues instead of greens). I've transformed all of the .9.pngs that i could find in the drawable-hdpi folders in both com.htc.resources.apk and framework-res.apk. Thus far, everything has been good (once i realized the bottom and right traces in draw9patch were for content regions..)
As you can see in the images attached, the outline and highlight of the textfield has been modified from the original green in portrait mode. However, there seems to be 2 pesky images that i cannot find for landscape (the last two attached images). Ive looked thru the drawable-land-hdpi as well in both of the apks. I haven't left a single orange colored .9.png file. Hell, i even modified the textfield_im_user_pressed_pad.9.png and textfield_im_user_selected_pad.9.png in the stock MMS.apk drawable-hdpi folder. I simply cannot find this file...
The one orange-colored image which i thought was it, keyboard_textfield_pressed.9.png in com.htc.resources.apk, was not.
Unless, its an XML color or drawable...in which case im screwed. Any help would be greatly appreciated.​
EDIT: Found the correct file...turns out its in the HTC_IME_hi.apk drawables. keyboard_textfield_pressed.9.png and keyboard_textfield_selected.9.png if anyone was wondering..

[solved] Nine Patch PNGs

Hey guys. I've been working on replacing some of the UI elements in AOSP android, and ran into a snag. I'm having trouble manipulating nine patch png images.
I have read up on them pretty exhaustively and I know how they work. I've been trying to use the draw9patch tool that comes with the android sdk and it seems just totally ineffective. I draw my borders in it like you are supposed to and save the file, but when I load it onto my phone, the black lines around the border show up and it stretches as if I had not done anything.
I am pretty sure I am doing the lines right, in the tool the images stretch just as they are supposed too. It's like the png files aren't encoded correctly, because the phone seems to be just ignoring the .9 data.
Any advice?
EDIT:
So, uh, I found it:
http://forum.xda-developers.com/showthread.php?p=5206698

[Q] [IDEA] Porting HDPI themes to MDPI

Just recently been into themes and knew how they work.
If I use some kind of batch image resizer to resize hdpi png's to mdpi, and put those resized in drawable-mdpi it would work.
Am I correct? I see no reason why it can't be as easy as that.
I resize them with GIMP. Don't know what you use but in theory have to work
well, i don't know any coding language.
Maybe someone could make a script to resize images??
it would be a pain in the a** to resize them one by one
There are many batch resize windows apps that will let you convert a complete folder full more at once..
just google it
Sent on the run from my Magic 32A
It will not work on many .9.PNG files unless you resize them from source. Sorry but I've tried it with my theme. .9.png files are not just normal png files. They are made to stretch and readjust depending on the orientation of your device (landscape versus portrait) and may have what is called 'guides' coded within the images to tell the OS how to display that graphic. If you were to edit that file in any way those guides are over written and it messes up your whole theme. So if you were to use a batch resizer you would probably experience a disgusting looking interface coupled with acore crashes. Unless of course you used the files from source and just created the app from the source code. But who knows you might get lucky and whatever app that you are trying to theme may not use those pesky .9.png files.
Binary100100 said:
It will not work on many .9.PNG files unless you resize them from source. Sorry but I've tried it with my theme. .9.png files are not just normal png files. They are made to stretch and readjust depending on the orientation of your device (landscape versus portrait) and may have what is called 'guides' coded within the images to tell the OS how to display that graphic. If you were to edit that file in any way those guides are over written and it messes up your whole theme. So if you were to use a batch resizer you would probably experience a disgusting looking interface coupled with acore crashes. Unless of course you used the files from source and just created the app from the source code. But who knows you might get lucky and whatever app that you are trying to theme may not use those pesky .9.png files.
Click to expand...
Click to collapse
Thank you for this Binary100100..
In a regular theme, about how many pngs are .9?
and what do you mean "created from source"?
MicroMina said:
Thank you for this Binary100100..
In a regular theme, about how many pngs are .9?
and what do you mean "created from source"?
Click to expand...
Click to collapse
.9.png with guides? I have no clue. For an entire rom... I would say over a hundred easily. There are about a dozen of them just in the Dialer app itself. If you modify any one of them the whole thing get's messed up. It's very delicate. What do I mean create it from source? Download the source code from HTC website on a Linux machine and create the ENTIRE rom from scratch. It's not that hard actually once it's all set up. Before you do the "make" command you would do your xml edits, resizing, color edits, etc. You can tell what a .9.png file is because it has a line on the right of the image and a line on the bottom beneath it. It will have a black pixel at the top and one on the left. So you edit those files the way that you want it and then create the app or the entire rom. If you chose to create the entire rom then remove the parts from the rom that you don't want in your theme and then make an update-script file for your flashable theme. Nobody said that making a theme is fun or easy and in many cases the developers of the theme (like myself) do it just because they did it for their own device and chose to share their work. On average if you want to create an entire theme it will take you at least 30+ hours of work if you are already set up and knowledgable with Linux and image editing. That's how long it took me anyway.
Thank you for this very informative post.
I guess its not that easy after all. Maybe one day I could try it.
Thanks again.
MicroMina said:
Thank you for this very informative post.
I guess its not that easy after all. Maybe one day I could try it.
Thanks again.
Click to expand...
Click to collapse
Oh it's plenty easy, it's just very time consuming to make a theme from scratch and since you can't take a 3kb file measuring 20 x 20 and turn it into 36 x 36 and turn it into a 5.4 kb file without losing resolution (thus defeating the purpose of being on a AMOLED HD display) even if you were to suceed it probably still won't look very good. Think of it like this. Take a standard 800 x 600 video for your non-high definition television. Sure it looks alright but what about if you displayed it on a 1080p television. Is the picture going to look any better? Not really because it's the quality of the video and not the television itself. Now, if you could enhance the video... it would make a huge improvement. But by simply resizing the images wouldn't really do anything for a HD screen (my theory anyway).
But if you build everything from the source code (that is such as Cyanogen's github) and edit all the images from scratch then you shouldn't have a problem. But it is VERY time consuming like I mentioned before. I loathe the idea of upgrading my phone now because that means that my current theme along with all of the work that I've done with it... will be obsolete until I can do it all over again from source. Ugh.

[Q] PNG's in the framework (Resolved)

some of the png's i open in photoshop have a black background/black pixely border. i have took a ss of one of the media control images as an example and it's attached below.
if anyone knows why this is happening could you please give me an idea? It's not all just a few here and there.
droidx11 said:
some of the png's i open in photoshop have a black background/black pixely border. i have took a ss of one of the media control images as an example and it's attached below.
if anyone knows why this is happening could you please give me an idea? It's not all just a few here and there.
Click to expand...
Click to collapse
because i believe you are looking at .9.png's which use black borders as a guide for stretching if the file is something.9.png then that is your answer
hmm.. i haven't seem to have a problem editing the .9 PNG's, i've tried searching this forum and a few other forums and haven't found that anyone has asked this.. that particular png file name is "ic_media_play". i've also had the same problem when opening the wifi, 3g, some of the keyboard buttons, the "spinner_black_16" image. i've tried opening them in firefox then copying image, dragging them directing into photoshop and a few other things. sorry if this is a newb question...
droidx11 said:
hmm.. i haven't seem to have a problem editing the .9 PNG's, i've tried searching this forum and a few other forums and haven't found that anyone has asked this.. that particular png file name is "ic_media_play". i've also had the same problem when opening the wifi, 3g, some of the keyboard buttons, the "spinner_black_16" image. i've tried opening them in firefox then copying image, dragging them directing into photoshop and a few other things. sorry if this is a newb question...
Click to expand...
Click to collapse
well ic_media_play isnt a .9.png so if it has a black outline its just for the way it looks the wifi, 3g, and spinner_black_16 images you shouldnt have a problem with since they arent .9.png's either, most of the keyboard images are tho and will need to be decompiled and recompiled to get them to work correctly. im working on a theme right now and theres no easy way to edit them, oh also if you're using something like 7zip to open up the apk that might be your problem i edit most of mine in Linux so i dont remember if you can open them in Photoshop without decompiling but the best way is to decompile, edit, then recompile and there are guides out there that describe how to better than i could but search for apktool or apkmanager
Funnyface19 said:
well ic_media_play isnt a .9.png so if it has a black outline its just for the way it looks the wifi, 3g, and spinner_black_16 images you shouldnt have a problem with since they arent .9.png's either, most of the keyboard images are tho and will need to be decompiled and recompiled to get them to work correctly. im working on a theme right now and theres no easy way to edit them, oh also if you're using something like 7zip to open up the apk that might be your problem i edit most of mine in Linux so i dont remember if you can open them in Photoshop without decompiling but the best way is to decompile, edit, then recompile and there are guides out there that describe how to better than i could but search for apktool or apkmanager
Click to expand...
Click to collapse
first i'd like to thank you for your response. what i am doing is unzipping the contents from framework-res with winrar. (i was planning on just replacing the unzipped folders with the existing folders that are in framework-res, just overwriting them.) then i just pulled the images from the unzipped folder, res -> drawable-hdpi, into photoshop... in the unzipped folder thumbnail image, these images seem to look okay, no border/stroke around the edges, no black bg etc. but in photoshop they seem to have locked layers named "index" which i just change the mode to RGB to make the layer editable. i'm not sure what i'm doing right, i'm sure it's something i'm not doing right, i just can't figure it out - maybe i'll try a different program to unzip the folder?
i've attached a ss of the folder with the thumbnail images looking okay.
(p.s. this theme is for my gf)
I've been working on a theme also, though not for the DX... I had to completely remake the PNG's in question. I'm on OSX using Photoshop and it does the same thing. First start with an indexed color version then once you get it done on a block level convert it to an RGB 8-bit image and smooth the image with a very mild gaussian blur or lens blur... personally I use gaussian.
Here's a screenshot of mine in action... I made the "empty" signal bars hollow with a neon outline..
You'll want to use 7-zip, not sure about the black stroke on the images, sounds like a .9 PNG issue. I don't use Photoshop personally, I use Fireworks. It could be Photoshop putting the stroke on the images...If you have access to Fireworks, trying using that instead.
k0smo86 said:
You'll want to use 7-zip, not sure about the black stroke on the images, sounds like a .9 PNG issue. I don't use Photoshop personally, I use Fireworks. It could be Photoshop putting the stroke on the images...If you have access to Fireworks, trying using that instead.
Click to expand...
Click to collapse
winRAR is fine too you can open a zip file without having to unzip the entire contents, personally i use linux/Ubuntu which has an awesome photoshop like picture editor G.I.M.P. idk if you can download it or not for windows but you could check it out
droidx11 said:
first i'd like to thank you for your response. what i am doing is unzipping the contents from framework-res with winrar. (i was planning on just replacing the unzipped folders with the existing folders that are in framework-res, just overwriting them.) then i just pulled the images from the unzipped folder, res -> drawable-hdpi, into photoshop... in the unzipped folder thumbnail image, these images seem to look okay, no border/stroke around the edges, no black bg etc. but in photoshop they seem to have locked layers named "index" which i just change the mode to RGB to make the layer editable. i'm not sure what i'm doing right, i'm sure it's something i'm not doing right, i just can't figure it out - maybe i'll try a different program to unzip the folder?
i've attached a ss of the folder with the thumbnail images looking okay.
(p.s. this theme is for my gf)
Click to expand...
Click to collapse
lol sure its for HER lol you can use 7zip/winRAR either one but use it to extract the drawable res folder out and pull them into photoshop, edit the ones you want and put them back in the one already zipped up, but if you do it that way stay away from .9.png's
XGX5309 said:
I've been working on a theme also, though not for the DX... I had to completely remake the PNG's in question. I'm on OSX using Photoshop and it does the same thing. First start with an indexed color version then once you get it done on a block level convert it to an RGB 8-bit image and smooth the image with a very mild gaussian blur or lens blur... personally I use gaussian.
Here's a screenshot of mine in action... I made the "empty" signal bars hollow with a neon outline..
Click to expand...
Click to collapse
looks very nice so far, did you edit the analog clock also? looks amazing... thanks for the tips.
k0smo86 said:
You'll want to use 7-zip, not sure about the black stroke on the images, sounds like a .9 PNG issue. I don't use Photoshop personally, I use Fireworks. It could be Photoshop putting the stroke on the images...If you have access to Fireworks, trying using that instead.
Click to expand...
Click to collapse
thanks for the advice, i'll give fireworks a try and see how it turns out.
Funnyface19 said:
lol sure its for HER lol you can use 7zip/winRAR either one but use it to extract the drawable res folder out and pull them into photoshop, edit the ones you want and put them back in the one already zipped up, but if you do it that way stay away from .9.png's
Click to expand...
Click to collapse
hahaha yea i was trying on that pink to see how it looked on me . I'm going to try to dl GIMP along with fireworks to see how they turn out and yea i've read about those .9.png's on other threads about how they weren't changing over in certain apps. hopefully i won't run into this problem but if i do then its back to the pros on xda for advice. lol
Update - Editing the PNG's in fireworks, works like a charm, a lot smoother. Thanks everyone for your useful and helpful information
You should be able to option +2x click the index layer and then cmd + J in PS to mod it without redrawing it.
Hth
Sent from my SCH-I800 using XDA App

Theming guide anyone???

Need help from a fellow liberty theme. I've been having problems theming .9.png's. It doesn't seem to matter if I decompile, theme, and recompile, or just use gimp/photoshop in or out of the file. I'm using an existing theme already I'm not building xmls or anything using the same resources. I'm also using draw9patch to draw the patches for when i decompile it. After recompiling it and or flashing it it either bootloops or it'll boot up but EVERYTHING will force close or all of the .9.png's are stretched weird and show the black lines I put in with draw9patch. Is there any themer that could share a step by step guide on how they do it or how to deal with theming .9.png's. any how to out there is not working and its getting really difficult not to give up. I'm sure it is probably my fault but theres no guides on this and I'm really trying to learn
Sent from my DROIDX using XDA App
It may not be the images causing your bootloops or FC's, but a different issue when recompiling. When you recompile, do you get .9 error messages? If not, try pulling out your images and adding them to the original framework-res.apk just through 7zip. If you do get error messages from the .9's while compiling then it is an issue with the guides not being drawn correctly.
UnkleDuke said:
It may not be the images causing your bootloops or FC's, but a different issue when recompiling. When you recompile, do you get .9 error messages? If not, try pulling out your images and adding them to the original framework-res.apk just through 7zip. If you do get error messages from the .9's while compiling then it is an issue with the guides not being drawn correctly.
Click to expand...
Click to collapse
I didn't get any errors this last time. And I used archive manager on Linux to pull the images from the drawable hdpi folder to the one in the themes folder I'm using as a base and it is a liberty 1.5 theme and I'm using liberty 1.5 and everything was fc'ing
Sent from my DROIDX using XDA App
First, read this thoroughly:
http://developer.android.com/guide/developing/tools/draw9patch.html
You take a .9, rename it to a regular .png. Open it, edit it, save it. (as .png still) open that .png inside of draw9patch, add your lines. Save the image (as a .9.png). Put the image into eclipse to recompile the image. (Make an unsigned .apk, and pull it)
This is the only way I've ever done it, and it works every single time. People saying that you should add the lines in photo shop or anything else are lucky I guess, caues I've never got that to work for me.
joe772 said:
First, read this thoroughly:
http://developer.android.com/guide/developing/tools/draw9patch.html
You take a .9, rename it to a regular .png. Open it, edit it, save it. (as .png still) open that .png inside of draw9patch, add your lines. Save the image (as a .9.png). Put the image into eclipse to recompile the image. (Make an unsigned .apk, and pull it)
This is the only way I've ever done it, and it works every single time. People saying that you should add the lines in photo shop or anything else are lucky I guess, caues I've never got that to work for me.
Click to expand...
Click to collapse
I use draw9patch save it and put it in the drawable hdpi used apktool to compile and then just pulled em to the other drawable hdpi grrrrr
Sent from my DROIDX using XDA App
http://androidforums.com/droid-x-all-things-root/246462-theme-help-tutorial.html
sometimes i take the png they give, open it up in photoshop and draw over the layers. that way the size resolution and other things remain the same except for the image

Categories

Resources