Skip to content

Instantly share code, notes, and snippets.

@KunalChaubal
Last active June 12, 2020 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KunalChaubal/ad8210da0180382aea4d607fe7b64ac2 to your computer and use it in GitHub Desktop.
Save KunalChaubal/ad8210da0180382aea4d607fe7b64ac2 to your computer and use it in GitHub Desktop.
cardView.setOnClickListener {
val intent = Intent(this, DetailActivity::class.java)
val pairImage = Pair<View, String>(imageView, resources.getString(R.string.transition_image))
val pairTitle = Pair<View, String>(tv_title, resources.getString(R.string.transition_title))
val pairDesc = Pair<View, String>(tv_desc, resources.getString(R.string.transition_body))
val pairBack = Pair<View, String>(cardView, resources.getString(R.string.transition_container))
val activityOptions = ActivityOptions.makeSceneTransitionAnimation(this, pairImage, pairTitle, pairDesc, pairBack)
startActivity(intent, activityOptions.toBundle())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment