TEST

Difficulties with *.9.png

Discussion in 'Theme Development' started by patricki7, Nov 16, 2011.

  1. patricki7

    patricki7 Members

    Trophy Points:
    0
    Working on porting a theme to MIUI and I'm running into troubles with certain PNGs. I do realize that they are patch 9 and sometimes require using the patch 9 tool, which I have tried.

    The culprit appears to be "status_bar_close_on.9.png". When I use the default one, or someone else's the status bar works perfectly fine. Whenever I try to use my own however, it will open, but you can't flick the status bar back up. As in its stuck open, and you have to push home or the back button.

    Original - status_bar_close_on.9.jpg

    Modified - status_bar_close_on.9.jpg

    Now I also realize that side does matter. If i have the original applied, it works perfect. If I open it in either Photoshop CS5 or GIMP and paint a solitaire red pixel on it, it will no longer work. Basically I'm lost and I could really use some help getting over this hurtle. If anyone has advice I would be extremely thankful.

    Here's the whole class for you too - http://localhostr.com/file/ibnfs9q/com.android.systemui.rar
  2. Google Adsense

  3. Antennas

    Antennas Members

    Trophy Points:
    0
    From what I can tell, it's because you don't really understand how the markers are supposed to work.
    Top and left edges, define what parts of the image /stretch/. You should only need 1 pixel for each part you want to stretch (so for example along the top edge you would need one pixel anywhere between the arrows and notification text, and another on the opposite side).
    The right and bottom edges define the /active/ area, I guess. Normally this will define where the text can fit into an area, but for this particular image, I believe it's a bit trickier. I'll link two images to try and help you out.

    [​IMG]
    This is the default image that comes with miui, extracted from the systemUI. As you can see, the whole bottom edge is definied as active (I image to tell you where you can grab it, or the likes). Top edge has two stretch markers so that the image doesn't become lopsided (with that little dash being too far over one way). On the right edge, you'll see 1 pixel at the top, and opposite it another pixel on the left; the left one defines this line as stretching. This is because the status_bar_close_on fits /behind/ the notification and toggles images, and so the pixel on the right defines this as the area that those images can fit in (I believe). Hopefully this custom example will make it more clear.

    [​IMG]
    This is from a custom theme I was once making that used textural images. Because they obviously can't be stretched (it would ruin the image) I needed to make them the /actual/ size of the screen they were going to be on. As you can see it is much taller than the default image, because the notification and toggles images need to fit on top as said before.

    Both of these images work.
    Your best bet when working on .9.pngs you're unsure of, is to extract the default image from your miui rom, and work from there. Obviously there'll be some instances where it won't be a /direct/ replacement (because for example you obviously need a wider image in this case than the default) but as long as you keep the markers relatively the same you shouldn't have any problems.

    Hopefully that helps you out a bit.
  4. patricki7

    patricki7 Members

    Trophy Points:
    0
    Thank you for the extremely informative post. That does clear up the .9.pngs much better.

    Just to get this out of the way, the first image you said was extracted from MIUI default theme. I tried applying it into mine with no avail. The status bar will scroll down, but once there will not scroll up. Also, are we supposed to be able to see the patch lines when the template is actually applied? I think I'm missing something here.

    The modified version of the png I attached was just one of many attempts I had made. What i don't understand is, why will modifying 1 solitaire pixel in certain images prevent functions from working correctly. If I'm not mistaken, shouldn't it simply just not stretch correctly?

    Is there any other process between, making image in PS, importing to patch9, saving, and applying?

    Thanks again for clearing up the patch markers :D
  5. Antennas

    Antennas Members

    Trophy Points:
    0
    ok, right... yeah.
    .9.png's with the markers /aren't/ the final step.
    When you compile an app with the .9.png's, it (i guess) modifies them to properly work with the system. This involves removing the markers and I'm sure other things too. Because you're just placing the images in your .mtz, you're missing that compiling step.

    The way I do this is via an annoyingly time consuming method involving a program called eclipse and setting up a developer environment.
    I can't immediately find a method to do this, but I'll take a look tomorrow after I've had a rest. :p
    Feel free to have a look yourself, and if you need I'll fix it up in the file you pm'd me, later. It's always good to learn these things yourself, however!
  6. patricki7

    patricki7 Members

    Trophy Points:
    0
    Thanks very much, I have actually used Eclipse before for my Java/Android class :p
  7. patricki7

    patricki7 Members

    Trophy Points:
    0
    Amazing!

    It works! I still think there is just some sort of hidden alpha layer or something. Thanks again for your amazing help :D
  8. Antennas

    Antennas Members

    Trophy Points:
    0
    Excellent!
    You can never tell how much experience someone has had, so I just always go for baby steps. xP
    (I for example learnt /all/ of this a few months ago, completely from scratch... I'm art/design rather than technically inclined).

    Good luck with future themeing!
  9. melissapugs

    melissapugs Members

    Trophy Points:
    11

Share Our Site