Polish various bits of backups UI.

This commit is contained in:
Alex Hart
2025-07-29 11:09:53 -03:00
committed by GitHub
parent ab458a5bb8
commit b8300f373d
9 changed files with 110 additions and 93 deletions

View File

@@ -121,7 +121,7 @@ fun MessageBackupsEducationScreen(
}
}
Buttons.LargePrimary(
Buttons.LargeTonal(
onClick = onEnableBackups,
modifier = Modifier.fillMaxWidth()
) {

View File

@@ -177,6 +177,8 @@ fun MessageBackupsTypeSelectionScreen(
}
stringResource(R.string.MessageBackupsTypeSelectionScreen__subscribe_for_x_month, price)
} else if (selectedBackupTier == MessageBackupTier.FREE) {
stringResource(R.string.MessageBackupsTypeSelectionScreen__choose_free_plan)
} else {
stringResource(R.string.MessageBackupsTypeSelectionScreen__subscribe)
}
@@ -205,7 +207,7 @@ private fun MessageBackupsTypeSelectionScreenPreview() {
Previews.Preview {
MessageBackupsTypeSelectionScreen(
stage = MessageBackupsStage.TYPE_SELECTION,
selectedBackupTier = MessageBackupTier.FREE,
selectedBackupTier = selectedBackupsType,
availableBackupTypes = testBackupTypes(),
onMessageBackupsTierSelected = { selectedBackupsType = it },
onNavigationClick = {},
@@ -225,7 +227,7 @@ private fun MessageBackupsTypeSelectionScreenWithCurrentTierPreview() {
Previews.Preview {
MessageBackupsTypeSelectionScreen(
stage = MessageBackupsStage.TYPE_SELECTION,
selectedBackupTier = MessageBackupTier.FREE,
selectedBackupTier = selectedBackupsType,
availableBackupTypes = testBackupTypes(),
onMessageBackupsTierSelected = { selectedBackupsType = it },
onNavigationClick = {},

View File

@@ -24,6 +24,7 @@ import androidx.compose.ui.unit.dp
import org.signal.core.ui.compose.Previews
import org.signal.core.ui.compose.SignalPreview
import org.signal.core.ui.compose.horizontalGutters
import org.signal.core.ui.compose.theme.SignalTheme
import org.thoughtcrime.securesms.R
/**
@@ -69,7 +70,7 @@ fun BetaHeader(modifier: Modifier = Modifier) {
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
.background(
color = MaterialTheme.colorScheme.surfaceVariant,
color = SignalTheme.colors.colorSurface2,
shape = RoundedCornerShape(12.dp)
)
.padding(16.dp)

View File

@@ -264,7 +264,10 @@ private fun NeverEnabledBackupsRow(
},
text = {
Column {
TextWithBetaLabel(text = stringResource(R.string.RemoteBackupsSettingsFragment__signal_backups))
TextWithBetaLabel(
text = stringResource(R.string.RemoteBackupsSettingsFragment__signal_backups),
textStyle = MaterialTheme.typography.bodyLarge
)
Text(
text = stringResource(R.string.BackupsSettingsFragment_automatic_backups_with_signals),
@@ -307,7 +310,11 @@ private fun InactiveBackupsRow(
Rows.TextRow(
text = {
Column {
TextWithBetaLabel(text = stringResource(R.string.RemoteBackupsSettingsFragment__signal_backups))
TextWithBetaLabel(
text = stringResource(R.string.RemoteBackupsSettingsFragment__signal_backups),
textStyle = MaterialTheme.typography.bodyLarge
)
Text(
text = stringResource(R.string.preferences_off),
style = MaterialTheme.typography.bodyMedium,
@@ -347,7 +354,11 @@ private fun NotFoundBackupRow(
},
text = {
Column {
TextWithBetaLabel(text = stringResource(R.string.RemoteBackupsSettingsFragment__signal_backups))
TextWithBetaLabel(
text = stringResource(R.string.RemoteBackupsSettingsFragment__signal_backups),
textStyle = MaterialTheme.typography.bodyLarge
)
Text(
text = stringResource(R.string.BackupsSettingsFragment_subscription_not_found_on_this_device),
style = MaterialTheme.typography.bodyMedium,
@@ -379,7 +390,11 @@ private fun PendingBackupRow(
},
text = {
Column {
TextWithBetaLabel(text = stringResource(R.string.RemoteBackupsSettingsFragment__signal_backups))
TextWithBetaLabel(
text = stringResource(R.string.RemoteBackupsSettingsFragment__signal_backups),
textStyle = MaterialTheme.typography.bodyLarge
)
Text(
text = stringResource(R.string.RemoteBackupsSettingsFragment__payment_pending),
color = MaterialTheme.colorScheme.onSurfaceVariant,
@@ -427,7 +442,10 @@ private fun ActiveBackupsRow(
},
text = {
Column {
TextWithBetaLabel(text = stringResource(R.string.RemoteBackupsSettingsFragment__signal_backups))
TextWithBetaLabel(
text = stringResource(R.string.RemoteBackupsSettingsFragment__signal_backups),
textStyle = MaterialTheme.typography.bodyLarge
)
when (val type = backupState.messageBackupsType) {
is MessageBackupsType.Paid -> {