Skip to content

Instantly share code, notes, and snippets.

@Nonda95
Created April 5, 2018 10:30
Show Gist options
  • Save Nonda95/53e7b976e77c7adcba53f1c3ca19a174 to your computer and use it in GitHub Desktop.
Save Nonda95/53e7b976e77c7adcba53f1c3ca19a174 to your computer and use it in GitHub Desktop.
Start Activity with Shared Element Transition
fun goToDetails(url: String, imageView: View) {
val options = ActivityOptionsCompat.makeSceneTransitionAnimation(this, imageView, imageView.transitionName).toBundle()
Intent(this, DetailActivity::class.java)
.putExtra(IMAGE_URL_KEY, url)
.let {
startActivity(it, options)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment