1

i got a button which replaces the current fragment with a custom slidein - slideout animation.

FragmentTransaction ft = manager.beginTransaction(); ft.setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left); ft.replace(R.id.fragment_container, fragment); ft.commit();

On the Button i want to use a ripple like this:

android:background="?selectableItemBackgroundBorderless"

Everything technicly works, but you cant see the ripple-animation. You only see it if you press the button very long. The slidein animation starts before the ripple is visible. How can i make the ripple visible?

elpatricko
  • 488
  • 5
  • 17
  • 1
    UX-wise, as a user I do not care about ripple animation, I need to see the action after my button click. What you want to do, is to make the user wait after click, which is not good. – azizbekian Jun 13 '17 at 08:57

1 Answers1

0

Take a look at this answer about ripple effect.

Also notice that ripple effect only works at API 21 and higher.

Community
  • 1
  • 1
Mahdi-Malv
  • 16,677
  • 10
  • 70
  • 117