ripple effect resumes after fragment back stack pop

ε祈祈猫儿з 提交于 2020-02-24 05:00:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!