Skip to content

Instantly share code, notes, and snippets.

@shubham08gupta
Last active August 17, 2017 17:57
Show Gist options
  • Save shubham08gupta/4619f40493d4beca0cc2b86630dfd1fe to your computer and use it in GitHub Desktop.
Save shubham08gupta/4619f40493d4beca0cc2b86630dfd1fe to your computer and use it in GitHub Desktop.
@Override
public void onClick(View v) {
if (v instanceof Button) {
ImageView circleImage = (ImageView) findViewById(R.id.iv_circle);
Intent intent = new Intent(AnimationActivity.this,ImageDetailActivity.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
startActivity(intent,
ActivityOptions.makeSceneTransitionAnimation(
this,
new Pair<View, String>(circleImage,
ViewCompat.getTransitionName(circleImage)))
.toBundle());
} else {
startActivity(intent);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment