Using 9-Patch Images
If you enlist a professional designer to craft your UI, what they give you may not be achievable with XML drawables. It may still be possible to reuse the rendered asset in multiple places, though. For stretchable UI elements like button backgrounds, Android provides a tool called the 9-patch.
Your next task is to fix up the two TextViews at the top of the screen. You will keep your button layout the same, but use stretchable drawables for their backgrounds. Both of them are much narrower than your TextViews, so that they do not take up much space. The first one, window.png, is a stretchable background designed to give your TextView a tasteful fade, along with some border space on the edges.
Figure 25.5 Channel display ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access