HTC’s New Ad Campaign And What It Really Means

HTC has just released three new blind test adverts comparing app loading … more

XDA Picks: Best Apps of the Week (June 27 – July 4)

Apps are at the front and center of any smartphone experience, and with over a … more

HTC One M9 Developer Edition Android 5.1 OTA

The Developer Edition of the HTC One M9 is receiving an over-the-air update to Android 5.1. … more

Index Project For XDA Device Subforums

Another ambitious project from the collaborative efforts of Recognized Contributors and Forum … more

[APP][15 June 2010] XmlGui - Tool for editing HTC Xml layout file

2,228 posts
Thanks Meter: 96
By programatix, Senior Member on 24th August 2009, 02:37 PM
Post Reply Subscribe to Thread Email Thread

The main reason I wrote this small app is to modify the Xml layout files used in more recent HTC applications. HTC however defined different format of Xml layout files.

Currently, this is what it can do:
  • Change objects' location (attributes involved "x", "y", "loc")
  • Change objects' size (attributes involved "w", "h", "width", "height")
  • Perform object transformation using a multiplicand value
  • Handle sub objects declared in parent object's attribute when parent object is tranformed ("IconImgPos", TextPos")
  • Handle "BgImgBlock" attribute by animating the object
  • Handle "BgImgGrid" attribute by drawing the object correctly
  • Draw object with "IconImgMask" and "IconImage" attributes correctly
  • When changing the position of a parent object, the children object (can be seen in the TreeView) will also be moved. It does not however resize the object control when the parent object is resized. This is by design.

I'll be adding more format to this app when I have some free time.

  • 0.0.1
    • This app currently only support Xml layout files which defined the position attributes as "x", "y", "w", "h". This format is used in Album 3 and Connection Setup.
  • 0.0.2
    • Added support for layout which contain attributes "img", "icon", "pic". This layout is used in FullScreenPlayer.
    • You can now drag and drop a xml file onto it to open.
    • If the "icon" contain different states, it will be animated, each will be displayed for 1 second before rotating to another state.
  • 0.0.3b
    • Added support for layout which contain attributes "Pos", "bgimg", and some I can't remember.
    • Fix a bug in 0.0.3 where it handle the "Pos" attribute incorrectly.
    • Quick fix loading EzInput layout *New*
  • 0.0.4f
    • Recoded most of the code.
    • XmlGui now only draws objects which are marked (checked). If the object is selected, a red border will be drawn on the selected object.
    • Text area will be drawn as blue hatched area.
    • Object with sub object will be resized correctly based on the object.
    • Added ability to move all marked objects.
    • Added ability to resize all marked objects. (see attached thumbnails)
    • Correctly interpret "BgImgGrid" attribute. (0.0.4a)
    • When adjusted single object's height and width, children object now do not resize. (0.0.4a)
    • Animate button "BgImgBlock" attribute. (0.0.4a)
    • Fix drawing text position in "Edit" object. (0.0.4b)
    • Fix moving inner object when object is moved (0.0.4b)
    • Fix drawing object with "BgImgGrid" attribute. (0.0.4c)
    • Fix issue resizing object without the "x" and "y" attributes. (0.0.4d)
    • Fix issue with Pos attribute where each point is not seperated by ",". (0.0.4e)
    • Seperate multiplicand for width and height. (0.0.4f)
    • Fix divide by zero bug. (0.0.4f)
  • 0.0.4g (2 Nov 2009)
    • Fixed loading attributes with space in its value crashing XmlGui.
    • Fixed loading Pos and TextPos attributes with no value crashing XmlGui.
  • 0.0.5 (5 Feb 2010)
    • Fixed saving problem when the attribute of the file is marked "read-only" and/or "system".
    • Selection of selected item in TreeView stays after TreeView lost focus.
    • Added new feature to automatic relocate objects.
      • In "Single-Object Properties" section, clicking on the green left arrow will apply the suggested value for that field. Clicking the "Apply" button applies all the suggested values.
      • In "Multi-Object Move" section, clicking the "Auto Relocate" button will apply the above feature to all selected objects.
    • Bug: If clicking "Auto Relocate" mess things up, try highlighting "root" before clicking it.
  • (6 Feb 2010)
    • Added 1 level "Undo" feature. This is a rough implementation, so after pressing undo button, the TreeView would lost its selection.

  • (15 June 2010)
    • Fixed crash caused by negative value.

  • XmlGui requires .NET Framework 3.5.
  • If XmlGui can't open the xml file, edit it with any text editor and remove the first line. Save and reopen in XmlGui.
  • Please be aware that HTC does not resize all images according to the size stated in the xml file. Take for example the HTCFramework package. The htccalendar_bg_green.png is resized in the calendar, but is not resize when you select a day. The background and the buttons (Set and Cancel) are also not resized. So, the only way around this is also to resize (or crop) the images yourself.

I'm very grateful for the donation given. Thank you very much. It would encourage me to add more new automate features to it too.
  • Noonski
  • francarl
Attached Thumbnails
Click image for larger version

Name:	XmlPreview1.jpg
Views:	3718
Size:	91.2 KB
ID:	221802   Click image for larger version

Name:	XmlPreview2.jpg
Views:	2251
Size:	85.4 KB
ID:	221803  
Attached Files
File Type: zip - [Click for QR Code] (66.8 KB, 507 views)
File Type: zip - [Click for QR Code] (66.9 KB, 446 views)
File Type: zip - [Click for QR Code] (70.6 KB, 95 views)
File Type: zip - [Click for QR Code] (72.4 KB, 618 views)
File Type: zip - [Click for QR Code] (91.1 KB, 779 views)
Last edited by programatix; 20th June 2010 at 06:24 PM.
24th August 2009, 06:26 PM |#2  
programatix's Avatar
OP Senior Member
Thanks Meter: 96
Ported Packages using XmlGui

XML-GUI Shared Folder
  • Folder - Everybody can upload and download files here.
Last edited by programatix; 10th February 2010 at 03:40 PM. Reason: Hope the OP doesn't mind
24th August 2009, 06:32 PM |#3  
12aon's Avatar
Retired Senior Moderator
Thanks Meter: 437
Donate to Me
So if I would want to port a newer version of connection setup or album this tool would be all I need?

Any other apps you that use xml for layout?

Nice one, 12
25th August 2009, 12:35 AM |#4  
programatix's Avatar
OP Senior Member
Thanks Meter: 96
Originally Posted by 12aon

So if I would want to port a newer version of connection setup or album this tool would be all I need?

Any other apps you that use xml for layout?

Nice one, 12

Yes. Just modify the .xml files in the packages and the apps are resized correctly. Of course if you want to maintain the aspect ratio of the background (if used), you'll need to crop it first (by cutting some part away) using any imaging software you prefer. Btw, I've already ported Connection Setup layout to VGA here (

To see what other HTC apps that uses xml, just search for the xml files in your packages. If they are there, then it uses the xml files as layout. The hard part is, there are different format available. I'm thinking of finding all the different format used and put them in the XmlGui.
Last edited by programatix; 25th August 2009 at 02:14 AM.
25th August 2009, 02:30 AM |#5  
Thanks Meter: 0
Tested on Leo New Contact Card, and it couldnt read any of the values.

Great tool, will come in handy, keep up the good work.
25th August 2009, 03:07 AM |#6  
l3v5y's Avatar
Retired Senior Moderator
Flag Bristol
Thanks Meter: 39
Donate to Me
Great idea for a tool!

Will be very useful with more WVGA stuff coming out...
25th August 2009, 07:58 AM |#7  
c_shekhar's Avatar
Recognized Developer
Thanks Meter: 34
Great idea.
One day it shall become a big tool for porting the utility from one device to another.
Keep going bro!!
25th August 2009, 08:05 AM |#8  
elite67's Avatar
Senior Member
Flag Santa Ana
Thanks Meter: 17
can we get a rhodium 2.6 manila working landscape now!
25th August 2009, 09:11 AM |#9  
gullum's Avatar
Senior Member
Thanks Meter: 10
this shure can come in verry handy
25th August 2009, 03:12 PM |#10  
l3v5y's Avatar
Retired Senior Moderator
Flag Bristol
Thanks Meter: 39
Donate to Me
Attached is a file it has trouble with from HTCMagnifier package from the Leo (I've also included the images from that package).

Hope this is useful somehow...

Attached Files
File Type: zip - [Click for QR Code] (30.8 KB, 61 views)
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes