Skip to content

Instantly share code, notes, and snippets.

@cthulhuplush
Created January 13, 2017 10:43
Show Gist options
  • Save cthulhuplush/5bfba65c8c0ae3b9e318ff2459873d76 to your computer and use it in GitHub Desktop.
Save cthulhuplush/5bfba65c8c0ae3b9e318ff2459873d76 to your computer and use it in GitHub Desktop.
// Enter Shared Elements Transition
TransitionSet enterTransitionSet = new TransitionSet();
enterTransitionSet.addTransition(TransitionInflater.from(this).inflateTransition(android.R.transition.move));
enterTransitionSet.setDuration(TRANSITION_DEFAULT_TIME);
toFragment.setSharedElementEnterTransition(enterTransitionSet);
// Exit Shared Elements Transition
TransitionSet exitTransitionSet = new TransitionSet();
exitTransitionSet.addTransition(TransitionInflater.from(this).inflateTransition(android.R.transition.move));
exitTransitionSet.setDuration(TRANSITION_DEFAULT_TIME);
exitTransitionSet.setStartDelay(TRANSITION_DEFAULT_TIME);
toFragment.setSharedElementReturnTransition(exitTransitionSet);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment