Need to place icon in center of the oval with solid color. It also needs to allow dynamically change the oval's color.
Could show the icon on top/center of the oval like this by Jérémie Laval:
<?xml version="1.0" encoding="UTF-8" ?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<solid android:color="#42000000" />
<padding android:left="8dp" android:top="8dp"
android:right="8dp" android:bottom="8dp" />
</shape>
<FrameLayout
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center"
android:background="@drawable/aitemring">
<ImageView
android:src="@drawable/coffee"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center" />
</FrameLayout>
The question how to change the color of the oval shape in code (kets say got new color #ff0000, or any non-predefined color)?