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

后端 未结 12 2109
一个人的身影
一个人的身影 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:30

    If you want ripple effect which will not cross the circle boundary, you can check this code. It works for me perfecrly. Just remember, you have to give id=@android:id/mask in ripple_blue.xml

    
    

    ripple_blue.xml

    
    
        
    
            
                
            
    
        
    
        
    
            
                
            
    
        
    
    
    

    color.xml

    
        #F2F5FC
        #0288d1
    
    

提交回复
热议问题