I want to customize my textview when pressed will look like this how to do that ?
Asked
Active
Viewed 75 times
-7
-
in your image it's not a `textview` it's a `recyclerview` – Ali Feb 23 '18 at 06:04
-
Check this: https://stackoverflow.com/q/27006288/7409774 – Milind Mevada Feb 23 '18 at 06:05
-
@Peter So you need to implement ripple effect on textview ... – duggu Feb 23 '18 at 06:05
-
use **ripple effect** ... – Omkar Feb 23 '18 at 06:05
-
Possible duplicate of [How to set a ripple effect on textview or imageview on Android?](https://stackoverflow.com/questions/33477025/how-to-set-a-ripple-effect-on-textview-or-imageview-on-android) – Gowthaman M Feb 23 '18 at 06:16
-
see this http://www.tothenew.com/blog/ripple-effect-in-android/ – Ankita Feb 23 '18 at 06:18
2 Answers
1
Create a ripple_effect.xml
file and add following code. res/drawable/ripple_effect.xml
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:color="#f816a463"
tools:targetApi="lollipop">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="#f816a463" />
</shape>
</item>
</ripple>
see the link : http://www.viralandroid.com/2015/09/how-to-add-ripple-effect-to-android-button.html implement it in your code where you want to add effect.
0
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="yourcolorcode">
<item
android:id="@android:id/mask"
android:drawable="@android:color/white" />
</ripple>

Ankita
- 1,129
- 1
- 8
- 15