I have a TextView
which is use as a button. I want to add attribute selectableItemBackgroundBorderless
to have circle ripple effect when pressing. The
1.To limit the ripple effect inside the view only you need to specify
android:background="?attr/selectableItemBackground"
inside the view.
2.For making ripple effect border less i.e show ripple effect in whole layout you can use this.
android:background="?attr/selectableItemBackgroundBorderless"
3.For more you can check the link Defining Custom Animation
You have to use ?android:attr/selectableItemBackground
to keep the ripple effect inside the View
boundaries.
?android:attr/selectableItemBackgroundBorderless
allows the effect to go outside of the View
.