I am trying to make a shared element transition between fragments, everything works fine when using replace()
to add the second fragment, however in the codebase add()
is used a lot, but when using that, transition just skips to end values
Is it possible to have the transition between added fragments?
Thanks
@Override
public void onClick(View v) {
setSharedElementReturnTransition(TransitionInflater.from(getActivity())
.inflateTransition(android.R.transition.move));
FragmentB secondFragment = new FragmentB();
secondFragment.setSharedElementEnterTransition(TransitionInflater.from(getActivity())
.inflateTransition(android.R.transition.move));
getFragmentManager().beginTransaction()
.add(R.id.container, secondFragment)
.addToBackStack(null)
.addSharedElement(imageView, imageView.getTransitionName())
.commit();
}
question from:
https://stackoverflow.com/questions/29259829/fragment-shared-element-transition-with-add-instead-of-replace 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…