Ripple Selector Disabled on Original Background

When you use the android:background="?android:attr/selectableItemBackgroundBorderless" , it gives a nice ripple circle. Https://developer.android.com/training/material/animations.html says It will be drawn upon, and bounded by, the nearest parent of the view with a non-null background.

How do you get around this? I know there must be a way because when using the standard ActionBar it worked fine. When I used compat toolbar, it no longer worked and shuts down. If you take a colored background from a toolbar, it works fine, but I want a colored toolbar ... Does anyone know how to use the toolbar class and still have a limited selector with no limits?

As a note, I ask about this for the toolbar, but I have a few other places where I also need to do the same (I use a stretcher like Play Music, which also has unlimited buttons), therefore, although the workaround is for the toolbar would be nice, it would be nice to have a common solution. Also note that I am NOT talking about the problem described in the ripple effect on the toolbar disabled . I’m talking about the fact that the selector is cut off at the borders of the parent, and not cut off at the borders of the buttons.

+6
source share

All Articles