Skip to content

Instantly share code, notes, and snippets.

@mortenjust
Created September 13, 2015 07:00
Show Gist options
  • Save mortenjust/91fe6a6e00002318188c to your computer and use it in GitHub Desktop.
Save mortenjust/91fe6a6e00002318188c to your computer and use it in GitHub Desktop.
Shared element transition #android
// image = findviewbyid, etc
Bundle b = ActivityOptions.makeSceneTransitionAnimation(
this,
image,
image.getTransitionName()
).toBundle();
// start the activity with the bundle
Intent i = new Intent(this, detailActivity.class);
startActivity(i, b);
// set transition name for both views that will become the shared element
<View
android:transitionName="@string/transition_image"
// />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment