Created
April 5, 2018 10:33
-
-
Save Nonda95/22c4206ee838bb483b782285d7f92e61 to your computer and use it in GitHub Desktop.
Set transition name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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