fixup! Use dynamic/rule-based size calculations for transfer control view.
This commit is contained in:
parent
1f941df65a
commit
9a50e04f5a
2 changed files with 3 additions and 3 deletions
|
@ -708,9 +708,9 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
||||||
} else {
|
} else {
|
||||||
val progressMiB = currentState.networkProgress.sumCompleted().toUnitString()
|
val progressMiB = currentState.networkProgress.sumCompleted().toUnitString()
|
||||||
val totalMiB = currentState.networkProgress.sumTotal().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)
|
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
|
val roundedWidth = ceil(desiredWidth.toDouble()).roundToInt() + binding.secondaryDetailsText.compoundPaddingLeft + binding.secondaryDetailsText.compoundPaddingRight
|
||||||
binding.secondaryDetailsText.updateLayoutParams {
|
binding.secondaryDetailsText.updateLayoutParams {
|
||||||
width = roundedWidth
|
width = roundedWidth
|
||||||
|
|
|
@ -3033,7 +3033,7 @@
|
||||||
<!-- Status update label used while the device is transcoding video as a prerequisite to uploading -->
|
<!-- Status update label used while the device is transcoding video as a prerequisite to uploading -->
|
||||||
<string name="TransferControlView__processing">Processing…</string>
|
<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" -->
|
<!-- 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 -->
|
<!-- UnauthorizedReminder -->
|
||||||
<!-- Message shown in a reminder banner when the user\'s device is no longer registered -->
|
<!-- Message shown in a reminder banner when the user\'s device is no longer registered -->
|
||||||
|
|
Loading…
Add table
Reference in a new issue