问题
I am using native Fragments and a fragment transaction with add()
and hide()
. When I go back to the original fragment with the back button, the ripple animation from android:background="?attr/selectableItemBackground"
resumes from when I opened the fragment originally. How do I cancel an animation when hiding a fragment in a transaction?
getFragmentManager().beginTransaction()
.hide(this)
.add(R.id.fragment_container, fragment)
.addToBackStack(null)
.commit()
Edit: I am changing my app to use ViewPager.
来源:https://stackoverflow.com/questions/37020942/ripple-effect-resumes-after-fragment-back-stack-pop