Created
September 13, 2015 07:00
-
-
Save mortenjust/91fe6a6e00002318188c to your computer and use it in GitHub Desktop.
Shared element transition #android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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