diff --git a/vector/src/main/java/im/vector/riotredesign/features/media/ImageMediaViewerActivity.kt b/vector/src/main/java/im/vector/riotredesign/features/media/ImageMediaViewerActivity.kt index c68f594f7e..fc5e272557 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/media/ImageMediaViewerActivity.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/media/ImageMediaViewerActivity.kt @@ -20,9 +20,11 @@ import android.content.Context import android.content.Intent import android.os.Bundle import androidx.appcompat.widget.Toolbar +import androidx.core.view.isVisible import com.github.piasy.biv.indicator.progresspie.ProgressPieIndicator import com.github.piasy.biv.view.GlideImageViewFactory import im.vector.riotredesign.core.di.ScreenComponent +import im.vector.riotredesign.core.glide.GlideApp import im.vector.riotredesign.core.platform.VectorBaseActivity import kotlinx.android.synthetic.main.activity_image_media_viewer.* import javax.inject.Inject @@ -44,9 +46,26 @@ class ImageMediaViewerActivity : VectorBaseActivity() { finish() } else { configureToolbar(imageMediaViewerToolbar, mediaData) - imageMediaViewerImageView.setImageViewFactory(GlideImageViewFactory()) - imageMediaViewerImageView.setProgressIndicator(ProgressPieIndicator()) - imageContentRenderer.render(mediaData, imageMediaViewerImageView) + + if (mediaData.elementToDecrypt != null) { + // Encrypted image + imageMediaViewerImageView.isVisible = false + encryptedImageView.isVisible = true + + GlideApp + .with(this) + .load(mediaData) + .dontAnimate() + .into(encryptedImageView) + } else { + // Clear image + imageMediaViewerImageView.isVisible = true + encryptedImageView.isVisible = false + + imageMediaViewerImageView.setImageViewFactory(GlideImageViewFactory()) + imageMediaViewerImageView.setProgressIndicator(ProgressPieIndicator()) + imageContentRenderer.render(mediaData, imageMediaViewerImageView) + } } } diff --git a/vector/src/main/res/layout/activity_image_media_viewer.xml b/vector/src/main/res/layout/activity_image_media_viewer.xml index 194b9d6066..61d5d286f9 100644 --- a/vector/src/main/res/layout/activity_image_media_viewer.xml +++ b/vector/src/main/res/layout/activity_image_media_viewer.xml @@ -1,6 +1,7 @@ @@ -18,4 +19,11 @@ app:failureImageInitScaleType="center" app:optimizeDisplay="true" /> + + \ No newline at end of file