taylordurden
taylordurden

Reputation: 357

Android L ripple effect not displayed

I've created a RecyclerView and set up an onItemClickListener to show an Activity, an AlertDialog or a Fragment. When I click to display the Activity or the Alert, it shows the ripple effect, but when I click on to display a Fragment, it doesn't. How can I make the ripple effect show when clicking on the Fragment list item?

Here's a link to my source if you're interested.

Upvotes: 3

Views: 777

Answers (1)

MLProgrammer-CiM
MLProgrammer-CiM

Reputation: 17257

Replacing a fragment is an instantaneous action, displaying an alert is delayed. The ripple animation happens while the alert is being displayed with the default fade-in animation as they're both playing at the same time; but not when changing fragments because there's no time for it.

You can try delaying replacing your fragment by means of an empty animation or a Timer thread.

Another option is adding an animation to the fragment transaction in a way that it allows for the ripple animation to finish.

Upvotes: 2

Related Questions