Prevent "Free" tier from being upgraded in the background.

This commit is contained in:
Alex Hart
2025-06-24 11:11:32 -03:00
committed by GitHub
parent 1719122f5e
commit ccc4acdef9
3 changed files with 46 additions and 30 deletions

View File

@@ -169,7 +169,7 @@ private fun BackupsSettingsContent(
OtherWaysToBackUpHeading()
}
is BackupState.ActiveFree, is BackupState.ActivePaid -> {
is BackupState.ActiveFree, is BackupState.ActivePaid, is BackupState.Canceled -> {
ActiveBackupsRow(
backupState = backupsSettingsState.backupState,
onBackupsRowClick = onBackupsRowClick,
@@ -210,15 +210,6 @@ private fun BackupsSettingsContent(
OtherWaysToBackUpHeading()
}
is BackupState.Canceled -> {
ActiveBackupsRow(
backupState = backupsSettingsState.backupState,
lastBackupAt = backupsSettingsState.lastBackupAt
)
OtherWaysToBackUpHeading()
}
is BackupState.SubscriptionMismatchMissingGooglePlay -> {
ActiveBackupsRow(
backupState = backupsSettingsState.backupState,
@@ -421,13 +412,25 @@ private fun ActiveBackupsRow(
when (val type = backupState.messageBackupsType) {
is MessageBackupsType.Paid -> {
Text(
text = stringResource(
val body = if (backupState is BackupState.Canceled) {
stringResource(R.string.BackupsSettingsFragment__subscription_canceled)
} else {
stringResource(
R.string.BackupsSettingsFragment_s_month_renews_s,
FiatMoneyUtil.format(LocalContext.current.resources, type.pricePerMonth),
DateUtils.formatDateWithYear(Locale.getDefault(), backupState.renewalTime.inWholeMilliseconds)
),
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
val color = if (backupState is BackupState.Canceled) {
MaterialTheme.colorScheme.error
} else {
MaterialTheme.colorScheme.onSurfaceVariant
}
Text(
text = body,
color = color,
style = MaterialTheme.typography.bodyMedium
)
}