mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Accurate remaining download size for partially downloaded galleries.
This commit is contained in:
committed by
Clark Chen
parent
fa0661f58a
commit
f6d8dcf6fd
@@ -239,7 +239,7 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
val remainingSlides = currentState.slides.filterNot { it.transferState == AttachmentTable.TRANSFER_PROGRESS_DONE }
|
||||
val downloadCount = remainingSlides.size
|
||||
binding.primaryDetailsText.text = context.resources.getQuantityString(R.plurals.TransferControlView_n_items, downloadCount, downloadCount)
|
||||
val byteCount = remainingSlides.sumOf { it.asAttachment().size }
|
||||
val byteCount = currentState.networkProgress.sumTotal() - currentState.networkProgress.sumCompleted()
|
||||
binding.secondaryDetailsText.text = Formatter.formatShortFileSize(context, byteCount)
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
} else {
|
||||
ViewUtil.dpToPx(SECONDARY_TEXT_OFFSET_DP).toFloat()
|
||||
}
|
||||
val byteCount = currentState.slides.sumOf { it.asAttachment().size }
|
||||
val byteCount = currentState.networkProgress.sumTotal() - currentState.networkProgress.sumCompleted()
|
||||
binding.secondaryDetailsText.text = Formatter.formatShortFileSize(context, byteCount)
|
||||
}
|
||||
|
||||
|
||||
@@ -2419,7 +2419,7 @@
|
||||
</plurals>
|
||||
<!-- Status update label used while the device is transcoding video as a prerequisite to uploading -->
|
||||
<string name="TransferControlView__processing">Processing…</string>
|
||||
<!-- Status update label used while the device is transcoding video as a prerequisite to uploading -->
|
||||
<!-- Status update label used while the device is transmitting data over the network. Will take the form of "123 KB/2.0 MB" -->
|
||||
<string name="TransferControlView__download_progress">%1$s/%2$s</string>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user