3

I'm currently designing some ImageButtons to be drawn on top of a map, and one of them is supposed to bring up a list of currently favourited markers that would be permanently displayed on the map.
Apart from holding down the custom InfoWindow, a marker can be added to this list from a separate activity by clicking a button on the that activity's action bar, which for its icon uses the android vector asset named star_border.
Now, as the ImageButton's src, I would like to use a combination of the list vector asset and the star, which would sort of be in the bottom right, like a subscript. Can this be done by editing together XML code, or do I use a third party program?

2 Answers2

3

You may want to take a look at the <layer-list />. With it you can stack multiple drawable. But scaling and centering is a pain on its own.

Xerusial
  • 525
  • 1
  • 5
  • 17
1

Create XML file under Drawable and put your SVG images as like that:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

  <item
    android:drawable="@drawable/your_image_first"
    android:gravity="center"/>

  <item
    android:drawable="@drawable/your_image_second"
    android:gravity="center"/>
</layer-list>
canerkaseler
  • 6,204
  • 45
  • 38