android, background, layer-list and scalable bitmap item android, background, layer-list and scalable bitmap item android android

android, background, layer-list and scalable bitmap item


I don't know how are these images, but, for example, you could make a big image and use it in a item android:drawable field, in this way the image takes the item's size.

<layer-listxmlns:android="http://schemas.android.com/apk/res/android"><item>  <bitmap android:src="@drawable/base_bg"    android:gravity="bottom" /></item><item android:top="10dp" android:left="10dp" android:drawable="@drawable/decoration1"></item><item android:top="10dp" android:left="10dp" android:drawable="@drawable/decoration2"></item></layer-list>

Other solutions could be to do it programmatically with LayerDrawable (here) and Drawable (here) classes. You could construct the Layer Object with 3 Drawable Objects and then choose the correct size on each Drawable object with the method setBounds(Rect ).

I hope it helps you.