I have created a list item (as shown in the picture) with an ImageView
(The beautiful Miranda Kerr) and an ImageButton
(The trash icon) with background selectableItemBackgroundBorderless
.
Now, when I click on the trash icon, the ripple is created behind the ImageView
Naturally, I want the ripple to take place in front of the image and behind the trash icon.
Full item.xml
:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
tools:src="@drawable/cover"
/>
<ImageButton
android:id="@+id/trash_image_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:src="@drawable/translucent_trash"
android:background="?attr/selectableItemBackgroundBorderless"
/>
</FrameLayout>