Skip to content

Instantly share code, notes, and snippets.

@Richie97
Created August 7, 2014 19:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save Richie97/b37b84b9cf4e90249471 to your computer and use it in GitHub Desktop.
Save Richie97/b37b84b9cf4e90249471 to your computer and use it in GitHub Desktop.
Starting Activity Transition
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