Skip to content

Instantly share code, notes, and snippets.

@gibson-khs
Last active November 28, 2017 08:28
Show Gist options
  • Select an option

  • Save gibson-khs/44f0aa0bfa2977b3f67c9f954586ea75 to your computer and use it in GitHub Desktop.

Select an option

Save gibson-khs/44f0aa0bfa2977b3f67c9f954586ea75 to your computer and use it in GitHub Desktop.
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static ActivityOptionsCompat getTransitionOptions(View... views) {
Activity activity = (Activity) views[0].getContext();
Pair<View, String>[] pairs = new Pair[views.length];
for (int i = 0; i < views.length; i++) {
View view = views[i];
pairs[i] = Pair.create(view, view.getTransitionName());
}
return ActivityOptionsCompat.makeSceneTransitionAnimation(activity, pairs);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment