What method can I use to get the layer-list item ID (first_image) in Java class?
layers.xml:
<item android:id="@+id/first_image">
<bitmap android:src="@drawable/android_red"
android:gravity="center" />
</item>
What method can I use to get the layer-list item ID (first_image) in Java class?
layers.xml:
<item android:id="@+id/first_image">
<bitmap android:src="@drawable/android_red"
android:gravity="center" />
</item>
You can programmatically access item of layer-list
by ID as given below.
GradientDrawable gradientDrawable = (GradientDrawable) layerDrawable
.findDrawableByLayerId(R.id.first_image);