mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 03:40:56 +01:00
Add MediaTTL to subscriptions configuration and wire in.
This commit is contained in:
committed by
Greyson Parrelli
parent
bf3012bd8a
commit
61f91d6b83
@@ -51,6 +51,7 @@ import org.thoughtcrime.securesms.util.navigation.safeNavigate
|
||||
import java.math.BigDecimal
|
||||
import java.util.Currency
|
||||
import java.util.Locale
|
||||
import kotlin.time.Duration.Companion.days
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
import org.signal.core.ui.R as CoreUiR
|
||||
|
||||
@@ -342,7 +343,8 @@ private fun BackupsSettingsContentPreview() {
|
||||
enabledState = BackupsSettingsState.EnabledState.Active(
|
||||
type = MessageBackupsType.Paid(
|
||||
pricePerMonth = FiatMoney(BigDecimal.valueOf(4), Currency.getInstance("CAD")),
|
||||
storageAllowanceBytes = 1_000_000
|
||||
storageAllowanceBytes = 1_000_000,
|
||||
mediaTtl = 30.days
|
||||
),
|
||||
expiresAt = 0.seconds,
|
||||
lastBackupAt = 0.seconds
|
||||
@@ -388,7 +390,8 @@ private fun ActivePaidBackupsRowPreview() {
|
||||
enabledState = BackupsSettingsState.EnabledState.Active(
|
||||
type = MessageBackupsType.Paid(
|
||||
pricePerMonth = FiatMoney(BigDecimal.valueOf(4), Currency.getInstance("CAD")),
|
||||
storageAllowanceBytes = 1_000_000
|
||||
storageAllowanceBytes = 1_000_000,
|
||||
mediaTtl = 30.days
|
||||
),
|
||||
expiresAt = 0.seconds,
|
||||
lastBackupAt = 0.seconds
|
||||
|
||||
@@ -101,7 +101,8 @@ class BackupsSettingsViewModel : ViewModel() {
|
||||
activeSubscription.activeSubscription.amount,
|
||||
Currency.getInstance(activeSubscription.activeSubscription.currency)
|
||||
),
|
||||
storageAllowanceBytes = backupType.storageAllowanceBytes
|
||||
storageAllowanceBytes = backupType.storageAllowanceBytes,
|
||||
mediaTtl = backupType.mediaTtl
|
||||
)
|
||||
)
|
||||
} else {
|
||||
|
||||
@@ -1225,7 +1225,8 @@ private fun SubscriptionMismatchMissingGooglePlayCardPreview() {
|
||||
state = RemoteBackupsSettingsState.BackupState.SubscriptionMismatchMissingGooglePlay(
|
||||
messageBackupsType = MessageBackupsType.Paid(
|
||||
pricePerMonth = FiatMoney(BigDecimal.valueOf(3), Currency.getInstance("CAD")),
|
||||
storageAllowanceBytes = 100_000_000
|
||||
storageAllowanceBytes = 100_000_000,
|
||||
mediaTtl = 30.days
|
||||
),
|
||||
renewalTime = System.currentTimeMillis().milliseconds + 30.days
|
||||
)
|
||||
@@ -1242,7 +1243,8 @@ private fun BackupCardPreview() {
|
||||
backupState = RemoteBackupsSettingsState.BackupState.ActivePaid(
|
||||
messageBackupsType = MessageBackupsType.Paid(
|
||||
pricePerMonth = FiatMoney(BigDecimal.valueOf(3), Currency.getInstance("CAD")),
|
||||
storageAllowanceBytes = 100_000_000
|
||||
storageAllowanceBytes = 100_000_000,
|
||||
mediaTtl = 30.days
|
||||
),
|
||||
renewalTime = 1727193018.seconds,
|
||||
price = FiatMoney(BigDecimal.valueOf(3), Currency.getInstance("CAD"))
|
||||
@@ -1253,7 +1255,8 @@ private fun BackupCardPreview() {
|
||||
backupState = RemoteBackupsSettingsState.BackupState.Canceled(
|
||||
messageBackupsType = MessageBackupsType.Paid(
|
||||
pricePerMonth = FiatMoney(BigDecimal.valueOf(3), Currency.getInstance("CAD")),
|
||||
storageAllowanceBytes = 100_000_000
|
||||
storageAllowanceBytes = 100_000_000,
|
||||
mediaTtl = 30.days
|
||||
),
|
||||
renewalTime = 1727193018.seconds
|
||||
)
|
||||
@@ -1263,7 +1266,8 @@ private fun BackupCardPreview() {
|
||||
backupState = RemoteBackupsSettingsState.BackupState.Inactive(
|
||||
messageBackupsType = MessageBackupsType.Paid(
|
||||
pricePerMonth = FiatMoney(BigDecimal.valueOf(3), Currency.getInstance("CAD")),
|
||||
storageAllowanceBytes = 100_000_000
|
||||
storageAllowanceBytes = 100_000_000,
|
||||
mediaTtl = 30.days
|
||||
),
|
||||
renewalTime = 1727193018.seconds
|
||||
)
|
||||
@@ -1273,7 +1277,8 @@ private fun BackupCardPreview() {
|
||||
backupState = RemoteBackupsSettingsState.BackupState.ActivePaid(
|
||||
messageBackupsType = MessageBackupsType.Paid(
|
||||
pricePerMonth = FiatMoney(BigDecimal.valueOf(3), Currency.getInstance("CAD")),
|
||||
storageAllowanceBytes = 100_000_000
|
||||
storageAllowanceBytes = 100_000_000,
|
||||
mediaTtl = 30.days
|
||||
),
|
||||
renewalTime = 1727193018.seconds,
|
||||
price = FiatMoney(BigDecimal.valueOf(3), Currency.getInstance("CAD"))
|
||||
|
||||
Reference in New Issue
Block a user