diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/AlbumThumbnailView.java b/app/src/main/java/org/thoughtcrime/securesms/components/AlbumThumbnailView.java index df88367710..bda4159c9a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/AlbumThumbnailView.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/AlbumThumbnailView.java @@ -150,7 +150,7 @@ public class AlbumThumbnailView extends FrameLayout { private void setSlide(@NonNull GlideRequests glideRequests, @NonNull Slide slide, @IdRes int id) { KThumbnailView cell = findViewById(id); - cell.setImageResource(glideRequests, slide, false, false); + cell.setImageResource(glideRequests, slide, false); cell.setThumbnailClickListener(defaultThumbnailClickListener); cell.setOnLongClickListener(defaultLongClickListener); } diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/AlbumThumbnailView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/AlbumThumbnailView.kt index c14c8fd662..5384be14e2 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/AlbumThumbnailView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/AlbumThumbnailView.kt @@ -1,7 +1,6 @@ package org.thoughtcrime.securesms.conversation.v2 import android.content.Context -import android.content.Intent import android.graphics.Canvas import android.graphics.Rect import android.util.AttributeSet @@ -11,7 +10,6 @@ import android.widget.FrameLayout import android.widget.TextView import androidx.core.view.children import androidx.core.view.isVisible -import kotlinx.android.synthetic.main.album_thumbnail_many.view.* import kotlinx.android.synthetic.main.album_thumbnail_view.view.* import network.loki.messenger.R import org.thoughtcrime.securesms.MediaPreviewActivity @@ -110,7 +108,7 @@ class AlbumThumbnailView : FrameLayout { // iterate binding slides.take(5).forEachIndexed { position, slide -> val thumbnailView = getThumbnailView(position) - thumbnailView.setImageResource(glideRequests, slide, showControls = false, isPreview = false) + thumbnailView.setImageResource(glideRequests, slide, isPreview = false) } albumCellBodyParent.isVisible = message.body.isNotEmpty() albumCellBodyText.text = message.body diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/utilities/KThumbnailView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/utilities/KThumbnailView.kt index 1710444c84..b070264944 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/utilities/KThumbnailView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/utilities/KThumbnailView.kt @@ -7,7 +7,6 @@ import android.net.Uri import android.util.AttributeSet import android.view.View import android.widget.FrameLayout -import android.widget.ProgressBar import androidx.core.view.isVisible import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.load.resource.bitmap.CenterCrop @@ -18,12 +17,10 @@ import kotlinx.android.synthetic.main.thumbnail_view.view.* import network.loki.messenger.R import org.session.libsession.messaging.sending_receiving.attachments.AttachmentTransferProgress import org.session.libsession.utilities.Util.equals -import org.session.libsession.utilities.ViewUtil import org.session.libsignal.utilities.ListenableFuture import org.session.libsignal.utilities.SettableFuture import org.thoughtcrime.securesms.components.GlideBitmapListeningTarget import org.thoughtcrime.securesms.components.GlideDrawableListeningTarget -import org.thoughtcrime.securesms.components.TransferControlView import org.thoughtcrime.securesms.mms.* import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader.DecryptableUri @@ -43,7 +40,6 @@ open class KThumbnailView: FrameLayout { private val playOverlay by lazy { play_overlay } private val captionIcon by lazy { thumbnail_caption_icon } val loadIndicator: View by lazy { thumbnail_load_indicator } - private val transferControls by lazy { ViewUtil.inflateStub(this, R.id.transfer_controls_stub) } private val dimensDelegate = ThumbnailDimensDelegate() @@ -88,23 +84,16 @@ open class KThumbnailView: FrameLayout { // endregion // region Interaction - fun setImageResource(glide: GlideRequests, slide: Slide, showControls: Boolean, isPreview: Boolean): ListenableFuture { - return setImageResource(glide, slide, showControls, isPreview, 0, 0) + fun setImageResource(glide: GlideRequests, slide: Slide, isPreview: Boolean): ListenableFuture { + return setImageResource(glide, slide, isPreview, 0, 0) } fun setImageResource(glide: GlideRequests, slide: Slide, - showControls: Boolean, isPreview: Boolean, - naturalWidth: Int, naturalHeight: Int): ListenableFuture { + isPreview: Boolean, naturalWidth: Int, + naturalHeight: Int): ListenableFuture { val currentSlide = this.slide - if (showControls) { - transferControls.setSlide(slide) -// transferControls.setDownloadClickListener() TODO: re-add this - } else { - transferControls.isVisible = false - } - playOverlay.isVisible = (slide.thumbnailUri != null && slide.hasPlayOverlay() && (slide.transferState == AttachmentTransferProgress.TRANSFER_PROGRESS_DONE || isPreview)) @@ -182,15 +171,12 @@ open class KThumbnailView: FrameLayout { open fun clear(glideRequests: GlideRequests) { glideRequests.clear(image) - transferControls.clear() slide = null } fun setImageResource(glideRequests: GlideRequests, uri: Uri): ListenableFuture { val future = SettableFuture() - transferControls.isVisible = false - var request: GlideRequest = glideRequests.load(DecryptableUri(uri)) .diskCacheStrategy(DiskCacheStrategy.NONE) .transition(DrawableTransitionOptions.withCrossFade())