HWThemes for EMUI 4.0 - issue with incorrect stretching of UI elements (i.e.messages)

wolfensg

Senior Member
Oct 24, 2014
219
87
0
Kraków
The problem I'm facing is the way the backgrounds for messages (bg_message_recevied.9.png and bg_message_send.9.png) are being stretched (see the screenshot and notice how the message box gets ungly when long message present).
In order to conceal the problem I have made the png files bigger but it does not look as nice as I would like to.

Does anyone know what to do in order to force them to resize properly? i.e. while keeping the corners of the images scaled properly?
I've edited the files which were scaled properly when used without changes in different theme but they do not work properly on mine once being modified (I've tried to make modifications using XnView, paint.Net, MS Paint, ImageEdit and result was always the same).

Any help would be much appreciated.
 

Attachments

Last edited:

wolfensg

Senior Member
Oct 24, 2014
219
87
0
Kraków
Ok, problem solved.
For some elements where the name ends with .9 the 9-patch is required to be used ( http://draw9patch.com ).

Explanation from site: "A nine-patch-image is used in android to and normally ends width the extension *.9.png and is used to make a image stretchable without destroying the corners. ". So the specially modified PNGs need to be used with markers for stretching.
 
  • Like
Reactions: ahh988

mmapcpro

Senior Member
Jun 13, 2011
1,058
274
0
DuPont, WA
Ok, problem solved.
For some elements where the name ends with .9 the 9-patch is required to be used ( http://draw9patch.com ).

Explanation from site: "A nine-patch-image is used in android to and normally ends width the extension *.9.png and is used to make a image stretchable without destroying the corners. ". So the specially modified PNGs need to be used with markers for stretching.
So when after you used the draw 9 patch tool, do you "recompile" the archive file, or do you simply "store" it?
 

wolfensg

Senior Member
Oct 24, 2014
219
87
0
Kraków
So when after you used the draw 9 patch tool, do you "recompile" the archive file, or do you simply "store" it?
Usualy when I am to modify any 9patch based asset (and usually any other asset or XML file) I do:

- copy the original PNG file and do required editing
- open the edited PNG file in any tool which enables putting the stretch sections ( ninepatch-editor-1.29.jar or Patchworker)
- save modified PNG file (it will have stretch marks in black 1 px wide bars on each side)
- then I use the xUltimate-9Patch compiler to compile the marks into the PNG
- then I put the modified/final PNG file in the original location

In terms of location it usually is within com.android.messaging or so - which is a zip file (with another .HWT zip container) so anyway... the repacking the archive after all the above steps is the final step.
 

mmapcpro

Senior Member
Jun 13, 2011
1,058
274
0
DuPont, WA
Usualy when I am to modify any 9patch based asset (and usually any other asset or XML file) I do:

- copy the original PNG file and do required editing
- open the edited PNG file in any tool which enables putting the stretch sections ( ninepatch-editor-1.29.jar or Patchworker)
- save modified PNG file (it will have stretch marks in black 1 px wide bars on each side)
- then I use the xUltimate-9Patch compiler to compile the marks into the PNG
- then I put the modified/final PNG file in the original location

In terms of location it usually is within com.android.messaging or so - which is a zip file (with another .HWT zip container) so anyway... the repacking the archive after all the above steps is the final step.
Do you know where I can download that 9-patch compiler tool? I'm having trouble finding it.