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 aaee530245..b8ac292903 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 @@ -8,8 +8,10 @@ import android.util.AttributeSet import android.view.LayoutInflater import android.view.ViewGroup 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 @@ -23,6 +25,10 @@ import org.thoughtcrime.securesms.mms.Slide class AlbumThumbnailView : FrameLayout { + companion object { + const val MAX_ALBUM_DISPLAY_SIZE = 5 + } + // region Lifecycle constructor(context: Context) : super(context) { initialize() @@ -94,6 +100,12 @@ class AlbumThumbnailView : FrameLayout { if (slides.size != this.slideSize) { albumCellContainer.removeAllViews() LayoutInflater.from(context).inflate(layoutRes(slides.size), albumCellContainer) + val overflowed = slides.size > MAX_ALBUM_DISPLAY_SIZE + albumCellContainer.findViewById(R.id.album_cell_overflow_text)?.let { overflowText -> + // overflowText will be null if !overflowed + overflowText.isVisible = overflowed // more than max album size + overflowText.text = context.getString(R.string.AlbumThumbnailView_plus, slides.size - MAX_ALBUM_DISPLAY_SIZE) + } this.slideSize = slides.size } // iterate binding diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/utilities/ThumbnailProgressBar.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/utilities/ThumbnailProgressBar.kt index 2a9b033732..60ef8116d2 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/utilities/ThumbnailProgressBar.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/utilities/ThumbnailProgressBar.kt @@ -19,7 +19,7 @@ import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import network.loki.messenger.R import kotlin.math.sin -class ThumbnailProgressBar: View, ValueAnimator.AnimatorUpdateListener { +class ThumbnailProgressBar: View { constructor(context: Context) : super(context) constructor(context: Context, attrs: AttributeSet) : super(context, attrs) @@ -39,11 +39,6 @@ class ThumbnailProgressBar: View, ValueAnimator.AnimatorUpdateListener { private val objectRect = Rect() private val drawingRect = Rect() - override fun onAnimationUpdate(animation: ValueAnimator?) { - if (animation == null || !isAttachedToWindow) return - invalidate() - } - override fun dispatchDraw(canvas: Canvas?) { if (canvas == null) return diff --git a/app/src/main/res/layout/album_thumbnail_many.xml b/app/src/main/res/layout/album_thumbnail_many.xml index 9672055b80..de60462995 100644 --- a/app/src/main/res/layout/album_thumbnail_many.xml +++ b/app/src/main/res/layout/album_thumbnail_many.xml @@ -51,7 +51,7 @@ android:layout_height="match_parent" android:layout_width="match_parent" android:gravity="center" - android:textSize="28dp" + android:textSize="@dimen/text_size" android:textColor="@color/core_white" android:background="@color/transparent_black_40" tools:text="+2" /> diff --git a/libsession/src/main/java/org/session/libsession/messaging/jobs/AttachmentDownloadJob.kt b/libsession/src/main/java/org/session/libsession/messaging/jobs/AttachmentDownloadJob.kt index b0d923b0c3..a5aaeaa429 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/jobs/AttachmentDownloadJob.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/jobs/AttachmentDownloadJob.kt @@ -23,7 +23,7 @@ class AttachmentDownloadJob(val attachmentID: Long, val databaseMessageID: Long) } // Settings - override val maxFailureCount: Int = 20 + override val maxFailureCount: Int = 100 companion object { val KEY: String = "AttachmentDownloadJob"