Deepakb09
12/2/2016 - 3:45 PM

Ripple Effect

Ripple Effect


<!--Conrtols the color of the ripple-->
  <item name="colorControlHighlight">#ColorCode</item>

<!--Add the following attribute to the views whose ripple animation you want to enable
  WITH BORDER-->
android:background="?android:attr/selectableItemBackground"
<!--Enable clickable or set onClickListener-->
android:clickable="true" 


<!--Add the following attribute to the views whose ripple animation you want to enable
  WITHOUT BORDER-->
android:background="?android:attr/selectableItemBackgroundBorderless"
<!--Enable clickable or set onClickListener-->
android:clickable="true" 

<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
     android:color="#ColorCode">
      
</ripple>
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
     android:color="#ColorCode">
     <!--Without mask, it will create a cborderless ripple-->
    <item android:id="@android:id/mask"
        android:drawable="@android:color/white"/>
</ripple>