mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 12:08:34 +00:00
Do not display a price if it's been zeroed.
This commit is contained in:
committed by
Jeffrey Starke
parent
9b517a14cb
commit
d0c1e93b3c
@@ -496,6 +496,11 @@ private fun ActiveBackupsRow(
|
|||||||
is MessageBackupsType.Paid -> {
|
is MessageBackupsType.Paid -> {
|
||||||
val body = if (backupState is BackupState.Canceled) {
|
val body = if (backupState is BackupState.Canceled) {
|
||||||
stringResource(R.string.BackupsSettingsFragment__subscription_canceled)
|
stringResource(R.string.BackupsSettingsFragment__subscription_canceled)
|
||||||
|
} else if (type.pricePerMonth.amount == BigDecimal.ZERO) {
|
||||||
|
stringResource(
|
||||||
|
R.string.BackupsSettingsFragment_renews_s,
|
||||||
|
DateUtils.formatDateWithYear(Locale.getDefault(), backupState.renewalTime.inWholeMilliseconds)
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
stringResource(
|
stringResource(
|
||||||
R.string.BackupsSettingsFragment_s_month_renews_s,
|
R.string.BackupsSettingsFragment_s_month_renews_s,
|
||||||
@@ -694,6 +699,25 @@ private fun ActivePaidBackupsRowPreview() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SignalPreview
|
||||||
|
@Composable
|
||||||
|
private fun ActivePaidBackupsRowNoPricePreview() {
|
||||||
|
Previews.Preview {
|
||||||
|
ActiveBackupsRow(
|
||||||
|
backupState = BackupState.ActivePaid(
|
||||||
|
messageBackupsType = MessageBackupsType.Paid(
|
||||||
|
pricePerMonth = FiatMoney(BigDecimal.ZERO, Currency.getInstance("CAD")),
|
||||||
|
storageAllowanceBytes = 1_000_000,
|
||||||
|
mediaTtl = 30.days
|
||||||
|
),
|
||||||
|
renewalTime = 0.seconds,
|
||||||
|
price = FiatMoney(BigDecimal.valueOf(4), Currency.getInstance("CAD"))
|
||||||
|
),
|
||||||
|
lastBackupAt = 0.seconds
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@SignalPreview
|
@SignalPreview
|
||||||
@Composable
|
@Composable
|
||||||
private fun ActiveFreeBackupsRowPreview() {
|
private fun ActiveFreeBackupsRowPreview() {
|
||||||
|
|||||||
@@ -8142,6 +8142,8 @@
|
|||||||
<!-- BackupsSettingsFragment -->
|
<!-- BackupsSettingsFragment -->
|
||||||
<!-- Subtitle for row for active backup, first placeholder is formatted amount, second is renewal date -->
|
<!-- Subtitle for row for active backup, first placeholder is formatted amount, second is renewal date -->
|
||||||
<string name="BackupsSettingsFragment_s_month_renews_s">%1$s/month, renews %2$s</string>
|
<string name="BackupsSettingsFragment_s_month_renews_s">%1$s/month, renews %2$s</string>
|
||||||
|
<!-- Subtitle for row for active backup when price is not available, first placeholder is renewal date -->
|
||||||
|
<string name="BackupsSettingsFragment_renews_s">Renews %1$s</string>
|
||||||
<!-- Subtitle for row for active backup, placeholder is last date of backup -->
|
<!-- Subtitle for row for active backup, placeholder is last date of backup -->
|
||||||
<string name="BackupsSettingsFragment_last_backup_s">Last backup %1$s</string>
|
<string name="BackupsSettingsFragment_last_backup_s">Last backup %1$s</string>
|
||||||
<!-- Subtitle for row for canceled backup -->
|
<!-- Subtitle for row for canceled backup -->
|
||||||
|
|||||||
Reference in New Issue
Block a user