diff --git a/app/src/main/java/to/bitkit/ui/ContentView.kt b/app/src/main/java/to/bitkit/ui/ContentView.kt index 857a7e70c4..c7711c6071 100644 --- a/app/src/main/java/to/bitkit/ui/ContentView.kt +++ b/app/src/main/java/to/bitkit/ui/ContentView.kt @@ -636,7 +636,12 @@ fun ContentView( TimedSheetType.QUICK_PAY -> { QuickPayIntroSheet( + onLater = { + settingsViewModel.setQuickPayIntroSeen(true) + appViewModel.dismissTimedSheet() + }, onContinue = { + settingsViewModel.setQuickPayIntroSeen(true) appViewModel.dismissTimedSheet() navController.navigateTo(Routes.QuickPaySettings) }, @@ -1676,7 +1681,6 @@ private fun NavGraphBuilder.generalSettingsSubScreens( } BackgroundPaymentsIntroScreen( onBack = { navController.popBackStack() }, - onLater = { navController.popBackStack() }, onEnable = { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { notificationPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS) diff --git a/app/src/main/java/to/bitkit/ui/components/SheetIntro.kt b/app/src/main/java/to/bitkit/ui/components/SheetIntro.kt new file mode 100644 index 0000000000..38e5b2f821 --- /dev/null +++ b/app/src/main/java/to/bitkit/ui/components/SheetIntro.kt @@ -0,0 +1,151 @@ +package to.bitkit.ui.components + +import androidx.annotation.DrawableRes +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.navigationBarsPadding +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.AnnotatedString +import androidx.compose.ui.unit.dp +import to.bitkit.ui.scaffold.SheetTopBar +import to.bitkit.ui.shared.util.gradientBackground +import to.bitkit.ui.theme.Colors + +/** Width fraction used by intro sheet artwork. */ +const val SHEET_INTRO_IMAGE_WIDTH_FRACTION = 0.8f + +@Composable +@Suppress("LongParameterList") +fun SheetIntro( + navTitle: String, + title: AnnotatedString, + description: AnnotatedString, + @DrawableRes image: Int, + continueText: String, + onContinue: () -> Unit, + modifier: Modifier = Modifier, + continueLoading: Boolean = false, + cancelText: String? = null, + onCancel: (() -> Unit)? = null, + testTag: String = "SheetIntro", + cancelTestTag: String = "${testTag}Cancel", + continueTestTag: String = "${testTag}Continue", +) { + Column( + modifier = modifier + .fillMaxSize() + .gradientBackground() + .navigationBarsPadding() + .testTag(testTag) + ) { + SheetTopBar(navTitle) + + Column( + modifier = Modifier.padding(horizontal = 32.dp), + ) { + Box( + contentAlignment = Alignment.BottomCenter, + modifier = Modifier + .fillMaxWidth() + .weight(1f) + ) { + Image( + painter = painterResource(image), + contentDescription = null, + contentScale = ContentScale.Fit, + modifier = Modifier + .fillMaxWidth(SHEET_INTRO_IMAGE_WIDTH_FRACTION) + .heightIn(max = 320.dp) + .testTag("${testTag}Image") + ) + } + + VerticalSpacer(32.dp) + Display( + text = title, + color = Colors.White, + modifier = Modifier.testTag("${testTag}Title") + ) + VerticalSpacer(8.dp) + BodyM( + text = description, + color = Colors.White64, + modifier = Modifier.testTag("${testTag}Description") + ) + VerticalSpacer(32.dp) + + SheetIntroButtons( + continueText = continueText, + onContinue = onContinue, + continueLoading = continueLoading, + cancelText = cancelText, + onCancel = onCancel, + testTag = "${testTag}Buttons", + cancelTestTag = cancelTestTag, + continueTestTag = continueTestTag, + ) + VerticalSpacer(16.dp) + } + } +} + +@Composable +@Suppress("LongParameterList") +private fun SheetIntroButtons( + continueText: String, + onContinue: () -> Unit, + modifier: Modifier = Modifier, + continueLoading: Boolean = false, + cancelText: String? = null, + onCancel: (() -> Unit)? = null, + testTag: String = "SheetIntroButtons", + cancelTestTag: String = "SheetIntroCancel", + continueTestTag: String = "SheetIntroContinue", +) { + if (cancelText == null || onCancel == null) { + PrimaryButton( + text = continueText, + onClick = onContinue, + isLoading = continueLoading, + modifier = modifier.testTag(continueTestTag) + ) + return + } + + Row( + horizontalArrangement = Arrangement.spacedBy(16.dp), + modifier = modifier + .fillMaxWidth() + .testTag(testTag) + ) { + SecondaryButton( + text = cancelText, + fullWidth = false, + onClick = onCancel, + modifier = Modifier + .weight(1f) + .testTag(cancelTestTag) + ) + PrimaryButton( + text = continueText, + fullWidth = false, + onClick = onContinue, + isLoading = continueLoading, + modifier = Modifier + .weight(1f) + .testTag(continueTestTag) + ) + } +} diff --git a/app/src/main/java/to/bitkit/ui/screens/wallets/activity/ActivityDetailScreen.kt b/app/src/main/java/to/bitkit/ui/screens/wallets/activity/ActivityDetailScreen.kt index d9cc09ae9e..00f2b50fc1 100644 --- a/app/src/main/java/to/bitkit/ui/screens/wallets/activity/ActivityDetailScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/wallets/activity/ActivityDetailScreen.kt @@ -74,7 +74,7 @@ import to.bitkit.ui.components.BodySSB import to.bitkit.ui.components.BottomSheetPreview import to.bitkit.ui.components.ButtonSize import to.bitkit.ui.components.Caption13Up -import to.bitkit.ui.components.MoneySSB +import to.bitkit.ui.components.MoneyCaptionM import to.bitkit.ui.components.PrimaryButton import to.bitkit.ui.components.PubkyContactAvatar import to.bitkit.ui.components.TagButton @@ -499,7 +499,7 @@ private fun ActivityDetailContent( if (isHidden) { BodySSB(text = UiConstants.HIDE_BALANCE_SHORT) } else { - MoneySSB(sats = displayAmount.toLong()) + MoneyCaptionM(sats = displayAmount.toLong()) } } } @@ -536,7 +536,7 @@ private fun ActivityDetailContent( if (isHidden) { BodySSB(text = UiConstants.HIDE_BALANCE_SHORT) } else { - MoneySSB(sats = fee.toLong()) + MoneyCaptionM(sats = fee.toLong()) } } } diff --git a/app/src/main/java/to/bitkit/ui/settings/backgroundPayments/BackgroundPaymentsIntroScreen.kt b/app/src/main/java/to/bitkit/ui/settings/backgroundPayments/BackgroundPaymentsIntroScreen.kt index ce5363abeb..e94b99f3a7 100644 --- a/app/src/main/java/to/bitkit/ui/settings/backgroundPayments/BackgroundPaymentsIntroScreen.kt +++ b/app/src/main/java/to/bitkit/ui/settings/backgroundPayments/BackgroundPaymentsIntroScreen.kt @@ -1,9 +1,7 @@ package to.bitkit.ui.settings.backgroundPayments import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding @@ -21,7 +19,6 @@ import to.bitkit.R import to.bitkit.ui.components.BodyM import to.bitkit.ui.components.Display import to.bitkit.ui.components.PrimaryButton -import to.bitkit.ui.components.SecondaryButton import to.bitkit.ui.components.VerticalSpacer import to.bitkit.ui.scaffold.AppTopBar import to.bitkit.ui.scaffold.DrawerNavIcon @@ -34,7 +31,6 @@ import to.bitkit.viewmodels.SettingsViewModel @Composable fun BackgroundPaymentsIntroScreen( onBack: () -> Unit, - onLater: () -> Unit, onEnable: () -> Unit, modifier: Modifier = Modifier, settingsViewModel: SettingsViewModel = hiltViewModel(), @@ -48,10 +44,6 @@ fun BackgroundPaymentsIntroScreen( actions = { DrawerNavIcon() }, ) BackgroundPaymentsIntroContent( - onLater = { - settingsViewModel.setBgPaymentsIntroSeen(true) - onLater() - }, onEnable = { settingsViewModel.setBgPaymentsIntroSeen(true) onEnable() @@ -62,7 +54,6 @@ fun BackgroundPaymentsIntroScreen( @Composable fun BackgroundPaymentsIntroContent( - onLater: () -> Unit, onEnable: () -> Unit, modifier: Modifier = Modifier, ) { @@ -70,7 +61,7 @@ fun BackgroundPaymentsIntroContent( modifier = modifier.padding(horizontal = 32.dp) ) { Image( - painter = painterResource(R.drawable.bell), + painter = painterResource(R.drawable.bell_figure), contentDescription = null, contentScale = ContentScale.Fit, modifier = Modifier @@ -87,29 +78,11 @@ fun BackgroundPaymentsIntroContent( VerticalSpacer(8.dp) BodyM(text = stringResource(R.string.settings__bg__intro_desc), color = Colors.White64) VerticalSpacer(32.dp) - Row( - horizontalArrangement = Arrangement.spacedBy(16.dp), - modifier = Modifier - .fillMaxWidth() - .testTag("BackgroundPaymentsIntro-buttons") - ) { - SecondaryButton( - text = stringResource(R.string.common__later), - fullWidth = false, - onClick = onLater, - modifier = Modifier - .weight(1f) - .testTag("BackgroundPaymentsIntro-later") - ) - PrimaryButton( - text = stringResource(R.string.settings__bg__intro_button), - fullWidth = false, - onClick = onEnable, - modifier = Modifier - .weight(1f) - .testTag("BackgroundPaymentsIntro-enable") - ) - } + PrimaryButton( + text = stringResource(R.string.settings__bg__intro_button), + onClick = onEnable, + modifier = Modifier.testTag("BackgroundPaymentsIntro-enable") + ) VerticalSpacer(16.dp) } } @@ -119,7 +92,6 @@ fun BackgroundPaymentsIntroContent( private fun Preview() { AppThemeSurface { BackgroundPaymentsIntroContent( - onLater = {}, onEnable = {}, ) } diff --git a/app/src/main/java/to/bitkit/ui/settings/backups/BackupIntroScreen.kt b/app/src/main/java/to/bitkit/ui/settings/backups/BackupIntroScreen.kt index e2e47edee9..2547770505 100644 --- a/app/src/main/java/to/bitkit/ui/settings/backups/BackupIntroScreen.kt +++ b/app/src/main/java/to/bitkit/ui/settings/backups/BackupIntroScreen.kt @@ -1,34 +1,15 @@ package to.bitkit.ui.settings.backups -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.heightIn -import androidx.compose.foundation.layout.navigationBarsPadding -import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.ContentScale -import androidx.compose.ui.platform.testTag -import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp import to.bitkit.R -import to.bitkit.ui.components.BodyM import to.bitkit.ui.components.BottomSheetPreview -import to.bitkit.ui.components.Display -import to.bitkit.ui.components.PrimaryButton -import to.bitkit.ui.components.SecondaryButton +import to.bitkit.ui.components.SheetIntro import to.bitkit.ui.components.SheetSize -import to.bitkit.ui.components.VerticalSpacer -import to.bitkit.ui.scaffold.SheetTopBar import to.bitkit.ui.shared.modifiers.sheetHeight -import to.bitkit.ui.shared.util.gradientBackground import to.bitkit.ui.theme.AppThemeSurface import to.bitkit.ui.theme.Colors import to.bitkit.ui.utils.withAccent @@ -40,71 +21,23 @@ fun BackupIntroScreen( onConfirm: () -> Unit, modifier: Modifier = Modifier, ) { - Column( + SheetIntro( + navTitle = stringResource(R.string.security__backup_wallet), + title = stringResource(R.string.security__backup_title).withAccent(accentColor = Colors.Blue), + description = AnnotatedString( + when (hasFunds) { + true -> stringResource(R.string.security__backup_funds) + else -> stringResource(R.string.security__backup_funds_no) + }, + ), + image = R.drawable.safe, + continueText = stringResource(R.string.security__backup_button), + onContinue = onConfirm, + cancelText = stringResource(R.string.common__later), + onCancel = onClose, + testTag = "BackupIntroView", modifier = modifier - .fillMaxSize() - .gradientBackground() - .navigationBarsPadding() - .testTag("BackupIntroView") - ) { - SheetTopBar(stringResource(R.string.security__backup_wallet)) - Column( - horizontalAlignment = Alignment.CenterHorizontally, - modifier = Modifier.padding(horizontal = 32.dp), - ) { - Image( - painter = painterResource(R.drawable.safe), - contentDescription = null, - contentScale = ContentScale.Fit, - modifier = Modifier - .fillMaxWidth() - .weight(1f) - .heightIn(max = 320.dp) - .testTag("BackupIntroViewImage") - ) - Display( - text = stringResource(R.string.security__backup_title).withAccent(accentColor = Colors.Blue), - color = Colors.White, - modifier = Modifier - .testTag("BackupIntroViewTitle") - ) - VerticalSpacer(8.dp) - BodyM( - text = when (hasFunds) { - true -> stringResource(R.string.security__backup_funds) - else -> stringResource(R.string.security__backup_funds_no) - }, - color = Colors.White64, - modifier = Modifier - .testTag("BackupIntroViewDescription") - ) - VerticalSpacer(32.dp) - Row( - horizontalArrangement = Arrangement.spacedBy(16.dp), - modifier = Modifier - .fillMaxWidth() - .testTag("BackupIntroViewButtons") - ) { - SecondaryButton( - text = stringResource(R.string.common__later), - fullWidth = false, - onClick = onClose, - modifier = Modifier - .weight(1f) - .testTag("BackupIntroViewCancel") - ) - PrimaryButton( - text = stringResource(R.string.security__backup_button), - fullWidth = false, - onClick = onConfirm, - modifier = Modifier - .weight(1f) - .testTag("BackupIntroViewContinue") - ) - } - VerticalSpacer(16.dp) - } - } + ) } @Preview(showSystemUi = true) diff --git a/app/src/main/java/to/bitkit/ui/settings/pin/PinPromptScreen.kt b/app/src/main/java/to/bitkit/ui/settings/pin/PinPromptScreen.kt index 333e2f5b5f..4cc86e1e3f 100644 --- a/app/src/main/java/to/bitkit/ui/settings/pin/PinPromptScreen.kt +++ b/app/src/main/java/to/bitkit/ui/settings/pin/PinPromptScreen.kt @@ -1,41 +1,19 @@ package to.bitkit.ui.settings.pin -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.aspectRatio -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.navigationBarsPadding -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.width import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.ContentScale -import androidx.compose.ui.platform.testTag -import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp import to.bitkit.R -import to.bitkit.ui.components.BodyM import to.bitkit.ui.components.BottomSheetPreview -import to.bitkit.ui.components.Display -import to.bitkit.ui.components.PrimaryButton -import to.bitkit.ui.components.SecondaryButton +import to.bitkit.ui.components.SheetIntro import to.bitkit.ui.components.SheetSize -import to.bitkit.ui.scaffold.SheetTopBar import to.bitkit.ui.shared.modifiers.sheetHeight -import to.bitkit.ui.shared.util.gradientBackground import to.bitkit.ui.theme.AppThemeSurface import to.bitkit.ui.theme.Colors import to.bitkit.ui.utils.withAccent -@Suppress("MagicNumber") @Composable fun PinPromptScreen( onContinue: () -> Unit, @@ -43,75 +21,18 @@ fun PinPromptScreen( modifier: Modifier = Modifier, showLaterButton: Boolean = true, ) { - Column( + SheetIntro( + navTitle = stringResource(R.string.security__pin_security_header), + title = stringResource(R.string.security__pin_security_title).withAccent(accentColor = Colors.Green), + description = AnnotatedString(stringResource(R.string.security__pin_security_text)), + image = R.drawable.shield, + continueText = stringResource(R.string.security__pin_security_button), + onContinue = onContinue, + cancelText = stringResource(R.string.common__later).takeIf { showLaterButton }, + onCancel = onLater.takeIf { showLaterButton }, + testTag = "SecureWallet", modifier = modifier - .fillMaxSize() - .gradientBackground() - .padding(horizontal = 16.dp) - .navigationBarsPadding() - .testTag("SecureWallet") - ) { - SheetTopBar(stringResource(R.string.security__pin_security_header)) - - Column( - modifier = Modifier - .fillMaxSize() - .padding(horizontal = 16.dp) - ) { - Box( - contentAlignment = Alignment.Center, - modifier = Modifier - .fillMaxWidth(0.8f) - .aspectRatio(1f) - .align(Alignment.CenterHorizontally) - .weight(1f) - ) { - Image( - painter = painterResource(id = R.drawable.shield), - contentDescription = null, - contentScale = ContentScale.Fit, - modifier = Modifier.fillMaxSize() - ) - } - - Display(text = stringResource(R.string.security__pin_security_title).withAccent(accentColor = Colors.Green)) - - Spacer(modifier = Modifier.height(8.dp)) - - BodyM( - text = stringResource(R.string.security__pin_security_text), - color = Colors.White64, - ) - - Spacer(modifier = Modifier.height(32.dp)) - - Row( - modifier = Modifier.fillMaxWidth() - ) { - if (showLaterButton) { - SecondaryButton( - text = stringResource(R.string.common__later), - onClick = onLater, - modifier = Modifier - .weight(1f) - .testTag("SecureWalletContinue") - ) - - Spacer(modifier = Modifier.width(16.dp)) - } - - PrimaryButton( - text = stringResource(R.string.security__pin_security_button), - onClick = onContinue, - modifier = Modifier - .weight(1f) - .testTag("SecureWalletContinue") - ) - } - - Spacer(modifier = Modifier.height(16.dp)) - } - } + ) } @Preview(showSystemUi = true) diff --git a/app/src/main/java/to/bitkit/ui/sheets/BackgroundPaymentsIntroSheet.kt b/app/src/main/java/to/bitkit/ui/sheets/BackgroundPaymentsIntroSheet.kt index e0529e0eb3..0529fb4a64 100644 --- a/app/src/main/java/to/bitkit/ui/sheets/BackgroundPaymentsIntroSheet.kt +++ b/app/src/main/java/to/bitkit/ui/sheets/BackgroundPaymentsIntroSheet.kt @@ -1,20 +1,17 @@ package to.bitkit.ui.sheets -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.tooling.preview.Preview import to.bitkit.R import to.bitkit.ui.components.BottomSheetPreview -import to.bitkit.ui.scaffold.SheetTopBar -import to.bitkit.ui.settings.backgroundPayments.BackgroundPaymentsIntroContent +import to.bitkit.ui.components.SheetIntro import to.bitkit.ui.shared.modifiers.sheetHeight -import to.bitkit.ui.shared.util.gradientBackground import to.bitkit.ui.theme.AppThemeSurface +import to.bitkit.ui.theme.Colors +import to.bitkit.ui.utils.withAccent @Composable fun BackgroundPaymentsIntroSheet( @@ -22,33 +19,32 @@ fun BackgroundPaymentsIntroSheet( onEnable: () -> Unit, modifier: Modifier = Modifier, ) { - Column( + SheetIntro( + navTitle = stringResource(R.string.settings__bg__title), + title = stringResource(R.string.settings__bg__intro_title).withAccent(accentColor = Colors.Purple), + description = AnnotatedString(stringResource(R.string.settings__bg__intro_desc)), + image = R.drawable.bell_figure, + continueText = stringResource(R.string.settings__bg__intro_button), + onContinue = onEnable, + cancelText = stringResource(R.string.common__later), + onCancel = onLater, + testTag = "BackgroundPaymentsIntro", + cancelTestTag = "BackgroundPaymentsIntro-later", + continueTestTag = "BackgroundPaymentsIntro-enable", modifier = modifier - .fillMaxWidth() .sheetHeight(isModal = true) - .gradientBackground() - .navigationBarsPadding() - .testTag("background_payments_intro_sheet") - ) { - SheetTopBar(titleText = stringResource(R.string.settings__bg__title)) - BackgroundPaymentsIntroContent( - onLater = onLater, - onEnable = onEnable, - ) - } + ) } @Preview(showSystemUi = true) @Composable private fun Preview() { AppThemeSurface { - Column { - BottomSheetPreview { - BackgroundPaymentsIntroSheet( - onLater = {}, - onEnable = {}, - ) - } + BottomSheetPreview { + BackgroundPaymentsIntroSheet( + onLater = {}, + onEnable = {}, + ) } } } diff --git a/app/src/main/java/to/bitkit/ui/sheets/ForceTransferSheet.kt b/app/src/main/java/to/bitkit/ui/sheets/ForceTransferSheet.kt index d8f3a04668..f30a36813e 100644 --- a/app/src/main/java/to/bitkit/ui/sheets/ForceTransferSheet.kt +++ b/app/src/main/java/to/bitkit/ui/sheets/ForceTransferSheet.kt @@ -3,36 +3,20 @@ package to.bitkit.ui.sheets import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.aspectRatio -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.navigationBarsPadding -import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier -import androidx.compose.ui.platform.testTag -import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import to.bitkit.R import to.bitkit.repositories.ConnectivityState -import to.bitkit.ui.components.BodyM import to.bitkit.ui.components.BottomSheetPreview import to.bitkit.ui.components.ConnectionIssuesView -import to.bitkit.ui.components.Display -import to.bitkit.ui.components.PrimaryButton -import to.bitkit.ui.components.SecondaryButton -import to.bitkit.ui.components.VerticalSpacer -import to.bitkit.ui.scaffold.SheetTopBar +import to.bitkit.ui.components.SheetIntro import to.bitkit.ui.shared.modifiers.sheetHeight -import to.bitkit.ui.shared.util.gradientBackground import to.bitkit.ui.theme.AppThemeSurface import to.bitkit.ui.theme.Colors import to.bitkit.ui.utils.withAccent @@ -76,60 +60,21 @@ private fun Content( onForceTransfer: () -> Unit = {}, onCancel: () -> Unit = {}, ) { - Column( - modifier = modifier - .sheetHeight() - .gradientBackground() - .navigationBarsPadding() - .padding(horizontal = 16.dp) - .testTag("ForceTransfer") - ) { - SheetTopBar(titleText = stringResource(R.string.lightning__force_nav_title)) - - Image( - painter = painterResource(R.drawable.exclamation_mark), - contentDescription = null, - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 36.dp) - .aspectRatio(1.0f) - .weight(1f) - ) - - Display(text = stringResource(R.string.lightning__force_title).withAccent(accentColor = Colors.Yellow)) - - VerticalSpacer(8.dp) - - BodyM( - text = stringResource(R.string.lightning__force_text), - color = Colors.White64, - modifier = Modifier.fillMaxWidth() - ) - - VerticalSpacer(32.dp) - - Row( - horizontalArrangement = Arrangement.spacedBy(16.dp), - ) { - SecondaryButton( - text = stringResource(R.string.common__cancel), - onClick = onCancel, - modifier = Modifier - .weight(1f) - .testTag("CancelButton") - ) - PrimaryButton( - text = stringResource(R.string.lightning__force_button), - onClick = onForceTransfer, - isLoading = isLoading, - modifier = Modifier - .weight(1f) - .testTag("ForceTransferButton") - ) - } - - VerticalSpacer(16.dp) - } + SheetIntro( + navTitle = stringResource(R.string.lightning__force_nav_title), + title = stringResource(R.string.lightning__force_title).withAccent(accentColor = Colors.Yellow), + description = AnnotatedString(stringResource(R.string.lightning__force_text)), + image = R.drawable.exclamation_mark, + continueText = stringResource(R.string.lightning__force_button), + onContinue = onForceTransfer, + continueLoading = isLoading, + cancelText = stringResource(R.string.common__cancel), + onCancel = onCancel, + testTag = "ForceTransfer", + cancelTestTag = "CancelButton", + continueTestTag = "ForceTransferButton", + modifier = modifier.sheetHeight() + ) } @Preview(showSystemUi = true) diff --git a/app/src/main/java/to/bitkit/ui/sheets/HighBalanceWarningSheet.kt b/app/src/main/java/to/bitkit/ui/sheets/HighBalanceWarningSheet.kt index 2f8b7c4b35..28c0a6d66c 100644 --- a/app/src/main/java/to/bitkit/ui/sheets/HighBalanceWarningSheet.kt +++ b/app/src/main/java/to/bitkit/ui/sheets/HighBalanceWarningSheet.kt @@ -1,30 +1,13 @@ package to.bitkit.ui.sheets -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.navigationBarsPadding -import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.platform.testTag -import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp import to.bitkit.R -import to.bitkit.ui.components.BodyM import to.bitkit.ui.components.BottomSheetPreview -import to.bitkit.ui.components.Display -import to.bitkit.ui.components.PrimaryButton -import to.bitkit.ui.components.SecondaryButton -import to.bitkit.ui.components.VerticalSpacer -import to.bitkit.ui.scaffold.SheetTopBar +import to.bitkit.ui.components.SheetIntro import to.bitkit.ui.shared.modifiers.sheetHeight -import to.bitkit.ui.shared.util.gradientBackground import to.bitkit.ui.theme.AppTextStyles import to.bitkit.ui.theme.AppThemeSurface import to.bitkit.ui.theme.Colors @@ -36,87 +19,32 @@ fun HighBalanceWarningSheet( learnMoreClick: () -> Unit, modifier: Modifier = Modifier, ) { - Column( - modifier = modifier - .fillMaxWidth() - .sheetHeight(isModal = true) - .gradientBackground() - .navigationBarsPadding() - .testTag("HighBalanceSheet") - ) { - SheetTopBar(stringResource(R.string.other__high_balance__nav_title)) - - Column( - horizontalAlignment = Alignment.CenterHorizontally, - modifier = Modifier.padding(horizontal = 16.dp), - ) { - Image( - painter = painterResource(R.drawable.exclamation_mark), - contentDescription = null, - modifier = Modifier - .fillMaxWidth() - .weight(1f) - .testTag("HighBalanceSheetImage") - ) - - Display( - text = stringResource(R.string.other__high_balance__title).withAccent(accentColor = Colors.Yellow), - color = Colors.White, - modifier = Modifier - .fillMaxWidth() - .testTag("HighBalanceSheetTitle") - ) - VerticalSpacer(8.dp) - BodyM( - text = stringResource(R.string.other__high_balance__text).withAccent( - defaultColor = Colors.White64, - accentStyle = AppTextStyles.Subtitle.merge(color = Colors.White).toSpanStyle() - ), - color = Colors.White64, - modifier = Modifier - .testTag("HighBalanceSheetDescription") - ) - VerticalSpacer(32.dp) - Row( - modifier = Modifier - .fillMaxWidth() - .testTag("HighBalanceSheetButtons"), - horizontalArrangement = Arrangement.spacedBy(16.dp) - ) { - SecondaryButton( - text = stringResource(R.string.other__high_balance__cancel), - fullWidth = false, - onClick = learnMoreClick, - modifier = Modifier - .weight(1f) - .testTag("HighBalanceSheetCancel"), - ) - - PrimaryButton( - text = stringResource(R.string.other__high_balance__continue), - fullWidth = false, - onClick = understoodClick, - modifier = Modifier - .weight(1f) - .testTag("HighBalanceSheetContinue"), - ) - } - VerticalSpacer(16.dp) - } - } + SheetIntro( + navTitle = stringResource(R.string.other__high_balance__nav_title), + title = stringResource(R.string.other__high_balance__title).withAccent(accentColor = Colors.Yellow), + description = stringResource(R.string.other__high_balance__text).withAccent( + defaultColor = Colors.White64, + accentStyle = AppTextStyles.Subtitle.merge(color = Colors.White).toSpanStyle(), + ), + image = R.drawable.exclamation_mark, + continueText = stringResource(R.string.other__high_balance__continue), + onContinue = understoodClick, + cancelText = stringResource(R.string.other__high_balance__cancel), + onCancel = learnMoreClick, + testTag = "HighBalanceSheet", + modifier = modifier.sheetHeight(isModal = true) + ) } @Preview(showSystemUi = true) @Composable private fun Preview() { AppThemeSurface { - Column { - BottomSheetPreview { - HighBalanceWarningSheet( - understoodClick = {}, - learnMoreClick = {}, - ) - } + BottomSheetPreview { + HighBalanceWarningSheet( + understoodClick = {}, + learnMoreClick = {}, + ) } } } diff --git a/app/src/main/java/to/bitkit/ui/sheets/NewTransactionSheet.kt b/app/src/main/java/to/bitkit/ui/sheets/NewTransactionSheet.kt index 7e08821998..7219da0ab5 100644 --- a/app/src/main/java/to/bitkit/ui/sheets/NewTransactionSheet.kt +++ b/app/src/main/java/to/bitkit/ui/sheets/NewTransactionSheet.kt @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.material3.ExperimentalMaterial3Api @@ -37,6 +38,7 @@ import to.bitkit.ui.components.BottomSheet import to.bitkit.ui.components.BottomSheetOverlayState import to.bitkit.ui.components.BottomSheetPreview import to.bitkit.ui.components.PrimaryButton +import to.bitkit.ui.components.SHEET_INTRO_IMAGE_WIDTH_FRACTION import to.bitkit.ui.components.SecondaryButton import to.bitkit.ui.scaffold.SheetTopBar import to.bitkit.ui.shared.modifiers.sheetHeight @@ -113,10 +115,11 @@ fun NewTransactionSheetView( Image( painter = painterResource(R.drawable.check), contentDescription = null, - contentScale = ContentScale.FillWidth, + contentScale = ContentScale.Fit, modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 16.dp) + .padding(horizontal = 32.dp) + .fillMaxWidth(SHEET_INTRO_IMAGE_WIDTH_FRACTION) + .heightIn(max = 320.dp) .testTag("transaction_sent_image") .align(Alignment.Center) ) diff --git a/app/src/main/java/to/bitkit/ui/sheets/QuickPayIntroSheet.kt b/app/src/main/java/to/bitkit/ui/sheets/QuickPayIntroSheet.kt index 88c375e79f..e352643e31 100644 --- a/app/src/main/java/to/bitkit/ui/sheets/QuickPayIntroSheet.kt +++ b/app/src/main/java/to/bitkit/ui/sheets/QuickPayIntroSheet.kt @@ -1,49 +1,50 @@ package to.bitkit.ui.sheets -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.tooling.preview.Preview import to.bitkit.R import to.bitkit.ui.components.BottomSheetPreview -import to.bitkit.ui.scaffold.SheetTopBar -import to.bitkit.ui.settings.quickPay.QuickPayIntroContent +import to.bitkit.ui.components.SheetIntro import to.bitkit.ui.shared.modifiers.sheetHeight -import to.bitkit.ui.shared.util.gradientBackground import to.bitkit.ui.theme.AppThemeSurface +import to.bitkit.ui.theme.Colors +import to.bitkit.ui.utils.withAccent @Composable fun QuickPayIntroSheet( + onLater: () -> Unit, onContinue: () -> Unit, modifier: Modifier = Modifier, ) { - Column( + SheetIntro( + navTitle = stringResource(R.string.settings__quickpay__nav_title), + title = stringResource(R.string.settings__quickpay__intro__title).withAccent(accentColor = Colors.Green), + description = AnnotatedString(stringResource(R.string.settings__quickpay__sheet__description)), + image = R.drawable.fast_forward, + continueText = stringResource(R.string.common__learn_more), + onContinue = onContinue, + cancelText = stringResource(R.string.common__later), + onCancel = onLater, + testTag = "QuickpayIntro", + cancelTestTag = "QuickpayIntro-later", + continueTestTag = "QuickpayIntro-button", modifier = modifier - .fillMaxWidth() .sheetHeight(isModal = true) - .gradientBackground() - .navigationBarsPadding() - .testTag("quick_pay_intro_sheet") - ) { - SheetTopBar(stringResource(R.string.settings__quickpay__nav_title)) - QuickPayIntroContent(onContinue = onContinue) - } + ) } @Preview(showSystemUi = true) @Composable private fun Preview() { AppThemeSurface { - Column { - BottomSheetPreview { - QuickPayIntroSheet( - onContinue = {}, - ) - } + BottomSheetPreview { + QuickPayIntroSheet( + onLater = {}, + onContinue = {}, + ) } } } diff --git a/app/src/main/java/to/bitkit/ui/sheets/UpdateSheet.kt b/app/src/main/java/to/bitkit/ui/sheets/UpdateSheet.kt index 7e892dbcae..16415ea20b 100644 --- a/app/src/main/java/to/bitkit/ui/sheets/UpdateSheet.kt +++ b/app/src/main/java/to/bitkit/ui/sheets/UpdateSheet.kt @@ -1,35 +1,19 @@ package to.bitkit.ui.sheets import android.content.Intent -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.aspectRatio -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.navigationBarsPadding -import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.platform.testTag -import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp import androidx.core.net.toUri import to.bitkit.R import to.bitkit.env.Env -import to.bitkit.ui.components.BodyM import to.bitkit.ui.components.BottomSheetPreview -import to.bitkit.ui.components.Display -import to.bitkit.ui.components.PrimaryButton -import to.bitkit.ui.components.SecondaryButton +import to.bitkit.ui.components.SheetIntro import to.bitkit.ui.components.SheetSize -import to.bitkit.ui.components.VerticalSpacer -import to.bitkit.ui.scaffold.SheetTopBar import to.bitkit.ui.shared.modifiers.sheetHeight -import to.bitkit.ui.shared.util.gradientBackground import to.bitkit.ui.theme.AppThemeSurface import to.bitkit.ui.theme.Colors import to.bitkit.ui.utils.withAccent @@ -41,64 +25,20 @@ fun UpdateSheet( ) { val context = LocalContext.current - Column( - modifier = modifier - .sheetHeight(SheetSize.LARGE) - .gradientBackground() - .navigationBarsPadding() - .padding(horizontal = 32.dp) - ) { - SheetTopBar(titleText = stringResource(R.string.other__update_nav_title)) - VerticalSpacer(16.dp) - - Image( - painter = painterResource(R.drawable.wand), - contentDescription = null, - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 28.dp) - .aspectRatio(1.0f) - .weight(1f) - ) - - Display( - text = stringResource(R.string.other__update_title) - .withAccent(accentColor = Colors.Brand), - color = Colors.White, - ) - - BodyM( - text = stringResource(R.string.other__update_text), - color = Colors.White64, - ) - - VerticalSpacer(32.dp) - Row( - modifier = Modifier - .fillMaxWidth() - .testTag("buttons_row"), - horizontalArrangement = Arrangement.spacedBy(16.dp) - ) { - SecondaryButton( - text = stringResource(R.string.common__cancel), - fullWidth = false, - onClick = onCancel, - modifier = Modifier - .weight(1f), - ) - - PrimaryButton( - text = stringResource(R.string.other__update_button), - fullWidth = false, - onClick = { - context.startActivity(Intent(Intent.ACTION_VIEW, Env.PLAY_STORE_URL.toUri())) - }, - modifier = Modifier - .weight(1f), - ) - } - VerticalSpacer(16.dp) - } + SheetIntro( + navTitle = stringResource(R.string.other__update_nav_title), + title = stringResource(R.string.other__update_title).withAccent(accentColor = Colors.Brand), + description = AnnotatedString(stringResource(R.string.other__update_text)), + image = R.drawable.wand, + continueText = stringResource(R.string.other__update_button), + onContinue = { + context.startActivity(Intent(Intent.ACTION_VIEW, Env.PLAY_STORE_URL.toUri())) + }, + cancelText = stringResource(R.string.common__cancel), + onCancel = onCancel, + testTag = "AppUpdateSheet", + modifier = modifier.sheetHeight(SheetSize.LARGE) + ) } @Preview(showSystemUi = true) diff --git a/app/src/main/res/drawable-nodpi/bell_figure.png b/app/src/main/res/drawable-nodpi/bell_figure.png new file mode 100644 index 0000000000..2c2fd70c59 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/bell_figure.png differ diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 71e667dd80..c45b2efe64 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -665,13 +665,14 @@ عام إعدادات النظام اللغة - يجعل Bitkit QuickPay الدفع أسرع بالدفع التلقائي لرموز QR عند مسحها. + يجعل Bitkit QuickPay الدفع أسرع من خلال دفع الفواتير الصغيرة تلقائيًا. مدفوعات\n<accent>سلسة</accent> QuickPay حد QuickPay * يدعم Bitkit QuickPay المدفوعات من رصيد الإنفاق فقط. إذا تم التفعيل، سيتم دفع الفواتير الممسوحة التي تقل عن ${amount} تلقائيًا دون الحاجة إلى تأكيدك أو رمز PIN*. تفعيل QuickPay + يجعل QuickPay الدفع أسرع من خلال الدفع تلقائيًا لرموز QR الممسوحة ضوئيًا. اتصال عنوان URL لخادم Rapid-Gossip-Sync قد تحتاج إلى إعادة تشغيل التطبيق مرة أو مرتين لتفعيل هذا التغيير. diff --git a/app/src/main/res/values-b+es+419/strings.xml b/app/src/main/res/values-b+es+419/strings.xml index 08b8d31b53..e8e9c8a608 100644 --- a/app/src/main/res/values-b+es+419/strings.xml +++ b/app/src/main/res/values-b+es+419/strings.xml @@ -665,13 +665,14 @@ Geral Ajustes del sistema Idioma - Bitkit QuickPay agiliza el proceso de pago mediante el pago automático de los códigos QR al ser escaneados. + Bitkit QuickPay agiliza el proceso de pago pagando automáticamente facturas pequeñas. <accent>Pagos</accent>\nsin fricción QuickPay Rango de Quickpay * Bitkit QuickPay soporta exclusivamente pagos desde su Saldo de Gastos. Si se activa, las facturas escaneadas por debajo de ${amount} se pagarán automáticamente sin necesidad de su confirmación o PIN*. Activar QuickPay + QuickPay agiliza el proceso de pago pagando automáticamente códigos QR escaneados. Conectar URL del servidor Rapid-Gossip-Sync Es posible que tenga que reiniciar la aplicación una o dos veces para que este cambio surta efecto. diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 0f4885df8d..071fdf446b 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -665,13 +665,14 @@ General Configuració del sistema Idioma - Bitkit QuickPay fa que pagar sigui més ràpid pagant automàticament els codis QR quan s\'escanegen. + Bitkit QuickPay fa que pagar sigui més ràpid pagant automàticament factures petites. <accent>Pagaments</accent>\nsense friccions QuickPay Llindar de QuickPay * Bitkit QuickPay només admet pagaments des del teu saldo de despesa. Si està habilitat, les factures escanejades per sota de ${amount} es pagaran automàticament sense requerir la teva confirmació o PIN*. Habilitar QuickPay + QuickPay fa que pagar sigui més ràpid pagant automàticament els codis QR escanejats. Connecta URL del servidor Rapid-Gossip-Sync Potser hauràs de reiniciar l\'aplicació un o dos cops perquè aquest canvi tingui efecte. diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 5ea9afbd88..cd43549817 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -665,13 +665,14 @@ Obecné Systémové nastavení Jazyk - Služba Bitkit QuickPay urychluje odbavení tím, že po naskenování QR kódu automaticky zaplatí. + Bitkit QuickPay urychluje placení automatickou úhradou malých faktur. <accent>Okamžité</accent>\nplatby QuickPay Quickpay limit * Bitkit QuickPay podporuje výhradně platby z vašeho disponibilního zůstatku. Pokud je tato funkce povolena, budou naskenované faktury nižší než{amount} placeny automaticky bez nutnosti potvrzení nebo zadání kódu PIN*. Povolení služby QuickPay + QuickPay urychluje placení automatickou úhradou naskenovaných QR kódů. Připojit URL dresa serveru Rapid-Gossip-Sync Aby se tato změna projevila, může být nutné aplikaci jednou nebo dvakrát restartovat. diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 00607ac192..3b09761dea 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -576,11 +576,12 @@ Auf Standard zurücksetzen QuickPay <accent>Reibungslos</accent>\nZahlungen - Bitkit QuickPay beschleunigt den Bezahlvorgang, indem es QR-Codes beim Scannen automatisch bezahlt. + Bitkit QuickPay beschleunigt den Bezahlvorgang, indem kleine Rechnungen automatisch bezahlt werden. QuickPay aktivieren Wenn diese Option aktiviert ist, werden gescannte Rechnungen unter ${Betrag} automatisch bezahlt, ohne dass Sie eine Bestätigung oder PIN* benötigen. Quickpay-Schwelle * Bitkit QuickPay unterstützt ausschließlich Zahlungen von deinem Guthaben. + QuickPay beschleunigt den Bezahlvorgang, indem gescannte QR-Codes automatisch bezahlt werden. Hintergrund-Zahlungen PASSIV\n<accent>EMPFANGEN</accent> Aktiviere Benachrichtigungen, um Zahlungen zu empfangen, auch wenn deine Bitkit-App geschlossen ist. diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 99f52ff5c1..53732c3c80 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -665,13 +665,14 @@ Γενικά Ρυθμίσεις συστήματος Γλώσσα - Το Bitkit QuickPay κάνει την ολοκλήρωση αγοράς πιο γρήγορη πληρώνοντας αυτόματα κωδικούς QR κατά τη σάρωση. + Το Bitkit QuickPay κάνει την ολοκλήρωση αγοράς πιο γρήγορη πληρώνοντας αυτόματα μικρά τιμολόγια. <accent>Απρόσκοπτες</accent>\nπληρωμές QuickPay Όριο Quickpay * Το Bitkit QuickPay υποστηρίζει αποκλειστικά πληρωμές από το υπόλοιπο δαπανών. Αν είναι ενεργοποιημένο, τα σαρωμένα τιμολόγια κάτω από ${amount} θα πληρώνονται αυτόματα χωρίς επιβεβαίωση ή PIN*. Ενεργοποίηση QuickPay + Το QuickPay κάνει την ολοκλήρωση αγοράς πιο γρήγορη πληρώνοντας αυτόματα σαρωμένους κωδικούς QR. Σύνδεση URL διακομιστή Rapid-Gossip-Sync Μπορεί να χρειαστεί να επανεκκινήσεις την εφαρμογή μία ή δύο φορές για να εφαρμοστεί αυτή η αλλαγή. diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index e2db33121e..3cdf60d28f 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -665,13 +665,14 @@ General Ajustes del sistema Idioma - Bitkit QuickPay hace que pagar sea más rápido pagando automáticamente los códigos QR cuando se escanean. + Bitkit QuickPay hace que pagar sea más rápido pagando automáticamente facturas pequeñas. Pagos\n<accent>sin fricción</accent> QuickPay Umbral de QuickPay * Bitkit QuickPay solo admite pagos desde tu saldo de gasto. Si está activado, las facturas escaneadas por debajo de ${amount} se pagarán automáticamente sin requerir tu confirmación o PIN*. Activar QuickPay + QuickPay hace que pagar sea más rápido pagando automáticamente códigos QR escaneados. Conectar URL del Servidor Rapid-Gossip-Sync Es posible que necesites reiniciar la aplicación una o dos veces para que este cambio surta efecto. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 305c13c80c..eaa3593ba6 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -622,13 +622,14 @@ Branch and Bound Selección aleatoria para privacidad Single Random Draw - Ahorra tiempo pagando facturas Lightning automáticamente. Configura un límite de cantidad y paga sin confirmaciones. + Bitkit QuickPay hace que pagar sea más rápido pagando automáticamente facturas pequeñas. PAGA\n<accent>RÁPIDAMENTE</accent> Configuración de QuickPay QuickPay hasta *Se aplica a todas las facturas Lightning, incluyendo aquellas a tus contactos. Ahorra tiempo pagando facturas Lightning automáticamente. Configura un límite de cantidad y paga sin confirmaciones. QuickPay activado + QuickPay hace que pagar sea más rápido pagando automáticamente códigos QR escaneados. Soporte ¿Necesita ayuda? Reporte su problema desde el propio Bitkit, visite el centro de ayuda, compruebe el estado o póngase en contacto con nosotros en nuestras redes sociales. Reportar Problema diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 543f22b20a..71259ef4ee 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -576,11 +576,12 @@ Réinitialiser par défaut QuickPay <accent>Sans friction</accent>\npaiements - Bitkit QuickPay accélère le passage à la caisse en payant automatiquement les QR codes lorsqu\'ils sont scannés. + Bitkit QuickPay accélère le passage à la caisse en réglant automatiquement les petites factures. Activer QuickPay Si cette option est activée, les factures numérisées d\'un montant inférieur à{amount} seront payées automatiquement sans que vous ayez besoin de confirmer ou de saisir votre code PIN*. Seuil de Quickpay * Bitkit QuickPay prend exclusivement en charge les paiements à partir de votre solde du compte courant. + QuickPay accélère le passage à la caisse en réglant automatiquement les codes QR scannés. Balayer pour masquer la balance Masquer le solde à l\'ouverture Lire le presse-papiers pour faciliter l\'utilisation diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 1d77f16f40..e0f419175d 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -665,13 +665,14 @@ Generale Impostazioni di sistema Lingua - Bitkit QuickPay rende il checkout piu\' veloce pagando automaticamente i codici QR quando scansionati. + Bitkit QuickPay rende il checkout più veloce pagando automaticamente le fatture di piccolo importo. <accent>Pagamenti</accent>\nsenza attriti QuickPay Soglia QuickPay * Bitkit QuickPay supporta esclusivamente pagamenti dal tuo Conto di Spesa. Se abilitato, le fatture scansionate inferiori a ${amount} verranno pagate automaticamente senza richiedere conferma o PIN*. Abilita QuickPay + QuickPay rende il checkout più veloce pagando automaticamente i codici QR scansionati. Connetti URL del server Rapid-Gossip-Sync Potrebbe essere necessario riavviare l\'app una o due volte affinché la modifica abbia effetto. diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 2aa6472742..20e370a60b 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -665,13 +665,14 @@ Algemeen Systeeminstellingen Taal - Bitkit QuickPay maakt afrekenen sneller door QR-codes automatisch te betalen wanneer ze worden gescand. + Bitkit QuickPay maakt afrekenen sneller door kleine facturen automatisch te betalen. <accent>Wrijvingsloze</accent>\nbetalingen QuickPay QuickPay-drempel * Bitkit QuickPay ondersteunt uitsluitend betalingen vanaf je bestedingssaldo. Indien ingeschakeld, worden gescande facturen onder ${amount} automatisch betaald zonder bevestiging of pincode*. QuickPay inschakelen + QuickPay maakt afrekenen sneller door gescande QR-codes automatisch te betalen. Verbinden Rapid-Gossip-Sync Server URL Mogelijk moet je de app een of twee keer herstarten voordat deze wijziging van kracht wordt. diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 226f005df7..f093af760a 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -574,11 +574,12 @@ Przywróć domyślne QuickPay <accent>Bezproblemowe</accent>\npłatności - Bitkit QuickPay przyspiesza płatności, automatycznie opłacając zeskanowane kody QR. + Bitkit QuickPay przyspiesza płatności, automatycznie opłacając niewielkie faktury. Włącz QuickPay Jeśli ta opcja jest włączona, zeskanowane faktury poniżej ${amount} zostaną opłacone automatycznie, bez konieczności potwierdzenia lub podania PIN-u*. Próg QuickPay * Bitkit QuickPay obsługuje wyłącznie płatności z Twojego salda wydatków. + QuickPay przyspiesza płatności, automatycznie opłacając zeskanowane kody QR. Przesuń saldo, aby ukryć Ukryj saldo po otwarciu Odczytaj schowek dla wygody użytkowania diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index cd169751af..295acdc5e6 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -665,13 +665,14 @@ Geral Configurações do sistema Idioma - O Bitkit QuickPay agiliza o check-out pagando automaticamente os códigos QR quando escaneados. + O Bitkit QuickPay agiliza o pagamento pagando automaticamente pequenas faturas. Pagamentos\n<accent>Sem atrito</accent> QuickPay Limite do Quickpay * O QuickPay suporta exclusivamente pagamentos a partir do seu saldo de gastos. Se ativado, os invoices digitalizados abaixo de ${amount} serão pagos automaticamente sem a necessidade de confirmação ou PIN*. Ativar o QuickPay + O QuickPay agiliza o pagamento pagando automaticamente códigos QR escaneados. Conectar URL do Servidor de Rapid-Gossip-Sync Pode ser necessário reiniciar o aplicativo uma ou duas vezes para que esta alteração seja aplicada. diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index dc44f1410a..66f8a378b7 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -573,11 +573,12 @@ Repor predefinições QuickPay Pagamentos\n<accent>Sem atrito</accent> - O Bitkit QuickPay agiliza o check-out pagando automaticamente os códigos QR quando escaneados. + O Bitkit QuickPay torna o pagamento mais rápido ao pagar automaticamente pequenas faturas. Ativar o QuickPay Se ativado, os invoices digitalizados abaixo de ${amount} serão pagos automaticamente sem a necessidade de confirmação ou PIN*. Limite do Quickpay * O QuickPay suporta exclusivamente pagamentos a partir do seu saldo de gastos. + O QuickPay torna o pagamento mais rápido ao pagar automaticamente códigos QR digitalizados. Arraste o saldo para ocultar Ocultar saldo ao abrir o app Ler área de transferência diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 0dfa10221d..890ed728ac 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -680,7 +680,7 @@ Основные Системные настройки Язык - Bitkit QuickPay ускоряет оплату, автоматически оплачивая QR-коды при сканировании. + Bitkit QuickPay ускоряет оплату, автоматически оплачивая небольшие счета. <accent>Платежи</accent> без трения QuickPay @@ -688,6 +688,7 @@ * Bitkit QuickPay поддерживает только платежи с вашего баланса расходов. Если включено, отсканированные счета ниже \${amount} будут оплачиваться автоматически без подтверждения или PIN-кода*. Включить QuickPay + QuickPay ускоряет оплату, автоматически оплачивая отсканированные QR-коды. Подключиться URL Сервера Rapid-Gossip-Sync Возможно, вам потребуется перезапустить приложение один или два раза, чтобы изменения вступили в силу. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3132ab4756..7ac0ae8f9f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -981,7 +981,7 @@ Rename Hardware Wallet System Settings Language - Bitkit QuickPay makes checking out faster by automatically paying QR codes when scanned. + Bitkit QuickPay makes checking out faster by automatically paying small invoices. <accent>Frictionless</accent>\npayments QuickPay Daily QuickPay limit @@ -991,6 +991,7 @@ * Bitkit QuickPay exclusively supports payments from your Spending Balance. If enabled, scanned invoices below ${amount} will be paid automatically without requiring your confirmation or PIN*. Enable QuickPay + QuickPay makes checking out faster by automatically paying scanned QR codes. Connect Rapid-Gossip-Sync Server URL You may need to restart the app once or twice for this change to take effect. diff --git a/changelog.d/next/1314.changed.md b/changelog.d/next/1314.changed.md new file mode 100644 index 0000000000..d92189b06d --- /dev/null +++ b/changelog.d/next/1314.changed.md @@ -0,0 +1 @@ +Standardized intro sheets with consistent artwork, spacing, actions, and localized messaging. diff --git a/docs/timed-sheets.md b/docs/timed-sheets.md new file mode 100644 index 0000000000..c41dbda6bb --- /dev/null +++ b/docs/timed-sheets.md @@ -0,0 +1,67 @@ +# Timed Sheets + +Timed sheets are opportunistic prompts shown from the wallet surface when a feature-specific condition is met. They are separate from the full-screen settings intro routes, even when both presentations reuse the same visual content. + +The manager checks sheets two seconds after the home screen resumes and cancels a pending check when the home screen pauses. It shows at most one eligible sheet per check, using this priority order: + +1. App update +2. Backup +3. Background payments +4. QuickPay +5. High balance + +The selected sheet is removed from the manager after it is shown. It is registered again when the app creates a new manager instance. A standard dismissal calls the selected sheet's `onDismissed()` handler before clearing it. + +## App Update + +The App Update sheet is eligible when the release service reports a newer Android build that is not marked critical. Critical updates are handled separately. + +- `Cancel` dismisses the sheet. No persisted dismissal state is written. +- `Update` opens the app's Play Store page. + +After dismissal, the sheet can be considered again after the app creates a new timed-sheet manager and the release remains newer than the installed build. + +## QuickPay + +QuickPay has two intro presentations: + +- Full-screen settings intro: opened from navigation routes such as the QuickPay suggestion. It shows a single `Continue` button. Pressing it marks `quickPayIntroSeen = true` and navigates to QuickPay settings. +- Timed sheet intro: opened by `QuickPayTimedSheet` when the intro has not been seen, QuickPay is not enabled, and the wallet has Lightning balance. It shows `Later` and `Learn More`. + +For the timed sheet: + +- `Later` marks `quickPayIntroSeen = true` and dismisses the timed sheet. The timed sheet dismissal path also writes the same value, so the sheet will not be shown again through normal app flow. +- `Learn More` marks `quickPayIntroSeen = true`, dismisses the timed sheet, and navigates to QuickPay settings. The dismissal path also writes the same value. + +Once `quickPayIntroSeen = true`, `QuickPayTimedSheet.shouldShow()` returns false. The intro can appear again only if persisted settings are reset or restored with `quickPayIntroSeen = false`. + +## Backup + +Backup uses a snooze model instead of a permanent seen flag: + +- The timed sheet is eligible when the backup is not verified, the wallet has a balance, and the last ignored timestamp is older than one day. +- `Later` dismisses the timed sheet. The timed sheet dismissal path records `backupWarningIgnoredMillis`. +- A generic timed sheet dismissal also records `backupWarningIgnoredMillis`. +- `Continue` starts the backup flow and does not immediately mark the prompt as ignored. Closing the timed backup flow through its dismissal callback records `backupWarningIgnoredMillis`. + +After the one-day ask interval passes, the Backup timed sheet can appear again if the backup is still unverified and the wallet still has a balance. + +## Background Payments + +The Background Payments timed sheet is eligible when notification permission has not been granted, the wallet has a Lightning balance, and `notificationsIgnoredMillis` is older than one week. + +- `Later` marks the background-payments intro as seen and dismisses the sheet. Dismissal records `notificationsIgnoredMillis`. +- `Enable` marks the intro as seen, dismisses the sheet, records `notificationsIgnoredMillis`, and requests notification permission. +- A generic timed sheet dismissal records `notificationsIgnoredMillis` without marking the intro as seen. + +After the one-week ask interval passes, the timed sheet can appear again if notification permission is still not granted and the wallet still has a Lightning balance. The full-screen settings intro is a separate route with only an enable action. + +## High Balance + +The High Balance sheet is eligible when the wallet balance converts to more than USD 500, fewer than three warnings have been dismissed while above the threshold, and `balanceWarningIgnoredMillis` is older than one day. + +- `Understood` dismisses the sheet. +- `Learn More` opens the configured bitcoin-storage information URL and dismisses the sheet. +- Any dismissal increments `balanceWarningTimes` and records `balanceWarningIgnoredMillis`. + +The sheet can appear at most three times while the balance remains above the threshold, with at least one day between appearances. A balance at or below the threshold resets `balanceWarningTimes` to zero.