How to define a Button
with custom background and the attribute
"?attr/selectableItemBackground"
?
With this code the "?attr/selectableItemBackground"
attribute is ignored, it doesn't show the touch feedback.
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:foreground="?attr/selectableItemBackground"/>
With this other code the selectable works but I lose the background color:
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"/>
ripple
drawables instead. – Isoniazid