My View
hierarchy looks like this:
<RelativeLayout>
<ImageView
android:id="@+id/my_background_image"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
androd:id="@+id/my_image"
android:clickable="true"
android:foreground="?attr/selectableItemBackground" />
</LinearLayout>
</RelativeLayout>
If I set an image Drawable
to my_background_image
, the ripple drawable provided by ?attr/selectableItemBackground
over my_image
disappears. It doesn't matter what image I use, the ripple is completely gone. I've also found that the background (which includes the down arrow) of any "foreground" Spinner
also disappears.
This is very strange behaviour. Does anyone know why this is happening?
Edit: I'd like to add that the ripple appears as long as src="..."
is not included in the background ImageView
or setImageDrawable()
is not called on it.