diff --git a/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentsAdapter.kt b/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentsAdapter.kt index 99c7777220..4805a1186b 100644 --- a/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentsAdapter.kt +++ b/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentsAdapter.kt @@ -98,7 +98,7 @@ class AttachmentsAdapter : RecyclerView.Adapter() { fun isScaled(position: Int): Boolean { val holder = recyclerView?.findViewHolderForAdapterPosition(position) if (holder is ZoomableImageViewHolder) { - return holder.touchImageView.attacher.scale > 1f + return holder.views.touchImageView.attacher.scale > 1f } return false } diff --git a/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/ImageLoaderTarget.kt b/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/ImageLoaderTarget.kt index 9166c2ce4f..531e8171e1 100644 --- a/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/ImageLoaderTarget.kt +++ b/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/ImageLoaderTarget.kt @@ -44,29 +44,29 @@ internal class DefaultImageLoaderTarget(val holder: AnimatedImageViewHolder, pri override fun onResourceLoading(uid: String, placeholder: Drawable?) { if (holder.boundResourceUid != uid) return - holder.imageLoaderProgress.isVisible = true + holder.views.imageLoaderProgress.isVisible = true } override fun onLoadFailed(uid: String, errorDrawable: Drawable?) { if (holder.boundResourceUid != uid) return - holder.imageLoaderProgress.isVisible = false - holder.touchImageView.setImageDrawable(errorDrawable) + holder.views.imageLoaderProgress.isVisible = false + holder.views.imageView.setImageDrawable(errorDrawable) } override fun onResourceCleared(uid: String, placeholder: Drawable?) { if (holder.boundResourceUid != uid) return - holder.touchImageView.setImageDrawable(placeholder) + holder.views.imageView.setImageDrawable(placeholder) } override fun onResourceReady(uid: String, resource: Drawable) { if (holder.boundResourceUid != uid) return - holder.imageLoaderProgress.isVisible = false + holder.views.imageLoaderProgress.isVisible = false // Glide mess up the view size :/ - holder.touchImageView.updateLayoutParams { + holder.views.imageView.updateLayoutParams { width = LinearLayout.LayoutParams.MATCH_PARENT height = LinearLayout.LayoutParams.MATCH_PARENT } - holder.touchImageView.setImageDrawable(resource) + holder.views.imageView.setImageDrawable(resource) if (resource is Animatable) { resource.start() } @@ -77,30 +77,30 @@ internal class DefaultImageLoaderTarget(val holder: AnimatedImageViewHolder, pri override fun onResourceLoading(uid: String, placeholder: Drawable?) { if (holder.boundResourceUid != uid) return - holder.imageLoaderProgress.isVisible = true - holder.touchImageView.setImageDrawable(placeholder) + holder.views.imageLoaderProgress.isVisible = true + holder.views.touchImageView.setImageDrawable(placeholder) } override fun onLoadFailed(uid: String, errorDrawable: Drawable?) { if (holder.boundResourceUid != uid) return - holder.imageLoaderProgress.isVisible = false - holder.touchImageView.setImageDrawable(errorDrawable) + holder.views.imageLoaderProgress.isVisible = false + holder.views.touchImageView.setImageDrawable(errorDrawable) } override fun onResourceCleared(uid: String, placeholder: Drawable?) { if (holder.boundResourceUid != uid) return - holder.touchImageView.setImageDrawable(placeholder) + holder.views.touchImageView.setImageDrawable(placeholder) } override fun onResourceReady(uid: String, resource: Drawable) { if (holder.boundResourceUid != uid) return - holder.imageLoaderProgress.isVisible = false + holder.views.imageLoaderProgress.isVisible = false // Glide mess up the view size :/ - holder.touchImageView.updateLayoutParams { + holder.views.touchImageView.updateLayoutParams { width = LinearLayout.LayoutParams.MATCH_PARENT height = LinearLayout.LayoutParams.MATCH_PARENT } - holder.touchImageView.setImageDrawable(resource) + holder.views.touchImageView.setImageDrawable(resource) } } } diff --git a/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/VideoLoaderTarget.kt b/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/VideoLoaderTarget.kt index d88faba110..078edfc548 100644 --- a/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/VideoLoaderTarget.kt +++ b/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/VideoLoaderTarget.kt @@ -49,19 +49,19 @@ internal class DefaultVideoLoaderTarget(val holder: VideoViewHolder, private val override fun onThumbnailResourceCleared(uid: String, placeholder: Drawable?) { if (holder.boundResourceUid != uid) return - holder.thumbnailImage.setImageDrawable(placeholder) + holder.views.videoThumbnailImage.setImageDrawable(placeholder) } override fun onThumbnailResourceReady(uid: String, resource: Drawable) { if (holder.boundResourceUid != uid) return - holder.thumbnailImage.setImageDrawable(resource) + holder.views.videoThumbnailImage.setImageDrawable(resource) } override fun onVideoFileLoading(uid: String) { if (holder.boundResourceUid != uid) return - holder.thumbnailImage.isVisible = true - holder.loaderProgressBar.isVisible = true - holder.videoView.isVisible = false + holder.views.videoThumbnailImage.isVisible = true + holder.views.videoLoaderProgress.isVisible = true + holder.views.videoView.isVisible = false } override fun onVideoFileLoadFailed(uid: String) { @@ -82,8 +82,8 @@ internal class DefaultVideoLoaderTarget(val holder: VideoViewHolder, private val } private fun arrangeForVideoReady() { - holder.thumbnailImage.isVisible = false - holder.loaderProgressBar.isVisible = false - holder.videoView.isVisible = true + holder.views.videoThumbnailImage.isVisible = false + holder.views.videoLoaderProgress.isVisible = false + holder.views.videoView.isVisible = true } }