-7

I want to customize my textview when pressed will look like this how to do that ?

how to do it ?

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
Peter Tu
  • 1
  • 1
  • 3

2 Answers2

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.

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
Anil Atri
  • 68
  • 8
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