Untitled
unknown
plain_text
2 years ago
834 B
18
Indexable
override fun instantiateItem(container: ViewGroup, position: Int): Any {
val itemView = inflateBinding<ItemRoomPhotoBinding>(LayoutInflater.from(context), container)
val photoUrl = getItem(position)?.photoUrl?.large ?: ""
itemView.run {
glideImageLoader.loadImageUrl(photoImageView, photoUrl) { width, height ->
if (height > width) {
photoImageView.scaleType = ImageView.ScaleType.FIT_CENTER
setBlurImage(photoBackgroundImageView, photoUrl)
} else {
photoImageView.scaleType = ImageView.ScaleType.CENTER_CROP
}
}
root.setOnClickListener {
imageClickListener()
}
container.addView(root)
return root
}
}Editor is loading...
Leave a Comment