Latest versions of YouTube app on android shows a ripple which is pretty different.
That is when we lift our finger from button, then at the time of ending ripple it shows stroke.
How to achieve this type of ripple in android?
Latest versions of YouTube app on android shows a ripple which is pretty different.
That is when we lift our finger from button, then at the time of ending ripple it shows stroke.
How to achieve this type of ripple in android?
It is actually just a ripple background by setting android:background="?selectableItemBackground"
In Youtube button example,
<RelativeLayout
android:id="@+id/rl_chat_search"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground" <-- ripple effect
android:layout_margin="10dp">
<ImageView
android:src="@drawable/ic_download"
/>
<TextView
android:text="Download"
/>
</RelativeLayout>
Add below two attribute in your click view.
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"