mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 20:18:36 +00:00
Display attachment download progress in MB.
This commit is contained in:
@@ -657,9 +657,9 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
return if (isCompressing(currentState)) {
|
||||
return context.getString(R.string.TransferControlView__processing)
|
||||
} else {
|
||||
val progressText = Formatter.formatShortFileSize(context, currentState.networkProgress.sumCompleted())
|
||||
val totalText = Formatter.formatShortFileSize(context, currentState.networkProgress.sumTotal())
|
||||
context.resources.getString(R.string.TransferControlView__download_progress, progressText, totalText)
|
||||
val progressMiB = currentState.networkProgress.sumCompleted() / MEBIBYTE
|
||||
val totalMiB = currentState.networkProgress.sumTotal() / MEBIBYTE
|
||||
context.resources.getString(R.string.TransferControlView__download_progress, progressMiB, totalMiB)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -679,6 +679,7 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
private const val SECONDARY_TEXT_OFFSET_DP = 3
|
||||
private const val RETRY_SECONDARY_TEXT_OFFSET_DP = 6
|
||||
private const val PRIMARY_TEXT_OFFSET_DP = 4
|
||||
private const val MEBIBYTE = 1048576f
|
||||
|
||||
/**
|
||||
* A weighting compared to [UPLOAD_TASK_WEIGHT]
|
||||
|
||||
@@ -2421,8 +2421,8 @@
|
||||
</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 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>
|
||||
<!-- Status update label used while the device is transmitting data over the network. Will take the form of "1.0 MB/2.0 MB" -->
|
||||
<string name="TransferControlView__download_progress">%1.1f MB/%2.1f MB</string>
|
||||
|
||||
|
||||
<!-- UnauthorizedReminder -->
|
||||
|
||||
Reference in New Issue
Block a user