4

I'm using shared element transition between two fragments. The animation works well, but there is a white flash which happens in the fragment.

In my first fragment, I set shared element transition using:

getActivity().getSupportFragmentManager()
    .beginTransaction()
    .addSharedElement(ivPic, ViewCompat.getTransitionName(ivPic))
    .addToBackStack(null)
    .replace(R.id.fragment_container, fragment)
    .commit();

And in my second fragment inside onCreate():

Transition transition = TransitionInflater.from(getContext()).inflateTransition(R.transition.shared_element_transition);
setSharedElementEnterTransition(transition);
setSharedElementReturnTransition(transition);

Things I've tried:

  • setEnterTransition(null) in my second fragment
  • setCustomAnimations(0, 0) in fragment transition in first fragment
RandomyzeEverything
  • 764
  • 3
  • 7
  • 21

0 Answers0