Conan Troutman · Apr 14, 2013 at 11:30 pm

Take Control of Those Pesky NinePatch Files

Everybody has a nemesis of some kind. Odysseus had Poseidon, for Captain Ahab it was the white whale, and Sherlock Holmes had Professor Moriarty. As for Android themers, well they have NinePatch (.9png) files.

If you aren’t familiar with NinePatch, check out this great tutorial which deals with the intricacies of working with these particularly troublesome image files. In summary, they are “stretchable” image files used for elements of the UI that often require resizing, such as a speech bubble used to contain a text message. Instead of storing multiple different sizes of the same image, it makes much more sense to simply resize the same one as needed, and that’s where NinePatch comes into play. Although on paper these files are an incredibly efficient solution to a problem, they can be a real nightmare to work with, as they need to be edited properly to avoid horribly misshapen and downright ugly images after the stretching takes place. And if you hadn’t already spent enough time messing around with one single file, when it dawns on you that you need to resize it for use on different screen sizes, this becomes a tempting solution to the problem.

Android Drawable Resizer by XDA Forum Member ~RoN~ should help to alleviate some of the frustration caused by these pesky images by allowing you to automatically resize the images for use on different resolutions. Once you have one size edited to your liking, simply use this Windows-based tool to specify it’s original density, select which densities you wish to create from your original, and the tool handles the rest. This is a fantastic time saver for any themers out there who aren’t afraid to tackle the NinePatch.

Check out the original thread for more information if you often find yourself spending too much time on this type of file.


_________
Want something on the XDA Portal? Send us a tip!

Conan Troutman

Conan Troutman is an editor on XDA-Developers, the largest community for Android users. Senior Moderator, Newswriter, Recovering Meme Addict. View Conan Troutman's posts and articles here.
Mario Tomás Serrafero · Aug 4, 2015 at 02:17 pm · no comments

Sony’s Emergence in The Middle: Is The Price Right?

Sony’s Electronics Division is not in its best days, and its smartphone products are seemingly an important cause of this. The Japanese giant’s Xperia line has been on the decline in terms of sales, and these past few months have been particularly damaging to the company due to the Xperia Z4’s market performance. Sony’s Q1 results were also not favorable, as its mobile division lost $184 million and sales slumped 16% year-on-year.   Not too long ago we featured a...

XDA NEWS
Eric Hulse · Aug 4, 2015 at 03:42 am · 1 comment

HTC Delivering Ads Straight to Sense Home

HTC's 2015 has been a year marked by a desperate search for revenue. The HTC One M9 launched with its own launcher complete with a Smart Folder in the Sense Home Widget. This automatic pseudo-folder would populate with "suggestions" that were nothing more than thinly-veiled ads.   Just over a month ago, HTC began placing advertisements (that can thankfully be disabled) in Blinkfeed. These Blinkfeed ads appeared after Yelp advertisements began appearing on HTC's Lock screen. Users, expectedly, voiced dissatisfaction all...

XDA NEWS
Brian Young · Aug 2, 2015 at 09:05 pm · 2 comments

Galaxy S6 & Edge get €100 Price Cut—New Models Incoming

Samsung has dropped the price of both the Galaxy S6 and S6 Edge by €100, making the current retail price of these phones €599 and €699, respectively. Though no new prices have been announced stateside, a cut is expected soon. (more…)

XDA NEWS