mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
feat: add back overflow text, increase AttachmentDownloadJob.kt max failure count, resize overflow text size, remove unused animator update listener implementation in ThumbnailProgressBar.kt
This commit is contained in:
parent
482d6a2075
commit
09f4cfb1ad
@ -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<TextView>(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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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" />
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user