How to make a circular ripple on a button when it's being clicked?

后端 未结 12 2203
一个人的身影
一个人的身影 2021-01-29 18:59

Background

On the dialer app of Android, when you start searching for something, and you click the arrow button on the left of the EditText, you get a circular ripple

12条回答
  •  独厮守ぢ
    2021-01-29 19:22

    You can create circle ripple drawable using android:radius attribute in xml.

    Example:

    
    

    Pay attention, that your your_radius should be less then your view width and height. For example: if you have view with size 60dp x 60dp your_radius should be near 30dp (width / 2 or height / 2).

    Work on Android 5.0 and above.

提交回复
热议问题