Skip to content

Instantly share code, notes, and snippets.

@Nonda95
Created April 5, 2018 10:33
Show Gist options
  • Save Nonda95/22c4206ee838bb483b782285d7f92e61 to your computer and use it in GitHub Desktop.
Save Nonda95/22c4206ee838bb483b782285d7f92e61 to your computer and use it in GitHub Desktop.
Set transition name
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_detail)
val url = intent.getStringExtra(IMAGE_URL_KEY)
detailImage.transitionName = url
detailImage.load(url)
}
inner class ImageViewHolder(view: View) : RecyclerView.ViewHolder(view) {
fun bind(url: String) {
(itemView as ImageView).apply {
load(url)
transitionName = url
setOnClickListener { onClick(url, it) }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment