I have several items I want to display. All the items have a title and subtitle. When I think about it's quite similar to bubbles in WhatsApp
or Facebook
. I guess these are implemented as 9-patch-drawables.
My background is like a circle and rectangle combined with two TextView
s in front.
My approaches:
- 9-patch-drawables: I can achieve the design, but I have to support several background colors. And images are very inflexible.
- drawable
xml
: when I create a drawable I can define an oval or a rectangle with corners as shapes. But the shapes scale. So in fact the circle part on the left is not really round.
Now I had a look at the AnalogClock
which really is perfectly round, but it inherits from View
and does measuring and painting by code.
So I assume I have to create a control on my own. Or are there any other approaches?
Requirements are:
- it must not skew, when I change any of the sides, but should scale
- I must be able to change the background color in code
- and of course I should be able to set the texts
Any hints for me how to achieve this?