Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to give infinite ripple effect on button

I have a button in my app and I want to give a continuous /infinite ripple effect for that button . how to give infinite ripple effect on button without on click in android.

like image 545
Arjun090 Avatar asked Oct 31 '22 07:10

Arjun090


1 Answers

Android L's Ripple Effect - Touch Feedback for Buttons - Using XML

You can do something like this:

<Button
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:background="@drawable/ripple"

/>

<ripple xmlns:android="http://schemas.android.com/apk/res/android" 
                  android:color="?android:colorControlHighlight">
    <item android:id="@android:id/mask">
        <shape android:shape="oval">
            <solid android:color="?android:colorAccent" />
        </shape>
    </item>

like image 176
dpulgarin Avatar answered Nov 09 '22 11:11

dpulgarin