List of usage examples for android.view Window setSharedElementEnterTransition
public void setSharedElementEnterTransition(Transition transition)
From source file:com.kogitune.activitytransition.ActivityTransition.java
public ExitActivityTransition start(Bundle savedInstanceState) { if (interpolator == null) { interpolator = new DecelerateInterpolator(); }/*from ww w . j ava 2 s. co 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); }