Add finalized strings to strings.xml for backups.

This commit is contained in:
Alex Hart
2024-07-19 16:49:16 -03:00
committed by Nicholas Tinsley
parent 06d475fb6e
commit 44b2c62a0e
14 changed files with 167 additions and 255 deletions

View File

@@ -1,179 +0,0 @@
/*
* Copyright 2024 Signal Messenger, LLC
* SPDX-License-Identifier: AGPL-3.0-only
*/
package org.thoughtcrime.securesms.backup.v2.ui.restore
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.navigation.fragment.findNavController
import androidx.navigation.fragment.navArgs
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf
import org.signal.core.ui.Buttons
import org.signal.core.ui.Previews
import org.signal.core.ui.theme.SignalTheme
import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.backup.v2.ui.subscription.MessageBackupsTypeFeature
import org.thoughtcrime.securesms.backup.v2.ui.subscription.MessageBackupsTypeFeatureRow
import org.thoughtcrime.securesms.compose.ComposeFragment
import org.thoughtcrime.securesms.devicetransfer.moreoptions.MoreTransferOrRestoreOptionsMode
import org.thoughtcrime.securesms.util.navigation.safeNavigate
/**
* Fragment which facilitates restoring from a backup during
* registration.
*/
class RestoreFromBackupFragment : ComposeFragment() {
private val navArgs: RestoreFromBackupFragmentArgs by navArgs()
@Composable
override fun FragmentContent() {
RestoreFromBackupContent(
features = persistentListOf(),
onRestoreBackupClick = {
// TODO [message-backups] Restore backup.
},
onCancelClick = {
findNavController()
.popBackStack()
},
onMoreOptionsClick = {
findNavController()
.safeNavigate(RestoreFromBackupFragmentDirections.actionRestoreFromBacakupFragmentToMoreOptions(MoreTransferOrRestoreOptionsMode.SELECTION))
},
cancelable = navArgs.cancelable
)
}
}
@Preview
@Composable
private fun RestoreFromBackupContentPreview() {
Previews.Preview {
RestoreFromBackupContent(
features = persistentListOf(
MessageBackupsTypeFeature(
iconResourceId = R.drawable.symbol_thread_compact_bold_16,
label = "Your last 30 days of media"
),
MessageBackupsTypeFeature(
iconResourceId = R.drawable.symbol_recent_compact_bold_16,
label = "All of your text messages"
)
),
onRestoreBackupClick = {},
onCancelClick = {},
onMoreOptionsClick = {},
true
)
}
}
@Composable
private fun RestoreFromBackupContent(
features: ImmutableList<MessageBackupsTypeFeature>,
onRestoreBackupClick: () -> Unit,
onCancelClick: () -> Unit,
onMoreOptionsClick: () -> Unit,
cancelable: Boolean
) {
Column(
modifier = Modifier
.padding(horizontal = dimensionResource(id = R.dimen.core_ui__gutter))
.padding(top = 40.dp, bottom = 24.dp)
) {
Text(
text = "Restore from backup", // TODO [message-backups] Finalized copy.
style = MaterialTheme.typography.headlineMedium,
modifier = Modifier.padding(bottom = 12.dp)
)
val yourLastBackupText = buildAnnotatedString {
append("Your last backup was made on March 5, 2024 at 9:00am.") // TODO [message-backups] Finalized copy.
append(" ")
withStyle(SpanStyle(fontWeight = FontWeight.SemiBold)) {
append("Only media sent or received in the past 30 days is included.") // TODO [message-backups] Finalized copy.
}
}
Text(
text = yourLastBackupText,
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(bottom = 28.dp)
)
Column(
modifier = Modifier
.fillMaxWidth()
.background(color = SignalTheme.colors.colorSurface2, shape = RoundedCornerShape(18.dp))
.padding(horizontal = 20.dp)
.padding(top = 20.dp, bottom = 18.dp)
) {
Text(
text = "Your backup includes:", // TODO [message-backups] Finalized copy.
style = MaterialTheme.typography.titleMedium,
modifier = Modifier.padding(bottom = 6.dp)
)
features.forEach {
MessageBackupsTypeFeatureRow(
messageBackupsTypeFeature = it,
iconTint = MaterialTheme.colorScheme.primary,
modifier = Modifier.padding(start = 16.dp, top = 6.dp)
)
}
}
Spacer(modifier = Modifier.weight(1f))
Buttons.LargeTonal(
onClick = onRestoreBackupClick,
modifier = Modifier.fillMaxWidth()
) {
Text(
text = "Restore backup" // TODO [message-backups] Finalized copy.
)
}
if (cancelable) {
TextButton(
onClick = onCancelClick,
modifier = Modifier.fillMaxWidth()
) {
Text(
text = stringResource(id = android.R.string.cancel)
)
}
} else {
TextButton(
onClick = onMoreOptionsClick,
modifier = Modifier.fillMaxWidth()
) {
Text(
text = stringResource(id = R.string.TransferOrRestoreFragment__more_options)
)
}
}
}
}

View File

@@ -88,13 +88,13 @@ private fun SheetContent(
}
Text(
text = "Pay $formattedPrice/month to Signal", // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsCheckoutSheet__pay_s_per_month, formattedPrice),
style = MaterialTheme.typography.titleLarge,
modifier = Modifier.padding(top = 48.dp)
)
Text(
text = "You'll get:", // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsCheckoutSheet__youll_get),
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(top = 5.dp)
)

View File

@@ -26,6 +26,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@@ -48,7 +49,7 @@ fun MessageBackupsEducationScreen(
Scaffolds.Settings(
onNavigationClick = onNavigationClick,
navigationIconPainter = painterResource(id = R.drawable.symbol_x_24),
title = "Chat backups" // TODO [message-backups] Finalized copy
title = stringResource(id = R.string.RemoteBackupsSettingsFragment__signal_backups)
) {
Column(
modifier = Modifier
@@ -74,7 +75,7 @@ fun MessageBackupsEducationScreen(
item {
Text(
text = "Chat Backups", // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.RemoteBackupsSettingsFragment__signal_backups),
style = MaterialTheme.typography.headlineMedium,
modifier = Modifier.padding(top = 15.dp)
)
@@ -82,7 +83,7 @@ fun MessageBackupsEducationScreen(
item {
Text(
text = "Back up your messages and media and using Signals secure, end-to-end encrypted storage service. Never lose a message when you get a new phone or reinstall Signal.", // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsEducationScreen__backup_your_messages_and_media),
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurfaceVariant,
textAlign = TextAlign.Center,
@@ -97,17 +98,17 @@ fun MessageBackupsEducationScreen(
) {
NotableFeatureRow(
painter = painterResource(id = R.drawable.symbol_lock_compact_20),
text = "End-to-end Encrypted" // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsEducationScreen__end_to_end_encrypted)
)
NotableFeatureRow(
painter = painterResource(id = R.drawable.symbol_check_square_compact_20),
text = "Optional, always" // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsEducationScreen__optional_always)
)
NotableFeatureRow(
painter = painterResource(id = R.drawable.symbol_trash_compact_20),
text = "Delete your backup anytime" // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsEducationScreen__delete_your_backup_anytime)
)
}
}
@@ -118,7 +119,7 @@ fun MessageBackupsEducationScreen(
modifier = Modifier.fillMaxWidth()
) {
Text(
text = "Enable backups" // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsEducationScreen__enable_backups)
)
}
@@ -129,7 +130,7 @@ fun MessageBackupsEducationScreen(
.padding(bottom = 16.dp)
) {
Text(
text = "Learn more" // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsEducationScreen__learn_more)
)
}
}

View File

@@ -82,7 +82,7 @@ class MessageBackupsFlowFragment : ComposeFragment(), InAppPaymentCheckoutDelega
composable(route = MessageBackupsScreen.PIN_EDUCATION.name) {
MessageBackupsPinEducationScreen(
onNavigationClick = viewModel::goToPreviousScreen,
onGeneratePinClick = {},
onCreatePinClick = {},
onUseCurrentPinClick = viewModel::goToNextScreen,
recommendedPinSize = 16 // TODO [message-backups] This value should come from some kind of config
)

View File

@@ -32,6 +32,7 @@ import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation
@@ -68,7 +69,7 @@ fun MessageBackupsPinConfirmationScreen(
) {
item {
Text(
text = "Enter your PIN", // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsPinConfirmationScreen__enter_your_pin),
style = MaterialTheme.typography.headlineMedium,
modifier = Modifier.padding(top = 40.dp)
)
@@ -76,7 +77,7 @@ fun MessageBackupsPinConfirmationScreen(
item {
Text(
text = "Enter your Signal PIN to enable backups", // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsPinConfirmationScreen__enter_your_signal_pin_to_enable_backups),
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(top = 16.dp)
@@ -84,7 +85,6 @@ fun MessageBackupsPinConfirmationScreen(
}
item {
// TODO [message-backups] Confirm default focus state
val keyboardType = remember(pinKeyboardType) {
when (pinKeyboardType) {
PinKeyboardType.NUMERIC -> KeyboardType.NumberPassword
@@ -136,7 +136,7 @@ fun MessageBackupsPinConfirmationScreen(
onClick = onNextClick
) {
Text(
text = "Next" // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsPinConfirmationScreen__next)
)
}
}
@@ -198,7 +198,7 @@ private fun PinKeyboardTypeToggle(
modifier = Modifier.padding(end = 8.dp)
)
Text(
text = "Switch keyboard" // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsPinConfirmationScreen__switch_keyboard)
)
}
}

View File

@@ -20,6 +20,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@@ -35,12 +36,12 @@ import org.thoughtcrime.securesms.R
@Composable
fun MessageBackupsPinEducationScreen(
onNavigationClick: () -> Unit,
onGeneratePinClick: () -> Unit,
onCreatePinClick: () -> Unit,
onUseCurrentPinClick: () -> Unit,
recommendedPinSize: Int
) {
Scaffolds.Settings(
title = "Backup type", // TODO [message-backups] Finalized copy
title = stringResource(id = R.string.RemoteBackupsSettingsFragment__signal_backups),
onNavigationClick = onNavigationClick,
navigationIconPainter = painterResource(id = R.drawable.symbol_arrow_left_24)
) {
@@ -68,7 +69,7 @@ fun MessageBackupsPinEducationScreen(
item {
Text(
text = "PINs protect your backup", // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsPinEducationScreen__pins_protect_your_backup),
style = MaterialTheme.typography.headlineMedium,
modifier = Modifier.padding(top = 16.dp)
)
@@ -76,7 +77,7 @@ fun MessageBackupsPinEducationScreen(
item {
Text(
text = "Your Signal PIN lets you restore your backup when you re-install Signal. For increased security, we recommend updating to a new $recommendedPinSize-digit PIN.", // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsPinEducationScreen__your_signal_pin_lets_you),
textAlign = TextAlign.Center,
color = MaterialTheme.colorScheme.onSurfaceVariant,
style = MaterialTheme.typography.bodyLarge,
@@ -86,7 +87,7 @@ fun MessageBackupsPinEducationScreen(
item {
Text(
text = "If you forget your PIN, you will not be able to restore your backup. You can change your PIN at any time in settings.", // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsPinEducationScreen__if_you_forget_your_pin),
textAlign = TextAlign.Center,
color = MaterialTheme.colorScheme.onSurfaceVariant,
style = MaterialTheme.typography.bodyLarge,
@@ -100,18 +101,18 @@ fun MessageBackupsPinEducationScreen(
modifier = Modifier.fillMaxWidth()
) {
Text(
text = "Use current Signal PIN" // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsPinEducationScreen__use_current_signal_pin)
)
}
TextButton(
onClick = onGeneratePinClick,
onClick = onCreatePinClick,
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 16.dp)
) {
Text(
text = "Generate a new $recommendedPinSize-digit PIN" // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessageBackupsPinEducationScreen__create_new_pin)
)
}
}
@@ -124,7 +125,7 @@ private fun MessageBackupsPinScreenPreview() {
Previews.Preview {
MessageBackupsPinEducationScreen(
onNavigationClick = {},
onGeneratePinClick = {},
onCreatePinClick = {},
onUseCurrentPinClick = {},
recommendedPinSize = 16
)

View File

@@ -98,24 +98,26 @@ fun MessageBackupsTypeSelectionScreen(
item {
Text(
text = "Choose your backup type", // TODO [message-backups] Finalized copy
text = stringResource(id = R.string.MessagesBackupsTypeSelectionScreen__choose_your_backup_plan),
style = MaterialTheme.typography.headlineMedium,
modifier = Modifier.padding(top = 12.dp)
)
}
item {
// TODO [message-backups] Finalized copy
val primaryColor = MaterialTheme.colorScheme.primary
val readMoreString = buildAnnotatedString {
append("All backups are end-to-end encrypted. Signal is a non-profit—paying for backups helps support our mission. ")
append(stringResource(id = R.string.MessageBackupsTypeSelectionScreen__all_backups_are_end_to_end_encrypted))
val readMore = stringResource(id = R.string.MessageBackupsTypeSelectionScreen__read_more)
append(" ")
withAnnotation(tag = "URL", annotation = "read-more") {
withStyle(
style = SpanStyle(
color = primaryColor
)
) {
append("Read more")
append(readMore)
}
}
}

View File

@@ -86,7 +86,7 @@ class ChatsSettingsFragment : DSLSettingsFragment(R.string.preferences_chats__ch
if (RemoteConfig.messageBackups || state.remoteBackupsEnabled) {
clickPref(
title = DSLSettingsText.from("Signal Backups"), // TODO [message-backups] -- Finalized copy
title = DSLSettingsText.from(R.string.RemoteBackupsSettingsFragment__signal_backups),
summary = DSLSettingsText.from(if (state.remoteBackupsEnabled) R.string.arrays__enabled else R.string.arrays__disabled),
onClick = {
if (state.remoteBackupsEnabled) {

View File

@@ -121,7 +121,7 @@ private fun BackupsTypeSettingsContent(
item {
Rows.TextRow(
text = "Change or cancel subscription", // TODO [message-backups] final copy
text = stringResource(id = R.string.BackupsTypeSettingsFragment__change_or_cancel_subscription),
onClick = contentCallbacks::onChangeOrCancelSubscriptionClick
)
}
@@ -154,7 +154,7 @@ private fun BackupsTypeRow(
Column {
Text(text = messageBackupsType.title)
Text(
text = "$formattedAmount/month . Renews $renewal", // TODO [message-backups] final copy
text = stringResource(id = R.string.BackupsTypeSettingsFragment__s_month_renews_s, formattedAmount, renewal),
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant
)

View File

@@ -58,14 +58,22 @@ class CreditCardFragment : Fragment(R.layout.credit_card_fragment) {
}
}
// TODO [message-backups] Copy for this button in backups checkout flow.
binding.continueButton.text = if (args.inAppPayment.type == InAppPaymentType.RECURRING_DONATION) {
getString(
R.string.CreditCardFragment__donate_s_month,
FiatMoneyUtil.format(resources, args.inAppPayment.data.amount!!.toFiatMoney(), FiatMoneyUtil.formatOptions().trimZerosAfterDecimal())
)
} else {
getString(R.string.CreditCardFragment__donate_s, FiatMoneyUtil.format(resources, args.inAppPayment.data.amount!!.toFiatMoney()))
binding.continueButton.text = when (args.inAppPayment.type) {
InAppPaymentType.RECURRING_DONATION -> {
getString(
R.string.CreditCardFragment__donate_s_month,
FiatMoneyUtil.format(resources, args.inAppPayment.data.amount!!.toFiatMoney(), FiatMoneyUtil.formatOptions().trimZerosAfterDecimal())
)
}
InAppPaymentType.RECURRING_BACKUP -> {
getString(
R.string.CreditCardFragment__pay_s_month,
FiatMoneyUtil.format(resources, args.inAppPayment.data.amount!!.toFiatMoney(), FiatMoneyUtil.formatOptions().trimZerosAfterDecimal())
)
}
else -> {
getString(R.string.CreditCardFragment__donate_s, FiatMoneyUtil.format(resources, args.inAppPayment.data.amount!!.toFiatMoney()))
}
}
binding.description.setLinkColor(ContextCompat.getColor(requireContext(), R.color.signal_colorPrimary))

View File

@@ -196,8 +196,8 @@ private fun LogInWithoutTransferringOption(
}
},
isSelected = selectedOption == BackupRestorationType.NONE,
title = "Log in without transferring", // TODO [message-backups] Finalized copy.
subtitle = "Continue without transferring your messages and media", // TODO [message-backups] Finalized copy.
title = stringResource(id = R.string.MoreTransferOrRestoreOptionsSheet__log_in_without_transferring),
subtitle = stringResource(id = R.string.MoreTransferOrRestoreOptionsSheet__continue_without_transferring),
onClick = { onOptionSelected(BackupRestorationType.NONE) }
)
}
@@ -232,8 +232,8 @@ private fun TransferFromAndroidDeviceOption(
}
},
isSelected = selectedOption == BackupRestorationType.DEVICE_TRANSFER,
title = "Transfer from Android device", // TODO [message-backups] Finalized copy.
subtitle = "Transfer your account and messages from your old device.", // TODO [message-backups] Finalized copy.
title = stringResource(id = R.string.MoreTransferOrRestoreOptionsSheet__transfer_from_android_device),
subtitle = stringResource(id = R.string.MoreTransferOrRestoreOptionsSheet__transfer_your_account_and_messages),
onClick = { onOptionSelected(BackupRestorationType.DEVICE_TRANSFER) }
)
}
@@ -268,8 +268,8 @@ private fun RestoreLocalBackupOption(
}
},
isSelected = selectedOption == BackupRestorationType.LOCAL_BACKUP,
title = "Restore local backup", // TODO [message-backups] Finalized copy.
subtitle = "Restore your messages from a backup file you saved on your device.", // TODO [message-backups] Finalized copy.
title = stringResource(id = R.string.MoreTransferOrRestoreOptionsSheet__restore_local_backup),
subtitle = stringResource(id = R.string.MoreTransferOrRestoreOptionsSheet__restore_your_messages),
onClick = { onOptionSelected(BackupRestorationType.LOCAL_BACKUP) }
)
}
@@ -284,7 +284,7 @@ private fun OptionPreview() {
modifier = Modifier.padding(horizontal = 18.dp)
) {
Icon(
painter = painterResource(id = R.drawable.symbol_backup_light), // TODO [message-backups] Finalized asset.
painter = painterResource(id = R.drawable.symbol_backup_light),
contentDescription = null,
tint = MaterialTheme.colorScheme.primary,
modifier = Modifier.size(36.dp)
@@ -292,8 +292,8 @@ private fun OptionPreview() {
}
},
isSelected = false,
title = "Log in without transferring", // TODO [message-backups] Finalized copy.
subtitle = "Continue without transferring your messages and media", // TODO [message-backups] Finalized copy.
title = "Option Preview Title",
subtitle = "Option Preview Subtitle",
onClick = {}
)
}

View File

@@ -119,6 +119,7 @@ class RemoteRestoreActivity : BaseActivity() {
viewModel.updateRestoreProgress(restoreEvent)
}
@Composable
private fun getFeatureList(tier: MessageBackupTier?): ImmutableList<MessageBackupsTypeFeature> {
return when (tier) {
null -> persistentListOf()
@@ -126,11 +127,11 @@ class RemoteRestoreActivity : BaseActivity() {
persistentListOf(
MessageBackupsTypeFeature(
iconResourceId = R.drawable.symbol_thread_compact_bold_16,
label = "All of your media"
label = stringResource(id = R.string.RemoteRestoreActivity__all_of_your_media)
),
MessageBackupsTypeFeature(
iconResourceId = R.drawable.symbol_recent_compact_bold_16,
label = "All of your text messages"
label = stringResource(id = R.string.RemoteRestoreActivity__all_of_your_messages)
)
)
}
@@ -138,11 +139,11 @@ class RemoteRestoreActivity : BaseActivity() {
persistentListOf(
MessageBackupsTypeFeature(
iconResourceId = R.drawable.symbol_thread_compact_bold_16,
label = "Your last 30 days of media"
label = stringResource(id = R.string.RemoteRestoreActivity__your_last_d_days_of_media, 30)
),
MessageBackupsTypeFeature(
iconResourceId = R.drawable.symbol_recent_compact_bold_16,
label = "All of your text messages"
label = stringResource(id = R.string.RemoteRestoreActivity__all_of_your_messages)
)
)
}
@@ -186,11 +187,10 @@ class RemoteRestoreActivity : BaseActivity() {
)
}
// TODO [message-backups] Finalized copy.
val progressText = when (restoreProgress?.type) {
RestoreV2Event.Type.PROGRESS_DOWNLOAD -> "Downloading backup..."
RestoreV2Event.Type.PROGRESS_RESTORE -> "Restoring messages..."
else -> "Restoring..."
RestoreV2Event.Type.PROGRESS_DOWNLOAD -> stringResource(id = R.string.RemoteRestoreActivity__downloading_backup)
RestoreV2Event.Type.PROGRESS_RESTORE -> stringResource(id = R.string.RemoteRestoreActivity__downloading_backup)
else -> stringResource(id = R.string.RemoteRestoreActivity__restoring)
}
Text(
@@ -203,7 +203,7 @@ class RemoteRestoreActivity : BaseActivity() {
val progressBytes = Util.getPrettyFileSize(restoreProgress.count)
val totalBytes = Util.getPrettyFileSize(restoreProgress.estimatedTotalCount)
Text(
text = "$progressBytes of $totalBytes (%.2f%%)".format(restoreProgress.getProgress()),
text = stringResource(id = R.string.RemoteRestoreActivity__s_of_s_s, progressBytes, totalBytes, "%.2f%%".format(restoreProgress.getProgress())),
style = MaterialTheme.typography.bodySmall,
modifier = Modifier.padding(bottom = 12.dp)
)
@@ -264,7 +264,7 @@ class RemoteRestoreActivity : BaseActivity() {
.padding(top = 40.dp, bottom = 24.dp)
) {
Text(
text = "Restore from backup", // TODO [message-backups] Finalized copy.
text = stringResource(id = R.string.RemoteRestoreActivity__restore_from_backup),
style = MaterialTheme.typography.headlineMedium,
modifier = Modifier.padding(bottom = 12.dp)
)
@@ -281,7 +281,7 @@ class RemoteRestoreActivity : BaseActivity() {
append(" ")
if (tier != MessageBackupTier.PAID) {
withStyle(SpanStyle(fontWeight = FontWeight.SemiBold)) {
append("Only media sent or received in the past 30 days is included.") // TODO [message-backups] Finalized copy.
append(stringResource(id = R.string.RemoteRestoreActivity__only_media_sent_or_received))
}
}
}
@@ -301,7 +301,7 @@ class RemoteRestoreActivity : BaseActivity() {
.padding(top = 20.dp, bottom = 18.dp)
) {
Text(
text = "Your backup includes:", // TODO [message-backups] Finalized copy.
text = stringResource(id = R.string.RemoteRestoreActivity__your_backup_includes),
style = MaterialTheme.typography.titleMedium,
modifier = Modifier.padding(bottom = 6.dp)
)
@@ -322,7 +322,7 @@ class RemoteRestoreActivity : BaseActivity() {
modifier = Modifier.fillMaxWidth()
) {
Text(
text = "Restore backup" // TODO [message-backups] Finalized copy.
text = stringResource(id = R.string.RemoteRestoreActivity__restore_backup)
)
}