Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ripple for button not working

Tags:

android

ripple

The ripple effect I have given to the background of the button is not working.It just switches the color.The device version is 5.1.1.Please help me!!!

ripple.xml:

<ripple
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="@android:color/white"> <!-- ripple color -->

    <item android:drawable="@android:color/holo_blue_bright"/> <!-- normal color -->

</ripple>
like image 292
jobin Avatar asked Jul 19 '26 06:07

jobin


1 Answers

Have you tried like this

<Button
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/selectableItemBackground"
    android:text="New Button" />

But here you cant change ripple effect color

like image 110
Navneet Krishna Avatar answered Jul 20 '26 21:07

Navneet Krishna