List of usage examples for android.view Window setSharedElementReturnTransition
public void setSharedElementReturnTransition(Transition transition)
From source file:com.kogitune.activitytransition.ActivityTransition.java
public ExitActivityTransition start(Bundle savedInstanceState) { if (interpolator == null) { interpolator = new DecelerateInterpolator(); }//from w ww . ja v a 2s . c o m final Bundle bundle = fromIntent.getExtras(); if (Build.VERSION.SDK_INT >= 21) { final TransitionData transitionData = new TransitionData(toView.getContext(), bundle); if (transitionData.imageFilePath != null) { TransitionAnimation.setImageToView(toView, transitionData.imageFilePath); } ViewCompat.setTransitionName(toView, toViewName); final Window window = ((Activity) context).getWindow(); TransitionSet set = new TransitionSet(); set.addTransition(new ChangeBounds()); set.addTransition(new ChangeImageTransform()); set.setInterpolator(interpolator); window.setSharedElementEnterTransition(set); window.setSharedElementReturnTransition(set); return new ExitActivityTransition(null); } final Context context = toView.getContext(); final MoveData moveData = TransitionAnimation.startAnimation(context, toView, bundle, savedInstanceState, duration, interpolator); return new ExitActivityTransition(moveData); }