mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-27 13:13:43 +00:00
fixup! Use dynamic/rule-based size calculations for transfer control view.
This commit is contained in:
@@ -708,9 +708,9 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
} else {
|
||||
val progressMiB = currentState.networkProgress.sumCompleted().toUnitString()
|
||||
val totalMiB = currentState.networkProgress.sumTotal().toUnitString()
|
||||
val completedLabel = context.resources.getString(R.string.TransferControlView__download_progress, totalMiB, totalMiB)
|
||||
val completedLabel = context.resources.getString(R.string.TransferControlView__download_progress_s_s, totalMiB, totalMiB)
|
||||
val desiredWidth = StaticLayout.getDesiredWidth(completedLabel, binding.secondaryDetailsText.paint)
|
||||
binding.secondaryDetailsText.text = context.resources.getString(R.string.TransferControlView__download_progress, progressMiB, totalMiB)
|
||||
binding.secondaryDetailsText.text = context.resources.getString(R.string.TransferControlView__download_progress_s_s, progressMiB, totalMiB)
|
||||
val roundedWidth = ceil(desiredWidth.toDouble()).roundToInt() + binding.secondaryDetailsText.compoundPaddingLeft + binding.secondaryDetailsText.compoundPaddingRight
|
||||
binding.secondaryDetailsText.updateLayoutParams {
|
||||
width = roundedWidth
|
||||
|
||||
@@ -3033,7 +3033,7 @@
|
||||
<!-- 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 "1.0 MB/2.0 MB" -->
|
||||
<string name="TransferControlView__download_progress">%1$s/%2$s</string>
|
||||
<string name="TransferControlView__download_progress_s_s">%1$s/%2$s</string>
|
||||
|
||||
<!-- UnauthorizedReminder -->
|
||||
<!-- Message shown in a reminder banner when the user\'s device is no longer registered -->
|
||||
|
||||
Reference in New Issue
Block a user