I do have some basic understanding on how to achieve ripple effect for normal press.
How to set state_selected in ripple drawable
I was wondering, how can I achieve such long pressed ripple effect.
- Entire item is being highlighted when being pressed.
- After long pressed a while, the ripple starts to propagate starting from the area of finger pressed.
It is pretty hard to describe clearly from wording. I attach a video to show such effect.
https://www.youtube.com/watch?v=ebOYnGM0HCc
May I know how to achieve such long pressed ripple effect?
This is how a normal ripple effect looks like : https://www.youtube.com/watch?v=OJ_WRFy7pWM
which is achieved using common method.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="demo.org.myapplication.MainActivity">
<View
android:layout_width="250dp"
android:layout_height="250dp"
android:clickable="true"
android:background="?attr/selectableItemBackground" />
</LinearLayout>