Skip to content

Instantly share code, notes, and snippets.

@dynoChris
Last active June 20, 2021 20:55
Show Gist options
  • Save dynoChris/f454c99c24e1055b85f2fbc07b710272 to your computer and use it in GitHub Desktop.
Save dynoChris/f454c99c24e1055b85f2fbc07b710272 to your computer and use it in GitHub Desktop.
How to make ripple effect to the button in android on the example of a round button
//link: https://stackoverflow.com/questions/9884202/custom-circle-button
//place to the drawable folder as ripple_effect.xml
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@android:color/holo_green_light">
<item>
<shape android:shape="rectangle">
<corners android:radius="200dp"/>
<solid android:color="@android:color/holo_green_dark"/>
</shape>
</item>
</ripple>
//using
//android:background="@drawable/ripple_effect"
//android:clickable="true"
//android:focusable="true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment