-
-
Save Richie97/b37b84b9cf4e90249471 to your computer and use it in GitHub Desktop.
Starting Activity Transition
This file contains 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
ImageView cardImage = (ImageView) findViewById(R.id.cardImage); | |
cardImage.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
//This is where the magic happens. makeSceneTransitionAnimation takes a context, view, a name for the target view. | |
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(MaterialActivity.this, cardImage, "cardImage"); | |
Intent intent = new Intent(MaterialActivity.this, DetailActivity.class); | |
startActivity(intent, options.toBundle()); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment