diff --git a/app/src/main/java/to/bitkit/ui/ContentView.kt b/app/src/main/java/to/bitkit/ui/ContentView.kt index ca6f858388..9afdb12174 100644 --- a/app/src/main/java/to/bitkit/ui/ContentView.kt +++ b/app/src/main/java/to/bitkit/ui/ContentView.kt @@ -1210,7 +1210,6 @@ private fun RootNavHost( walletId = walletId, viewModel = hiltViewModel(parentEntry), onBackClick = { navController.popBackStack() }, - onLearnMoreClick = { navController.navigateTo(Routes.TransferLearnMore) }, onSent = { navController.navigateTo(Routes.SpendingHwSigned) { popUpTo { inclusive = true } @@ -1243,11 +1242,7 @@ private fun RootNavHost( ) } composableWithDefaultTransitions { - val parentEntry = remember(it) { navController.getBackStackEntry(Routes.SparkFundingNav) } - val sparkState by walletViewModel.sparkState.collectAsStateWithLifecycle() TransferLearnMoreScreen( - viewModel = hiltViewModel(parentEntry), - spendingBalanceSats = sparkState.spendingSats.toLong(), onBackClick = { navController.popBackStack() }, onContinueClick = { navController.popBackStack() }, ) diff --git a/app/src/main/java/to/bitkit/ui/components/FeeInfo.kt b/app/src/main/java/to/bitkit/ui/components/FeeInfo.kt index 1e63a3c39c..0318c2913a 100644 --- a/app/src/main/java/to/bitkit/ui/components/FeeInfo.kt +++ b/app/src/main/java/to/bitkit/ui/components/FeeInfo.kt @@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.size import androidx.compose.material3.HorizontalDivider import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import to.bitkit.ui.theme.Colors @@ -21,12 +22,13 @@ fun RowScope.FeeInfo( modifier: Modifier = Modifier, prefix: String? = null, isLoading: Boolean = false, + topPadding: Dp = 16.dp, ) { Column( modifier = modifier .fillMaxHeight() .weight(1f) - .padding(top = 16.dp) + .padding(top = topPadding) ) { Caption13Up( text = label, diff --git a/app/src/main/java/to/bitkit/ui/components/HwWalletComponents.kt b/app/src/main/java/to/bitkit/ui/components/HwWalletComponents.kt index 909f6c4762..918e4a8b33 100644 --- a/app/src/main/java/to/bitkit/ui/components/HwWalletComponents.kt +++ b/app/src/main/java/to/bitkit/ui/components/HwWalletComponents.kt @@ -31,12 +31,6 @@ import to.bitkit.ui.theme.Colors /** Illustration width as a fraction of the sheet width — the 256-wide Visual in the 375-wide Figma frame. */ internal const val HW_ILLUSTRATION_SIZE_RATIO = 256f / 375f -/** Figma top ratio for the signed check visual within the content area below navigation. */ -internal const val SIGNED_VISUAL_TOP_RATIO = (481f - 92f) / (812f - 92f - 34f) - -/** Figma top ratio for the Trezor visual within the content area below navigation. */ -internal const val SIGN_VISUAL_TOP_RATIO = (488f - 92f) / (812f - 92f - 34f) - /** Trezor illustration left bleed past the frame, as a fraction of the sheet width; keeps its screen text in view. */ private const val HW_DEVICE_TREZOR_BLEED_RATIO = 71f / 375f diff --git a/app/src/main/java/to/bitkit/ui/screens/transfer/FundingScreen.kt b/app/src/main/java/to/bitkit/ui/screens/transfer/FundingScreen.kt index dc1bb3f367..16152be678 100644 --- a/app/src/main/java/to/bitkit/ui/screens/transfer/FundingScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/transfer/FundingScreen.kt @@ -79,7 +79,6 @@ fun FundingScreen( modifier = Modifier.padding(horizontal = 16.dp), ) VerticalSpacer(24.dp) - // Spark keeps Spending fundable from savings or another wallet without a channel. if (canFundWithSpark) { FundingOption( R.string.lightning__funding__button1, @@ -88,51 +87,58 @@ fun FundingScreen( "FundTransfer", { if (hasSavings) onTransfer() else showNoFundsAlert = true }.takeIf { canFundOnChain }, ) + FundingOption( + R.string.lightning__funding__button_hw, + R.drawable.ic_device_tablet_speaker, + 16.25.dp, + "FundHardware", + onHardware.takeIf { canFundOnChain }, + ) FundingOption( R.string.lightning__funding__button2, R.drawable.ic_qr_purple, 13.75.dp, "FundReceive", - onFund + onFund, + ) + FundingOption( + R.string.lightning__funding_advanced__button2, + R.drawable.ic_pencil_full, + 13.37.dp, + "FundManual", + onManual, + ) + } else { + FundingOption( + R.string.lightning__funding_advanced__button2, + R.drawable.ic_pencil_full, + 13.37.dp, + "FundManual", + onManual, ) - } - VerticalSpacer(8.dp) - RectangleButton( - label = stringResource(R.string.lightning__funding_advanced__button2), - icon = R.drawable.ic_pencil_full, - iconTint = Colors.Purple, - iconSize = 13.37.dp, - onClick = onManual, - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 16.dp) - .testTag("FundManual") - ) - if (!canFundWithSpark) { FundingOption(R.string.lightning__funding__button1, R.drawable.ic_transfer, 20.dp, "FundTransfer") - } - FundingOption( - R.string.lightning__funding__button_hw, - R.drawable.ic_device_tablet_speaker, - 16.25.dp, - "FundHardware", - onHardware.takeIf { canFundWithSpark && canFundOnChain }, - ) - if (!canFundWithSpark) { + FundingOption( + R.string.lightning__funding__button_hw, + R.drawable.ic_device_tablet_speaker, + 16.25.dp, + "FundHardware", + ) FundingOption(R.string.lightning__funding__button2, R.drawable.ic_qr_purple, 13.75.dp, "FundReceive") } VerticalSpacer(32.dp) } - SecondaryButton( - text = stringResource(R.string.common__learn_more), - onClick = { - runCatching { context.startActivity(Intent(Intent.ACTION_VIEW, Env.BLOCKTANK_SUNSET_URL.toUri())) } - }, - modifier = Modifier - .padding(horizontal = 16.dp) - .testTag("FundLearnMore") - ) - VerticalSpacer(16.dp) + if (!canFundWithSpark) { + SecondaryButton( + text = stringResource(R.string.common__learn_more), + onClick = { + runCatching { context.startActivity(Intent(Intent.ACTION_VIEW, Env.BLOCKTANK_SUNSET_URL.toUri())) } + }, + modifier = Modifier + .padding(horizontal = 16.dp) + .testTag("FundLearnMore") + ) + VerticalSpacer(16.dp) + } if (showNoFundsAlert) { AppAlertDialog( title = stringResource(R.string.lightning__no_funds__title), diff --git a/app/src/main/java/to/bitkit/ui/screens/transfer/SettingUpScreen.kt b/app/src/main/java/to/bitkit/ui/screens/transfer/SettingUpScreen.kt index cf1e507fd6..ac54e50675 100644 --- a/app/src/main/java/to/bitkit/ui/screens/transfer/SettingUpScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/transfer/SettingUpScreen.kt @@ -128,10 +128,10 @@ internal fun Content( .fillMaxWidth() .testTag("SettingUpText") ) - VerticalSpacer(28.dp) if (isSuccess) { + VerticalSpacer(44.dp) Box( - contentAlignment = Alignment.Center, + contentAlignment = Alignment.TopCenter, modifier = Modifier .weight(1f) .fillMaxWidth() @@ -147,19 +147,20 @@ internal fun Content( ) } } else { + VerticalSpacer(32.dp) Illustration( hasCoins = frame.hasCoins, modifier = Modifier .weight(1f) .fillMaxWidth() ) - VerticalSpacer(16.dp) + VerticalSpacer(14.dp) ProgressSteps( steps = steps(frame), activeStepIndex = frame.stepIndex, modifier = Modifier.align(alignment = Alignment.CenterHorizontally) ) - VerticalSpacer(16.dp) + VerticalSpacer(32.dp) } Buttons( frame = frame, diff --git a/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingAmountScreen.kt b/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingAmountScreen.kt index 6c51e3de91..79054fb2be 100644 --- a/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingAmountScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingAmountScreen.kt @@ -15,9 +15,13 @@ import androidx.compose.material3.HorizontalDivider import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.rememberUpdatedState +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.layout.Layout import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Devices.NEXUS_5 @@ -60,6 +64,12 @@ private val PAD_ROW_HEIGHT = 78.dp /** Shortest number pad row, reached only when four 50 dp rows don't fit, as on a 640 dp tall phone. */ private val PAD_ROW_MIN_HEIGHT = 40.dp +/** Gap between the amount and the Available row; it gives way only once the pad rows are at their shortest. */ +private val AVAILABLE_ROW_GAP = 32.dp + +/** Number pad rows; the layout reserves room for at least this many rows of [PAD_ROW_MIN_HEIGHT]. */ +private const val PAD_ROWS = 4 + @Suppress("ViewModelForwarding") @Composable fun SpendingAmountScreen( @@ -177,6 +187,16 @@ private fun SpendingAmountNodeRunning( if (!uiState.isMaxLoading) amountInputViewModel.setMaxAmount(uiState.maxSats) } + // Review's fee grid switches the unit while this screen waits in the back stack, so redraw the amount in it, + // only when the unit changed: redrawing on every return would rewrite what the user typed. + var drawnDisplay by rememberSaveable { mutableStateOf(currencies.primaryDisplay) } + LaunchedEffect(currencies.primaryDisplay) { + if (currencies.primaryDisplay == drawnDisplay) return@LaunchedEffect + drawnDisplay = currencies.primaryDisplay + val sats = amountInputViewModel.uiState.value.sats + if (sats > 0) amountInputViewModel.setSats(sats, currencies) + } + Column( modifier = Modifier .padding(horizontal = 16.dp) @@ -208,55 +228,54 @@ private fun SpendingAmountNodeRunning( .testTag("${tag}NumberField") ) - Column( - verticalArrangement = Arrangement.Bottom, - modifier = Modifier.weight(1f) - ) { - Row( - verticalAlignment = Alignment.Bottom, - horizontalArrangement = Arrangement.spacedBy(8.dp), - modifier = Modifier.testTag( - if (isHardware) "HardwareTransferAmountNumberPad" else "SendAmountNumberPad" - ) - ) { - Column { - Text13Up( - text = stringResource(R.string.wallet__send_available), - color = Colors.White64, - modifier = Modifier.testTag("${tag}Available") + AvailableRowLayout(modifier = Modifier.weight(1f)) { + Column(modifier = Modifier.fillMaxWidth()) { + Row( + verticalAlignment = Alignment.Bottom, + horizontalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.testTag( + if (isHardware) "HardwareTransferAmountNumberPad" else "SendAmountNumberPad" ) - VerticalSpacer(8.dp) - MoneySSB( - sats = uiState.maxSats, - showSymbol = true, - modifier = Modifier.testTag("${tag}Unit") + ) { + Column { + Text13Up( + text = stringResource(R.string.wallet__send_available), + color = Colors.White64, + modifier = Modifier.testTag("${tag}Available") + ) + VerticalSpacer(4.dp) + MoneySSB( + sats = uiState.maxSats, + showSymbol = true, + modifier = Modifier.testTag("${tag}Unit") + ) + } + FillWidth() + UnitButton( + color = Colors.Purple, + onClick = { amountInputViewModel.switchUnit(currencies) }, + modifier = Modifier.testTag( + if (isHardware) "HardwareTransferAmountUnitButton" else "SpendingNumberPadUnit" + ) ) - } - FillWidth() - UnitButton( - color = Colors.Purple, - onClick = { amountInputViewModel.switchUnit(currencies) }, - modifier = Modifier.testTag( - if (isHardware) "HardwareTransferAmountUnitButton" else "SpendingNumberPadUnit" + NumberPadActionButton( + text = stringResource(R.string.lightning__spending_amount__quarter), + color = Colors.Purple, + enabled = isReady && hasFunds, + onClick = onClickQuarter, + modifier = Modifier.testTag("${tag}Quarter") ) - ) - NumberPadActionButton( - text = stringResource(R.string.lightning__spending_amount__quarter), - color = Colors.Purple, - enabled = isReady && hasFunds, - onClick = onClickQuarter, - modifier = Modifier.testTag("${tag}Quarter") - ) - NumberPadActionButton( - text = stringResource(R.string.common__max), - color = Colors.Purple, - enabled = isReady && hasFunds, - onClick = onClickMaxAmount, - modifier = Modifier.testTag("${tag}Max") - ) - } + NumberPadActionButton( + text = stringResource(R.string.common__max), + color = Colors.Purple, + enabled = isReady && hasFunds, + onClick = onClickMaxAmount, + modifier = Modifier.testTag("${tag}Max") + ) + } - HorizontalDivider(modifier = Modifier.padding(top = 12.dp)) + HorizontalDivider(modifier = Modifier.padding(top = 16.dp)) + } NumberPad( viewModel = amountInputViewModel, @@ -264,18 +283,45 @@ private fun SpendingAmountNodeRunning( enabled = isReady && hasFunds, idealRowHeight = PAD_ROW_HEIGHT, minRowHeight = PAD_ROW_MIN_HEIGHT, - modifier = Modifier.weight(1f, fill = false) + modifier = Modifier.fillMaxWidth() ) - PrimaryButton( - text = stringResource(R.string.common__continue), - onClick = onConfirmAmount, - enabled = isReady && amountUiState.sats > 0 && amountUiState.sats <= uiState.maxSats, - isLoading = uiState.isLoading, - modifier = Modifier.testTag("${tag}Continue") - ) + Column(modifier = Modifier.fillMaxWidth()) { + PrimaryButton( + text = stringResource(R.string.common__continue), + onClick = onConfirmAmount, + enabled = isReady && amountUiState.sats > 0 && amountUiState.sats <= uiState.maxSats, + isLoading = uiState.isLoading, + modifier = Modifier.testTag("${tag}Continue") + ) + VerticalSpacer(16.dp) + } + } + } +} - VerticalSpacer(16.dp) +/** + * Lays out the Available row, the number pad and Continue: the row [AVAILABLE_ROW_GAP] under the amount, the pad and + * Continue pinned to the bottom. The pad rows shrink first; the gap gives way only once they are at their shortest. + */ +@Composable +private fun AvailableRowLayout( + modifier: Modifier = Modifier, + content: @Composable () -> Unit, +) { + Layout(content = content, modifier = modifier) { measurables, constraints -> + val (rowMeasurable, padMeasurable, footerMeasurable) = measurables + val loose = constraints.copy(minHeight = 0) + val row = rowMeasurable.measure(loose) + val footer = footerMeasurable.measure(loose) + val gap = AVAILABLE_ROW_GAP.roundToPx() + val room = (constraints.maxHeight - row.height - footer.height).coerceAtLeast(0) + val minPad = (PAD_ROW_MIN_HEIGHT * PAD_ROWS).roundToPx().coerceAtMost(room) + val pad = padMeasurable.measure(loose.copy(maxHeight = (room - gap).coerceAtLeast(minPad))) + layout(constraints.maxWidth, constraints.maxHeight) { + row.place(0, gap.coerceAtMost(room - pad.height)) + footer.place(0, constraints.maxHeight - footer.height) + pad.place(0, constraints.maxHeight - footer.height - pad.height) } } } diff --git a/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingConfirmScreen.kt b/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingConfirmScreen.kt index f47aa68a52..ca7f1c0353 100644 --- a/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingConfirmScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingConfirmScreen.kt @@ -5,8 +5,6 @@ import androidx.annotation.DrawableRes import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut -import androidx.compose.foundation.Image -import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.BoxWithConstraints @@ -28,36 +26,36 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableFloatStateOf -import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.graphicsLayer -import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.draw.alpha import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.selected +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Devices.NEXUS_5 import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import to.bitkit.R import to.bitkit.repositories.OnchainSendAttempt import to.bitkit.repositories.SparkClaimSpeed -import to.bitkit.ui.LocalCurrencies import to.bitkit.ui.components.BodyMSB import to.bitkit.ui.components.BodySSB import to.bitkit.ui.components.ButtonSize +import to.bitkit.ui.components.Caption13Up import to.bitkit.ui.components.ConnectionIssuesView import to.bitkit.ui.components.Display import to.bitkit.ui.components.FeeInfo import to.bitkit.ui.components.HorizontalSpacer import to.bitkit.ui.components.MoneyMSB -import to.bitkit.ui.components.MoneySSB import to.bitkit.ui.components.PrimaryButton import to.bitkit.ui.components.SwipeToConfirm import to.bitkit.ui.components.VerticalSpacer +import to.bitkit.ui.currencyViewModel import to.bitkit.ui.scaffold.AppTopBar import to.bitkit.ui.scaffold.DrawerNavIcon import to.bitkit.ui.scaffold.ScreenColumn @@ -65,11 +63,13 @@ import to.bitkit.ui.screens.transfer.SparkFundingContract.Quote import to.bitkit.ui.screens.transfer.SparkFundingContract.SideEffect import to.bitkit.ui.screens.transfer.SparkFundingContract.UiState import to.bitkit.ui.shared.modifiers.clickableAlpha +import to.bitkit.ui.theme.AppTextStyles import to.bitkit.ui.theme.AppThemeSurface import to.bitkit.ui.theme.Colors import to.bitkit.ui.utils.withAccent -private const val SWIPE_ROTATION_DEGREES = 14f +/** Gap above each fee grid row after the first, as the Review frame draws it. */ +private val FEE_GRID_ROW_GAP = 24.dp @Composable fun SpendingConfirmScreen( @@ -81,6 +81,7 @@ fun SpendingConfirmScreen( onFundingPending: (OnchainSendAttempt) -> Unit = {}, ) { val state by viewModel.uiState.collectAsStateWithLifecycle() + val currency = currencyViewModel BackHandler(enabled = state.isSending) {} @@ -104,6 +105,7 @@ fun SpendingConfirmScreen( onBackClick = { if (!state.isSending) onBackClick() }, onLearnMoreClick = { if (!state.isSending) onLearnMoreClick() }, onSpeedChange = viewModel::onSpeedChange, + onFeesClick = { currency?.switchUnit() }, onConfirm = viewModel::onConfirm, ) AnimatedVisibility( @@ -125,9 +127,9 @@ private fun Content( onBackClick: () -> Unit = {}, onLearnMoreClick: () -> Unit = {}, onSpeedChange: (SparkClaimSpeed) -> Unit = {}, + onFeesClick: () -> Unit = {}, onConfirm: () -> Unit = {}, ) { - val swipeProgress = remember { mutableFloatStateOf(0f) } val quote = state.quote ScreenColumn { @@ -159,13 +161,13 @@ private fun Content( ) VerticalSpacer(8.dp) - SpendingFeeGrid(quote = quote, speed = state.speed) + SpendingFeeGrid(quote = quote, speed = state.speed, onClick = onFeesClick) - VerticalSpacer(16.dp) + VerticalSpacer(24.dp) SpendingSpeedRows(quote = quote, speed = state.speed, onSpeedChange = onSpeedChange) - VerticalSpacer(16.dp) + VerticalSpacer(24.dp) PrimaryButton( text = stringResource(R.string.common__learn_more), @@ -174,22 +176,7 @@ private fun Content( onClick = onLearnMoreClick, modifier = Modifier.testTag("SpendingConfirmMore") ) - - Box( - contentAlignment = Alignment.Center, - modifier = Modifier - .fillMaxWidth() - .weight(1f) - ) { - Image( - painter = painterResource(id = R.drawable.coin_stack_x), - contentDescription = null, - contentScale = ContentScale.Fit, - modifier = Modifier - .padding(horizontal = 44.dp, vertical = 8.dp) - .graphicsLayer { rotationZ = swipeProgress.floatValue * SWIPE_ROTATION_DEGREES } - ) - } + VerticalSpacer(16.dp) } } @@ -200,7 +187,6 @@ private fun Content( confirmed = state.isSending, enabled = canConfirm, color = Colors.Purple, - progress = swipeProgress, onConfirm = { if (canConfirm) onConfirm() }, ) VerticalSpacer(16.dp) @@ -209,13 +195,24 @@ private fun Content( } /** - * The four fee tiles of a transfer to spending, at the selected claim [speed]. The claim fee is an estimate at either - * speed, so the tiles that come from it, Spending fee and To spending, show `±`; Network fees and Total are exact. + * The four fee tiles of a transfer to spending, at the selected claim [speed], plus the deposit [address] a hardware + * wallet confirms on the device, with [rowGap] above each row after the first. With [onClick], a tap anywhere on the + * grid switches the amounts between bitcoin and fiat. */ @Composable -internal fun SpendingFeeGrid(quote: Quote?, speed: SparkClaimSpeed, modifier: Modifier = Modifier) { - Column(modifier = modifier) { - val estimatePrefix = stringResource(R.string.lightning__spending_confirm__about) +internal fun SpendingFeeGrid( + quote: Quote?, + speed: SparkClaimSpeed, + modifier: Modifier = Modifier, + address: String? = null, + rowGap: Dp = FEE_GRID_ROW_GAP, + onClick: (() -> Unit)? = null, +) { + Column( + modifier = modifier + .clickableAlpha(onClick = onClick) + .testTag("SpendingConfirmFees") + ) { Row( horizontalArrangement = Arrangement.spacedBy(16.dp), modifier = Modifier.height(IntrinsicSize.Min) @@ -226,10 +223,9 @@ internal fun SpendingFeeGrid(quote: Quote?, speed: SparkClaimSpeed, modifier: Mo modifier = Modifier.testTag("SpendingConfirmNetworkFee") ) FeeInfo( - label = stringResource(R.string.lightning__spending_confirm__spending_fee), + label = stringResource(R.string.lightning__spending_confirm__lsp_fee), amount = quote?.claimFeeSats(speed) ?: 0, - prefix = estimatePrefix, - modifier = Modifier.testTag("SpendingConfirmSpendingFee") + modifier = Modifier.testTag("SpendingConfirmServiceFee") ) } Row( @@ -239,19 +235,38 @@ internal fun SpendingFeeGrid(quote: Quote?, speed: SparkClaimSpeed, modifier: Mo FeeInfo( label = stringResource(R.string.lightning__spending_confirm__amount), amount = quote?.toSpendingSats(speed) ?: 0, - prefix = estimatePrefix, + topPadding = rowGap, modifier = Modifier.testTag("SpendingConfirmAmount") ) FeeInfo( label = stringResource(R.string.lightning__spending_confirm__total), amount = quote?.totalSats ?: 0, + topPadding = rowGap, modifier = Modifier.testTag("SpendingConfirmTotal") ) } + if (address != null) { + Column( + modifier = Modifier + .padding(top = rowGap) + .testTag("SpendingConfirmAddress") + ) { + Caption13Up(text = stringResource(R.string.lightning__transfer_hw__address), color = Colors.White64) + VerticalSpacer(8.dp) + BodySSB( + text = address, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + style = AppTextStyles.BodySSB.copy(fontFeatureSettings = NO_CONTEXTUAL_ALTERNATES), + ) + VerticalSpacer(16.dp) + HorizontalDivider() + } + } } } -/** The Instant and Later rows a transfer to spending picks its claim speed with. */ +/** The Fast and Normal rows a transfer to spending picks its claim speed with. */ @Composable internal fun SpendingSpeedRows( quote: Quote?, @@ -261,23 +276,22 @@ internal fun SpendingSpeedRows( ) { Column(modifier = modifier) { SpeedItem( - title = stringResource(R.string.fee__instant__title), + title = stringResource(R.string.fee__fast__title), description = stringResource(R.string.lightning__spending_confirm__instant_text), - feePrefix = stringResource(R.string.lightning__spending_confirm__about), feeSats = quote?.instantFeeSats, + feeCaption = stringResource(R.string.lightning__spending_confirm__fee_max), icon = R.drawable.ic_speed_fast, - iconColor = Colors.Purple, isSelected = speed == SparkClaimSpeed.Instant, onClick = { onSpeedChange(SparkClaimSpeed.Instant) }, modifier = Modifier.testTag("SpendingConfirmInstant") ) + HorizontalDivider() SpeedItem( - title = stringResource(R.string.common__later), - description = stringResource(R.string.lightning__spending_confirm__later_text), - feePrefix = stringResource(R.string.lightning__spending_confirm__about), + title = stringResource(R.string.fee__normal__title), + description = stringResource(R.string.lightning__spending_confirm__normal_text), feeSats = quote?.laterFeeSats, - icon = R.drawable.ic_speed_normal, - iconColor = Colors.Purple, + feeCaption = stringResource(R.string.lightning__spending_confirm__fee_est), + icon = R.drawable.ic_clock, isSelected = speed == SparkClaimSpeed.Later, onClick = { onSpeedChange(SparkClaimSpeed.Later) }, modifier = Modifier.testTag("SpendingConfirmLater") @@ -289,50 +303,47 @@ internal fun SpendingSpeedRows( private fun SpeedItem( title: String, description: String, - feePrefix: String, feeSats: Long?, + feeCaption: String, @DrawableRes icon: Int, - iconColor: Color, isSelected: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier, ) { - Column(modifier = modifier.clickableAlpha(onClick = onClick)) { - Row( - verticalAlignment = Alignment.CenterVertically, - modifier = Modifier - .then(if (isSelected) Modifier.background(Colors.White06) else Modifier) - .padding(horizontal = 16.dp) - .heightIn(min = 72.dp) - .padding(vertical = 8.dp) - ) { - Icon( - painter = painterResource(icon), - contentDescription = null, - tint = iconColor, - modifier = Modifier.size(32.dp), - ) - HorizontalSpacer(16.dp) - // The text wraps, so the fee keeps its lines at the end of the row. - Column(modifier = Modifier.weight(1f)) { - BodyMSB(title, color = MaterialTheme.colorScheme.primary) - BodySSB(description, color = MaterialTheme.colorScheme.secondary) - } - if (feeSats != null) { - HorizontalSpacer(8.dp) - Column(horizontalAlignment = Alignment.End) { - Row { - BodyMSB("$feePrefix ", color = Colors.White64) - MoneyMSB(sats = feeSats, showSymbol = true) - } - Row { - BodySSB("$feePrefix ", color = Colors.White64) - MoneySSB(sats = feeSats, unit = LocalCurrencies.current.primaryDisplay.not(), showSymbol = true) - } - } + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = modifier + .clickableAlpha(onClick = onClick) + .semantics { selected = isSelected } + .padding(vertical = 16.dp) + ) { + Icon( + painter = painterResource(icon), + contentDescription = null, + tint = Colors.Purple, + modifier = Modifier.size(32.dp), + ) + HorizontalSpacer(16.dp) + Column(modifier = Modifier.weight(1f)) { + BodyMSB(title, color = MaterialTheme.colorScheme.primary) + BodySSB(description, color = MaterialTheme.colorScheme.secondary) + } + if (feeSats != null) { + HorizontalSpacer(12.dp) + Column(horizontalAlignment = Alignment.End) { + MoneyMSB(sats = feeSats, showSymbol = true) + BodySSB(feeCaption, color = Colors.White64) } } - HorizontalDivider() + HorizontalSpacer(12.dp) + Icon( + painter = painterResource(R.drawable.ic_checkmark), + contentDescription = null, + tint = Colors.Purple, + modifier = Modifier + .size(22.dp) + .alpha(if (isSelected) 1f else 0f) + ) } } @@ -345,17 +356,17 @@ private val previewQuote = Quote( spendableSats = 158_234, ) -@Preview(showSystemUi = true, showBackground = true, name = "Instant") +@Preview(showSystemUi = true, showBackground = true, name = "Fast") @Composable -private fun PreviewInstant() { +private fun PreviewFast() { AppThemeSurface { Content(state = UiState(amountSats = 50_000, quote = previewQuote)) } } -@Preview(showSystemUi = true, showBackground = true, name = "Later") +@Preview(showSystemUi = true, showBackground = true, name = "Normal") @Composable -private fun PreviewLater() { +private fun PreviewNormal() { AppThemeSurface { Content(state = UiState(amountSats = 50_000, quote = previewQuote, speed = SparkClaimSpeed.Later)) } @@ -376,3 +387,6 @@ private fun PreviewSmall() { Content(state = UiState(amountSats = 50_000, quote = previewQuote)) } } + +/** Keeps the font from drawing an "x" between digits as "×", so an address reads exactly as the device shows it. */ +private const val NO_CONTEXTUAL_ALTERNATES = "calt 0" diff --git a/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingIntroScreen.kt b/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingIntroScreen.kt index 7a94031b47..9b12453b15 100644 --- a/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingIntroScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/transfer/SpendingIntroScreen.kt @@ -53,7 +53,7 @@ fun SpendingIntroScreen( Column( modifier = Modifier .fillMaxWidth() - .padding(horizontal = 32.dp) + .padding(horizontal = 16.dp) .align(Alignment.BottomCenter) ) { Display(stringResource(R.string.lightning__spending_intro__title).withAccent(accentColor = Colors.Purple)) diff --git a/app/src/main/java/to/bitkit/ui/screens/transfer/TransferIntroScreen.kt b/app/src/main/java/to/bitkit/ui/screens/transfer/TransferIntroScreen.kt index 45192970ba..f2a370487e 100644 --- a/app/src/main/java/to/bitkit/ui/screens/transfer/TransferIntroScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/transfer/TransferIntroScreen.kt @@ -51,19 +51,19 @@ fun TransferIntroScreen( .fillMaxWidth() ) AppTopBar( - titleText = null, + titleText = stringResource(R.string.lightning__funding__nav_title), onBackClick = onBackClick, actions = { DrawerNavIcon() }, ) Column( modifier = Modifier .fillMaxWidth() - .padding(horizontal = 32.dp) + .padding(horizontal = 16.dp) .align(Alignment.BottomCenter) ) { Display(stringResource(R.string.lightning__transfer_intro__title).withAccent(accentColor = Colors.Purple)) Spacer(modifier = Modifier.height(8.dp)) - BodyM(stringResource(R.string.lightning__transfer_intro__text), color = Colors.White64) + BodyM(stringResource(R.string.lightning__transfer_intro__text_spark), color = Colors.White64) Spacer(modifier = Modifier.height(32.dp)) PrimaryButton( diff --git a/app/src/main/java/to/bitkit/ui/screens/transfer/TransferLearnMoreScreen.kt b/app/src/main/java/to/bitkit/ui/screens/transfer/TransferLearnMoreScreen.kt index bba6afc6fe..9ac94101be 100644 --- a/app/src/main/java/to/bitkit/ui/screens/transfer/TransferLearnMoreScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/transfer/TransferLearnMoreScreen.kt @@ -6,20 +6,16 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll 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.stringResource import androidx.compose.ui.tooling.preview.Devices.NEXUS_5 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.ui.components.BodyM import to.bitkit.ui.components.BodyMB -import to.bitkit.ui.components.ChannelStatusUi import to.bitkit.ui.components.Display -import to.bitkit.ui.components.LightningChannel import to.bitkit.ui.components.PrimaryButton import to.bitkit.ui.components.VerticalSpacer import to.bitkit.ui.scaffold.AppTopBar @@ -29,29 +25,11 @@ import to.bitkit.ui.theme.AppThemeSurface import to.bitkit.ui.theme.Colors import to.bitkit.ui.utils.withAccent -/** Explains Instant and Later, and shows the spending balance this transfer leads to. */ +/** Explains the Fast and Later transfer speeds and who operates the spending balance. */ @Composable fun TransferLearnMoreScreen( - viewModel: SparkFundingViewModel, - spendingBalanceSats: Long, onContinueClick: () -> Unit = {}, onBackClick: () -> Unit = {}, -) { - val state by viewModel.uiState.collectAsStateWithLifecycle() - val toSpending = state.quote?.toSpendingSats(state.speed) ?: 0 - - Content( - balanceSats = spendingBalanceSats + toSpending, - onBackClick = onBackClick, - onContinueClick = onContinueClick, - ) -} - -@Composable -private fun Content( - balanceSats: Long, - onBackClick: () -> Unit = {}, - onContinueClick: () -> Unit = {}, ) { ScreenColumn { AppTopBar( @@ -72,33 +50,28 @@ private fun Content( .withAccent(accentColor = Colors.Purple) ) VerticalSpacer(8.dp) - BodyM(text = stringResource(R.string.lightning__spending_learn_more__text), color = Colors.White64) - VerticalSpacer(16.dp) - BodyM(text = stringResource(R.string.lightning__spark_trust), color = Colors.White64) + BodyMB(text = stringResource(R.string.fee__fast__title)) + BodyM(text = stringResource(R.string.lightning__spark_learn__fast_text), color = Colors.White64) + VerticalSpacer(22.dp) + BodyMB(text = stringResource(R.string.common__later)) + BodyM(text = stringResource(R.string.lightning__spark_learn__later_text), color = Colors.White64) VerticalSpacer(32.dp) - } - Column(modifier = Modifier.padding(horizontal = 16.dp)) { - BodyMB(text = stringResource(R.string.lightning__spending_label)) - VerticalSpacer(16.dp) - - LightningChannel( - capacity = balanceSats, - localBalance = balanceSats, - remoteBalance = 0L, - status = ChannelStatusUi.OPEN, - showLabels = true, - showReceiving = false, - modifier = Modifier.testTag("TransferLearnMoreBalance") + Display( + text = stringResource(R.string.lightning__spark_learn__about_title) + .withAccent(accentColor = Colors.Purple) ) - + VerticalSpacer(8.dp) + BodyM(text = stringResource(R.string.lightning__spark_learn__about_text), color = Colors.White64) VerticalSpacer(32.dp) - PrimaryButton( - text = stringResource(R.string.common__understood), - onClick = onContinueClick, - modifier = Modifier.testTag("LiquidityContinue") - ) - VerticalSpacer(16.dp) } + PrimaryButton( + text = stringResource(R.string.common__understood), + onClick = onContinueClick, + modifier = Modifier + .padding(horizontal = 16.dp) + .testTag("LiquidityContinue") + ) + VerticalSpacer(16.dp) } } @@ -107,6 +80,6 @@ private fun Content( @Composable private fun Preview() { AppThemeSurface { - Content(balanceSats = 48_650L) + TransferLearnMoreScreen() } } diff --git a/app/src/main/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignScreen.kt b/app/src/main/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignScreen.kt index 0cce2e0f49..b0a607b5d0 100644 --- a/app/src/main/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignScreen.kt @@ -7,25 +7,36 @@ import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.Column 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.offset import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.requiredSize import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableFloatStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.drawBehind +import androidx.compose.ui.graphics.Brush +import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.layout.onGloballyPositioned +import androidx.compose.ui.layout.positionInRoot import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Devices.NEXUS_5 import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.dp import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle @@ -37,6 +48,7 @@ import to.bitkit.ui.components.Display import to.bitkit.ui.components.PrimaryButton import to.bitkit.ui.components.VerticalSpacer import to.bitkit.ui.components.illustrationRes +import to.bitkit.ui.currencyViewModel import to.bitkit.ui.scaffold.AppTopBar import to.bitkit.ui.scaffold.DrawerNavIcon import to.bitkit.ui.scaffold.ScreenColumn @@ -51,13 +63,13 @@ import to.bitkit.ui.screens.wallets.send.HwSendViewModel import to.bitkit.ui.theme.AppThemeSurface import to.bitkit.ui.theme.Colors import to.bitkit.ui.utils.withAccent +import kotlin.math.roundToInt @Composable fun SpendingHwSignScreen( walletId: String, viewModel: SparkFundingViewModel, onBackClick: () -> Unit, - onLearnMoreClick: () -> Unit, onSent: () -> Unit, hwSendViewModel: HwSendViewModel = hiltViewModel(), ) { @@ -69,6 +81,7 @@ fun SpendingHwSignScreen( } var request by remember { mutableStateOf(null) } val isBusy = state.isSending || hwState.isSigning + val currency = currencyViewModel BackHandler(enabled = !hwState.canLeave || state.isSending) {} @@ -109,8 +122,8 @@ fun SpendingHwSignScreen( isSigning = isBusy, hasPendingBroadcast = hwState.hasPendingBroadcast, onBackClick = { if (hwState.canLeave && !state.isSending) onBackClick() }, - onLearnMoreClick = { if (!isBusy) onLearnMoreClick() }, onSpeedChange = { if (!isBusy) viewModel.onSpeedChange(it) }, + onFeesClick = { currency?.switchUnit() }, onOpenConnect = { // A pending broadcast resumes only for the exact request it was signed for. val pending = request?.takeIf { hwState.hasPendingBroadcast } @@ -140,97 +153,142 @@ private fun Content( isSigning: Boolean = false, hasPendingBroadcast: Boolean = false, onBackClick: () -> Unit = {}, - onLearnMoreClick: () -> Unit = {}, onSpeedChange: (SparkClaimSpeed) -> Unit = {}, + onFeesClick: () -> Unit = {}, onOpenConnect: () -> Unit = {}, ) { val quote = state.quote + val background = MaterialTheme.colorScheme.background + var viewportBottom by remember { mutableFloatStateOf(0f) } + var contentBottom by remember { mutableFloatStateOf(0f) } ScreenColumn { AppTopBar( titleText = stringResource(R.string.lightning__transfer__nav_title), onBackClick = onBackClick, actions = { if (!isSigning) DrawerNavIcon() }, ) - Column( - modifier = Modifier - .padding(horizontal = 16.dp) - .fillMaxSize() - .testTag("HardwareTransferSign") - ) { - BoxWithConstraints( + Box(modifier = Modifier.fillMaxSize()) { + Image( + painter = painterResource(id = vendor.signIllustrationRes()), + contentDescription = null, + contentScale = ContentScale.Fit, modifier = Modifier - .weight(1f) + .align(Alignment.BottomCenter) + .offset(y = ILLUSTRATION_OVERFLOW) + .offset { IntOffset(0, (contentBottom - viewportBottom).coerceAtLeast(0f).roundToInt()) } + .requiredSize(ILLUSTRATION_SIZE) + ) + Box( + modifier = Modifier + .align(Alignment.BottomCenter) + .offset(y = ILLUSTRATION_OVERFLOW) .fillMaxWidth() + .height(FOOTER_HEIGHT + ILLUSTRATION_OVERFLOW) + .drawBehind { + drawRect( + Brush.verticalGradient( + colors = listOf(Color.Transparent, background), + endY = FOOTER_FADE.toPx(), + ) + ) + } + ) + Column( + modifier = Modifier + .padding(horizontal = 16.dp) + .fillMaxSize() + .testTag("HardwareTransferSign") ) { - Column( + BoxWithConstraints( modifier = Modifier + .weight(1f) .fillMaxWidth() - .verticalScroll(rememberScrollState()) - .heightIn(min = maxHeight) + .onGloballyPositioned { viewportBottom = it.positionInRoot().y + it.size.height } ) { - VerticalSpacer(32.dp) - Display( - text = stringResource( - if (hasPendingBroadcast) { - R.string.lightning__transfer_hw__signed_title - } else { - R.string.lightning__transfer_hw__sign_title - } - ).withAccent(accentColor = Colors.Purple), - modifier = Modifier.fillMaxWidth() - ) - VerticalSpacer(8.dp) - - SpendingFeeGrid(quote = quote, speed = state.speed) - - VerticalSpacer(16.dp) - - SpendingSpeedRows(quote = quote, speed = state.speed, onSpeedChange = onSpeedChange) - - VerticalSpacer(16.dp) - - PrimaryButton( - text = stringResource(R.string.common__learn_more), - size = ButtonSize.Small, - fullWidth = false, - enabled = !isSigning && !hasPendingBroadcast, - onClick = onLearnMoreClick, - modifier = Modifier.testTag("HardwareTransferSignLearnMore") - ) - - Box( - contentAlignment = Alignment.Center, + Column( modifier = Modifier .fillMaxWidth() - .weight(1f) + .verticalScroll(rememberScrollState()) + .heightIn(min = maxHeight) + .onGloballyPositioned { contentBottom = it.positionInRoot().y + it.size.height } ) { - Image( - painter = painterResource(id = vendor.illustrationRes()), - contentDescription = null, - contentScale = ContentScale.Fit, - modifier = Modifier.padding(vertical = 8.dp) + VerticalSpacer(32.dp) + Display( + text = stringResource( + if (hasPendingBroadcast) { + R.string.lightning__transfer_hw__signed_title + } else { + R.string.lightning__transfer_hw__sign_title + } + ).withAccent(accentColor = Colors.Purple), + modifier = Modifier.fillMaxWidth() ) + VerticalSpacer(16.dp) + + SpendingFeeGrid( + quote = quote, + speed = state.speed, + address = quote?.address, + onClick = onFeesClick, + rowGap = 10.dp, + ) + + VerticalSpacer(10.dp) + + SpendingSpeedRows(quote = quote, speed = state.speed, onSpeedChange = onSpeedChange) + + VerticalSpacer(ILLUSTRATION_GAP + ILLUSTRATION_PEEK) } } - } - val canSign = quote != null && quote.toSpendingSats(state.speed) > 0 && !state.isQuoting - PrimaryButton( - text = stringResource( - if (hasPendingBroadcast) R.string.common__retry else R.string.lightning__transfer_hw__open_connect - ), - onClick = onOpenConnect, - enabled = canSign && !isSigning, - isLoading = isSigning || state.isQuoting, - modifier = Modifier.testTag("HardwareTransferOpenTrezorConnect") - ) - VerticalSpacer(16.dp) + val canSign = quote != null && quote.toSpendingSats(state.speed) > 0 && !state.isQuoting + PrimaryButton( + text = stringResource( + if (hasPendingBroadcast) { + R.string.common__retry + } else { + R.string.lightning__transfer_hw__open_connect + } + ), + onClick = onOpenConnect, + enabled = canSign && !isSigning, + isLoading = isSigning || state.isQuoting, + modifier = Modifier.testTag("HardwareTransferOpenTrezorConnect") + ) + VerticalSpacer(FOOTER_BOTTOM) + } } } } +/** Side of the angled device render: the 266dp image fill of the frame's 254dp illustration box. */ +private val ILLUSTRATION_SIZE = 266.dp + +/** How far the render's top sits above the button's top (the box 100dp above it, the fill 3dp above the box). */ +private val ILLUSTRATION_PEEK = 103.dp + +/** Gap the frame keeps between the speed rows and the illustration box. */ +private val ILLUSTRATION_GAP = 29.dp + +/** Space under the sign button. */ +private val FOOTER_BOTTOM = 16.dp + +/** Height from the sign button's top to the content bottom. */ +private val FOOTER_HEIGHT = ButtonSize.Large.height + FOOTER_BOTTOM + +/** How far the render runs below the content bottom, behind the button and the system bar. */ +private val ILLUSTRATION_OVERFLOW = ILLUSTRATION_SIZE - ILLUSTRATION_PEEK - FOOTER_HEIGHT + +/** Height over which the frame's footer fades from transparent to the background, from the button's top. */ +private val FOOTER_FADE = 87.dp + +private fun HwWalletVendor.signIllustrationRes(): Int = when (this) { + HwWalletVendor.TREZOR -> R.drawable.trezor_angled + HwWalletVendor.BLOCKSTREAM -> illustrationRes() +} + private val previewQuote = Quote( - address = "bcrt1q", + address = "bcrt1q5pz8luhp0c7khjr27m2ct55qyr5s985fey9xh3c4kq0p7rnvzd3s2fz2tq", amountSats = 50_000, networkFeeSats = 1_141, instantFeeSats = 1_350, diff --git a/app/src/main/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignedScreen.kt b/app/src/main/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignedScreen.kt index 5ef98966a4..57dab2de57 100644 --- a/app/src/main/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignedScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignedScreen.kt @@ -1,15 +1,21 @@ package to.bitkit.ui.screens.transfer.hardware -import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue +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.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -17,8 +23,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import kotlinx.coroutines.delay import to.bitkit.R import to.bitkit.ui.components.Display -import to.bitkit.ui.components.HardwareTransferIllustration -import to.bitkit.ui.components.SIGNED_VISUAL_TOP_RATIO +import to.bitkit.ui.components.HW_ILLUSTRATION_SIZE_RATIO import to.bitkit.ui.components.VerticalSpacer import to.bitkit.ui.scaffold.AppTopBar import to.bitkit.ui.scaffold.DrawerNavIcon @@ -29,12 +34,16 @@ import to.bitkit.ui.screens.transfer.SparkFundingViewModel import to.bitkit.ui.screens.transfer.SpendingFeeGrid import to.bitkit.ui.theme.AppThemeSurface import to.bitkit.ui.theme.Colors +import to.bitkit.ui.utils.screenWidth import to.bitkit.ui.utils.withAccent import kotlin.time.Duration.Companion.seconds /** How long the signed confirmation shows before the transfer's progress takes over. */ private val SIGNED_AUTO_NAV_DELAY = 1.seconds +/** Gap above the signed screen's second fee row, as the Transaction signed frame draws it. */ +private val SIGNED_FEE_ROW_GAP = 12.dp + @Composable fun SpendingHwSignedScreen( viewModel: SparkFundingViewModel, @@ -55,7 +64,7 @@ fun SpendingHwSignedScreen( } @Composable -private fun Content( +internal fun Content( state: UiState, onBackClick: () -> Unit = {}, ) { @@ -65,28 +74,33 @@ private fun Content( onBackClick = onBackClick, actions = { DrawerNavIcon() }, ) - Box(modifier = Modifier.fillMaxSize()) { - HardwareTransferIllustration( - drawableRes = R.drawable.check, - topRatio = SIGNED_VISUAL_TOP_RATIO, + Column( + horizontalAlignment = Alignment.CenterHorizontally, + modifier = Modifier + .padding(horizontal = 16.dp) + .fillMaxSize() + .verticalScroll(rememberScrollState()) + .testTag("HardwareTransferSigned") + ) { + VerticalSpacer(32.dp) + Display( + text = stringResource(R.string.lightning__transfer_hw__signed_title) + .withAccent(accentColor = Colors.Purple), + modifier = Modifier.fillMaxWidth() ) + VerticalSpacer(8.dp) - Column( - modifier = Modifier - .padding(horizontal = 16.dp) - .fillMaxSize() - .testTag("HardwareTransferSigned") - ) { - VerticalSpacer(32.dp) - Display( - text = stringResource(R.string.lightning__transfer_hw__signed_title) - .withAccent(accentColor = Colors.Purple), - modifier = Modifier.fillMaxWidth() - ) - VerticalSpacer(16.dp) + SpendingFeeGrid(quote = state.quote, speed = state.speed, rowGap = SIGNED_FEE_ROW_GAP) - SpendingFeeGrid(quote = state.quote, speed = state.speed) - } + VerticalSpacer(32.dp) + Image( + painter = painterResource(id = R.drawable.check), + contentDescription = null, + contentScale = ContentScale.Fit, + modifier = Modifier + .size(screenWidth() * HW_ILLUSTRATION_SIZE_RATIO) + .testTag("HardwareTransferSignedCheck") + ) } } } diff --git a/app/src/main/java/to/bitkit/ui/screens/wallets/SpendingWalletScreen.kt b/app/src/main/java/to/bitkit/ui/screens/wallets/SpendingWalletScreen.kt index ff7bd6ce69..cfe9f4abfe 100644 --- a/app/src/main/java/to/bitkit/ui/screens/wallets/SpendingWalletScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/wallets/SpendingWalletScreen.kt @@ -162,7 +162,7 @@ fun SpendingWalletScreen( item { SecondaryButton( onClick = onTransferFromSavingsClick, - text = stringResource(R.string.lightning__funding__button1), + text = stringResource(R.string.lightning__transfer_from_savings_button), icon = { Icon( painter = painterResource(R.drawable.ic_transfer), diff --git a/app/src/main/res/drawable-nodpi/trezor_angled.webp b/app/src/main/res/drawable-nodpi/trezor_angled.webp new file mode 100644 index 0000000000..05f0c4f4b1 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/trezor_angled.webp differ diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index b83d821e9f..8142abb8d9 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -316,6 +316,10 @@ الرسوم أعلى مما ستستلمه. لا يمكن قراءة جزء من هذا التحويل على السلسلة الآن. يحاول Bitkit مجددًا لمدة تصل إلى أسبوع. ينتظر {amount} الذي نقله مشغّلو Spark على السلسلة أن يفرجوا عنه. يطلب Bitkit مجددًا لمدة تصل إلى أسبوع. + يستخدم رصيد الإنفاق Spark، الذي تديره Lightspark وBreez وFlashnet.\n\nيعتمد أمانه على تصرّف مشغّل واحد على الأقل بأمانة. يمكن للمشغّلين إيقاف الوصول مؤقتًا، والسحب من دون تعاونهم يتطلب منك بدء خروج على السلسلة. + حول\n<accent>رصيد الإنفاق</accent> + تكون أموالك عادةً جاهزة للإنفاق خلال بضع دقائق، دون الحاجة إلى انتظار التأكيدات. + تصبح أموالك متاحة بعد 3 تأكيدات، عادةً خلال 30 دقيقة تقريبًا. المزوّد Spark عبر Breez بلا حد @@ -331,21 +335,21 @@ 25% تحويل\n<accent>إلى الإنفاق</accent> إلى الإنفاق + تقديري + أقصى الرسوم أعلى بمقدار {amount} لأن معدلات الرسوم أو رصيد مدخراتك تغيّر أثناء وجودك في هذه الشاشة. اسحب مرة أخرى للتأكيد. تغيّرت الرسوم جاهز خلال دقائق - بعد 3 تأكيدات، نحو 30 دقيقة رسوم الخدمة رسوم الشبكة + جاهز خلال 30 دقيقة تقريبًا تعذّر على Bitkit الحصول على الرسوم الحالية لهذا التحويل. تحقق من اتصالك وحاول مرة أخرى. الرسوم غير متاحة - رسوم الإنفاق الإجمالي ابدأ حوّل الأموال إلى رصيد الإنفاق للاستمتاع بمعاملات فورية ورخيصة مع الأصدقاء والعائلة والتجار. تحويل\n<accent>إلى الإنفاق</accent> رصيد الإنفاق - يدفع الفوري للمزوّد لإضافة تحويلك إلى رصيد الإنفاق قبل تأكيده، عادةً خلال دقائق.\n\nأما لاحقًا فينتظر 3 تأكيدات، نحو 30 دقيقة، برسوم أقل. Transfer\n<accent>speed</accent> الحالة الدعم @@ -357,10 +361,12 @@ يرجى\n<accent>التأكيد</accent> تحويل الأموال اسحب للتحويل + تحويل من المدخرات + العنوان (أكّد على الجهاز) فتح Trezor Connect جارٍ التحويل ابدأ - موّل رصيد الإنفاق للاستمتاع بمعاملات فورية ورخيصة مع الأصدقاء والعائلة والتجار. + موّل رصيد الإنفاق للاستمتاع بمدفوعات Lightning فورية ورخيصة. رصيد\n<accent>الإنفاق</accent> نجح التحويل تم تحويل أموالك. يمكنك استخدام هذه الأموال فورًا. 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 bf65d44b45..8f093444c3 100644 --- a/app/src/main/res/values-b+es+419/strings.xml +++ b/app/src/main/res/values-b+es+419/strings.xml @@ -162,12 +162,12 @@ No se ha podido iniciar la transferencia. ¿Desea forzar esta transferencia? No podrá utilizar estos fondos durante ±14 días (!) Forzar\n<accent>Transferencia</accent> Transferir desde Ahorros - Usar Otra Billetera + Usar otra billetera Transferir desde billetera HW Saldo de gastos La forma más fácil es usar tus ahorros de Bitkit o enviar bitcoin desde una billetera diferente. Fondee su <accent>saldo de gastos</accent> - Configuración Manual + Configuración manual Capacidad entrante Máximo HTLC entrante Mínimo HTLC entrante @@ -323,6 +323,10 @@ Las comisiones son mayores que lo que recibirías. En este momento no se puede leer on-chain parte de esta transferencia. Bitkit lo vuelve a intentar durante hasta una semana. {amount} que los operadores de Spark movieron on-chain espera a que lo liberen. Bitkit vuelve a pedirlo durante hasta una semana. + Tu saldo de gastos usa Spark, operado por Lightspark, Breez y Flashnet.\n\nSu seguridad depende de que al menos un operador actúe con honestidad. Los operadores pueden pausar el acceso, y retirar sin su cooperación requiere que inicies una salida on-chain. + Acerca de tu\n<accent>saldo de gastos</accent> + Tus fondos suelen estar listos para gastar en unos minutos, sin esperar confirmaciones. + Tus fondos estarán disponibles tras 3 confirmaciones, normalmente unos 30 minutos. Proveedor Spark mediante Breez Sin límite @@ -338,21 +342,21 @@ 25% Transferir\n<accent>a gastos</accent> Hacia Gastos + est. + máx. Las comisiones son {amount} más altas porque las tarifas o su saldo de ahorros cambiaron mientras estaba en esta pantalla. Deslice de nuevo para confirmar. Las comisiones cambiaron Listo en unos minutos - Después de 3 confirmaciones, unos 30 minutos Comisión de servicio Comisiones de red + Listo en unos 30 minutos Bitkit no pudo obtener las comisiones actuales de esta transferencia. Revisa tu conexión e inténtalo de nuevo. Comisiones no disponibles - Comisión de gastos Total Empezar Transfiera fondos a su saldo de gastos para disfrutar de transacciones baratas e instantáneas con amigos y comercios. Transferir\n<accent>a gastos</accent> Saldo para gastos - Instantáneo le paga al proveedor para agregar tu transferencia a tu saldo para gastos antes de que se confirme, normalmente en unos minutos.\n\nDespués espera 3 confirmaciones, unos 30 minutos, con una comisión menor. Transfer\n<accent>speed</accent> Estatus Soporte @@ -364,10 +368,12 @@ Por favor,\n<accent>confirme</accent> Transferir fondos Desliza para enviar + Transferir desde Ahorros + Dirección (confirma en el dispositivo) Abrir Trezor Connect TRANSFERENCIA EN PROGRESO Empezar - Fondee el saldo de gastos para disfrutar de transacciones baratas e instantáneas con amigos y comercios. + Recarga tu saldo de gastos para disfrutar de pagos Lightning instantáneos y baratos. Saldo de\n<accent>Gasto</accent> Transferencia exitosa Sus fondos han sido transferidos. Podrá utilizar estos fondos inmediatamente. diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 5df2309727..e8253432d4 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -320,6 +320,10 @@ Les comissions són més altes del que rebries. Ara mateix no es pot llegir on-chain part d\'aquesta transferència. Bitkit ho torna a intentar durant un màxim d\'una setmana. {amount} que els operadors de Spark han mogut on-chain espera que l\'alliberin. Bitkit els ho torna a demanar durant un màxim d\'una setmana. + El teu saldo de despesa utilitza Spark, gestionat per Lightspark, Breez i Flashnet.\n\nLa seva seguretat depèn que almenys un operador actuï amb honestedat. Els operadors poden pausar l\'accés, i retirar sense la seva cooperació requereix que iniciïs una sortida on-chain. + Sobre el teu\n<accent>saldo de despesa</accent> + Els teus fons solen estar llestos per gastar en pocs minuts, sense esperar confirmacions. + Els teus fons estaran disponibles després de 3 confirmacions, normalment uns 30 minuts. Proveïdor Spark mitjançant Breez Sense límit @@ -335,21 +339,21 @@ 25% Transferir\n<accent>a despesa</accent> A despesa + est. + màx. Les tarifes són {amount} més altes perquè les taxes de tarifa o el teu saldo d\'estalvis han canviat mentre eres en aquesta pantalla. Torna a desplaçar per confirmar. Les tarifes han canviat A punt en pocs minuts - Després de 3 confirmacions, uns 30 minuts Tarifes de servei Tarifes de xarxa + Llest en uns 30 minuts Bitkit no ha pogut obtenir les comissions actuals d\'aquesta transferència. Comprova la connexió i torna-ho a provar. Comissions no disponibles - Comissió de despesa Total Començar Transfereix fons al teu saldo de despesa per gaudir de transaccions instantànies i barates amb amics, família i comerciants. Transferir\n<accent>a despesa</accent> Saldo de despesa - Instant paga el proveïdor per afegir la teva transferència al saldo de despesa abans que es confirmi, normalment en pocs minuts.\n\nDesprés espera 3 confirmacions, uns 30 minuts, amb una comissió més baixa. Transfer\n<accent>speed</accent> Estat Suport @@ -361,10 +365,12 @@ Si us plau\n<accent>confirma</accent> Transferir fons Desplaçar per Transferir + Transferir des d\'estalvis + Adreça (confirma al dispositiu) Obrir Trezor Connect TRANSFERÈNCIA EN CURS Començar - Finança el teu saldo de despesa per gaudir de transaccions instantànies i barates amb amics, família i comerciants. + Carrega el teu saldo de despesa per gaudir de pagaments Lightning instantanis i econòmics. Saldo de\n<accent>despesa</accent> Transferència realitzada Els teus fons han estat transferits. Pots utilitzar aquests fons immediatament. diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index d5b70334bb..6c2e710ed0 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -323,6 +323,10 @@ Poplatky jsou vyšší, než kolik byste obdrželi. Část tohoto převodu nelze nyní na blockchainu přečíst. Bitkit to zkouší znovu až týden. {amount}, které operátoři Sparku přesunuli on-chain, čeká, až je uvolní. Bitkit se bude ptát znovu až týden. + Váš výdajový zůstatek využívá Spark, který provozují Lightspark, Breez a Flashnet.\n\nJeho bezpečnost závisí na tom, že alespoň jeden provozovatel jedná poctivě. Provozovatelé mohou pozastavit přístup a výběr bez jejich spolupráce vyžaduje, abyste zahájili on-chain výstup. + O vašem\n<accent>výdajovém zůstatku</accent> + Vaše prostředky jsou obvykle připraveny k útratě do několika minut, bez čekání na potvrzení. + Vaše prostředky budou dostupné po 3 potvrzeních, obvykle asi za 30 minut. Poskytovatel Spark přes Breez Bez limitu @@ -338,21 +342,21 @@ 25% Převést\n<accent>do výdajů</accent> Do výdajů + odh. + max. Poplatky jsou o {amount} vyšší, protože se během zobrazení této obrazovky změnily sazby poplatků nebo zůstatek vašich úspor. Pro potvrzení přejeďte znovu. Poplatky se změnily Hotovo za pár minut - Po 3 potvrzeních, asi 30 minut Poplatky za služby Síťové poplatky + Připraveno asi za 30 minut Bitkit nedokázal získat aktuální poplatky za tento převod. Zkontroluj připojení a zkus to znovu. Poplatky nedostupné - Poplatek za výdaje Celkem Začít Převeďte peníze na svůj disponibilní zůstatek a využívejte okamžité a levné transakce s přáteli, rodinou a obchodníky. Převést\n<accent>do výdajů</accent> Disponibilní zůstatek - Okamžitě platí poskytovateli za přidání převodu do zůstatku pro výdaje ještě před potvrzením, obvykle během pár minut.\n\nPozději čeká na 3 potvrzení, asi 30 minut, s nižším poplatkem. Transfer\n<accent>speed</accent> Status Podpora @@ -364,10 +368,12 @@ Prosím,\n<accent>potvrďte</accent> Převést prostředky Přejeďte prstem k provedení převodu + Převod z úspor + Adresa (potvrďte na zařízení) Otevřít Trezor Connect PŘEVOD PROBÍHÁ Začít - Navyšte svůj disponibilní zůstatek a užívejte si okamžité a levné transakce s přáteli, rodinou a obchodníky. + Doplňte výdajový zůstatek a užívejte si okamžité a levné platby Lightning. Disponibilní\n<accent>Zůstatek</accent> Přenos úspěšný Vaše prostředky byly převedeny. Tyto prostředky můžete okamžitě použít. diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index ecc1274cf5..26d6fb8f16 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -205,6 +205,10 @@ Die Gebühren sind höher als der Betrag, den du erhalten würdest. Ein Teil dieser Übertragung kann derzeit nicht on-chain gelesen werden. Bitkit versucht es bis zu eine Woche lang erneut. {amount}, das die Spark-Betreiber on-chain verschoben haben, wartet auf deren Freigabe. Bitkit fragt bis zu einer Woche lang erneut nach. + Dein Ausgabenguthaben nutzt Spark, betrieben von Lightspark, Breez und Flashnet.\n\nSeine Sicherheit hängt davon ab, dass mindestens ein Betreiber ehrlich handelt. Betreiber können den Zugang sperren, und eine Auszahlung ohne ihre Mitwirkung erfordert, dass du einen On-Chain-Exit startest. + Über dein\n<accent>Ausgaben-Guthaben</accent> + Deine Mittel sind meist innerhalb weniger Minuten verfügbar, ohne auf Bestätigungen zu warten. + Deine Mittel sind nach 3 Bestätigungen verfügbar, meist nach etwa 30 Minuten. Anbieter Spark über Breez Kein Limit @@ -214,9 +218,14 @@ Von Sparkonto übertragen Manuelle Einrichtung <accent>zu den Ausgaben</accent> + ca. + max. + Bereit in etwa 30 Minuten Übertrage Guthaben Bitte\n<accent>bestätige</accent> Swipe zum Übertragen + Von Sparkonto übertragen + Adresse (am Gerät bestätigen) Trezor Connect öffnen 25% Maximaler Ausgabensaldo @@ -226,13 +235,11 @@ Netzgebühren Bitkit konnte die aktuellen Gebühren für diese Überweisung nicht abrufen. Prüfe deine Verbindung und versuche es erneut. Gebühren nicht verfügbar - Ausgabengebühr Servicegebühren Zu den Ausgaben Die Gebühren sind um {amount} höher, weil sich die Gebührensätze oder dein Sparguthaben geändert haben, während du auf diesem Bildschirm warst. Wische erneut, um zu bestätigen. Gebühren geändert In wenigen Minuten bereit - Nach 3 Bestätigungen, etwa 30 Minuten Total Los geht\'s Überweisen Sie Geld auf Ihr Guthaben, um sofortige und günstige Transaktionen mit Freunden, Familie und Händlern zu tätigen. @@ -252,6 +259,7 @@ Transfer\n<accent>unterbrochen</accent> Bitkit behalten\n<accent>open</accent> Die Gelder wurden noch nicht übertragen. Bitkit wird versuchen, die Übertragung in den nächsten <accent>30 Minuten</accent> zu initiieren. Bitte halte deine App offen. + Lade dein Ausgabenguthaben auf und genieße sofortige, günstige Lightning-Zahlungen. Übertragung erfolgreich Bewegte Mittel\n<accent>zu den Einsparungen</accent> Bewegte Mittel\n<accent>zu den Ausgaben</accent> @@ -276,7 +284,6 @@ Unzureichendes Sparguthaben Sparkonto Ausgabenguthaben - Sofort bezahlt den Anbieter dafür, deine Überweisung schon vor der Bestätigung deinem Ausgabenguthaben hinzuzufügen, meist innerhalb weniger Minuten.\n\nSpäter wartet auf 3 Bestätigungen, etwa 30 Minuten, zu einer niedrigeren Gebühr. Transfer\n<accent>speed</accent> Empfangskapazität Lightning Node @@ -372,7 +379,6 @@ Gesamt Onchain ÜBERTRAGUNG LÄUFT Los geht\'s - Fülle dein Guthaben auf, um sofortige und günstige Transaktionen mit Freunden, Familie und Händlern zu genießen. Spending\n<accent>Balance</accent> Bitte warte bis sich Bitkit mit dem Zahlungsnetzwerk verbunden hat (±10 Sekunden). Bitte warte bis sich Bitkit mit dem Bitcoin-Netzwerk verbunden hat (±10 Sekunden). diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 6789d2d2ea..3efb1f358e 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -316,6 +316,10 @@ Τα τέλη είναι υψηλότερα από όσα θα λαμβάνατε. Μέρος αυτής της μεταφοράς δεν μπορεί να διαβαστεί on-chain αυτή τη στιγμή. Το Bitkit προσπαθεί ξανά έως και μία εβδομάδα. {amount} που μετέφεραν on-chain οι διαχειριστές του Spark περιμένουν να τα αποδεσμεύσουν. Το Bitkit ζητά ξανά για έως μία εβδομάδα. + Το υπόλοιπο δαπανών σου χρησιμοποιεί το Spark, που λειτουργούν οι Lightspark, Breez και Flashnet.\n\nΗ ασφάλειά του εξαρτάται από το να ενεργεί έντιμα τουλάχιστον ένας διαχειριστής. Οι διαχειριστές μπορούν να αναστείλουν την πρόσβαση, και η ανάληψη χωρίς τη συνεργασία τους απαιτεί να ξεκινήσεις έξοδο on-chain. + Σχετικά με το\n<accent>υπόλοιπο δαπανών</accent> + Τα κεφάλαιά σου είναι συνήθως έτοιμα για χρήση μέσα σε λίγα λεπτά, χωρίς αναμονή για επιβεβαιώσεις. + Τα κεφάλαιά σου γίνονται διαθέσιμα μετά από 3 επιβεβαιώσεις, συνήθως σε περίπου 30 λεπτά. Πάροχος Spark μέσω Breez Χωρίς όριο @@ -331,21 +335,21 @@ 25% Μεταφορά\n<accent>σε δαπάνες</accent> Σε δαπάνες + εκτ. + μέγ. Τα τέλη είναι {amount} υψηλότερα, επειδή τα ποσοστά τελών ή το υπόλοιπο αποταμιεύσεων άλλαξαν ενώ ήσουν σε αυτή την οθόνη. Σύρε ξανά για επιβεβαίωση. Τα τέλη άλλαξαν Έτοιμο σε λίγα λεπτά - Μετά από 3 επιβεβαιώσεις, περίπου 30 λεπτά Τέλη υπηρεσίας Τέλη δικτύου + Έτοιμο σε περίπου 30 λεπτά Το Bitkit δεν μπόρεσε να λάβει τις τρέχουσες χρεώσεις για αυτή τη μεταφορά. Έλεγξε τη σύνδεσή σου και δοκίμασε ξανά. Μη διαθέσιμες χρεώσεις - Χρέωση δαπανών Σύνολο Ξεκίνα Μετέφερε κεφάλαια στο υπόλοιπο δαπανών για να απολαύσεις άμεσες και φθηνές συναλλαγές με φίλους, οικογένεια και εμπόρους. Μεταφορά\n<accent>σε δαπάνες</accent> Υπόλοιπο δαπανών - Το Άμεσα πληρώνει τον πάροχο για να προσθέσει τη μεταφορά σου στο υπόλοιπο δαπανών πριν επιβεβαιωθεί, συνήθως μέσα σε λίγα λεπτά.\n\nΤο Αργότερα περιμένει 3 επιβεβαιώσεις, περίπου 30 λεπτά, με χαμηλότερη χρέωση. Transfer\n<accent>speed</accent> Κατάσταση Υποστήριξη @@ -357,10 +361,12 @@ Παρακαλώ\n<accent>επιβεβαίωσε</accent> Μεταφορά κεφαλαίων Σύρε για μεταφορά + Μεταφορά από αποταμιεύσεις + Διεύθυνση (επιβεβαίωσε στη συσκευή) Άνοιγμα Trezor Connect ΜΕΤΑΦΟΡΑ ΣΕ ΕΞΕΛΙΞΗ Ξεκίνα - Χρηματοδότησε το υπόλοιπο δαπανών για να απολαύσεις άμεσες και φθηνές συναλλαγές με φίλους, οικογένεια και εμπόρους. + Χρηματοδότησε το υπόλοιπο δαπανών σου για άμεσες και φθηνές πληρωμές Lightning. Υπόλοιπο\n<accent>δαπανών</accent> Επιτυχής μεταφορά Τα κεφάλαιά σου μεταφέρθηκαν. Μπορείς να χρησιμοποιήσεις αυτά τα κεφάλαια αμέσως. diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index eb515280f0..6e6389ba7a 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -161,7 +161,7 @@ No se ha podido iniciar la transferencia. ¿Desea forzar esta transferencia? No podrá utilizar estos fondos durante ±14 días (!) Forzar\n<accent>Transferencia</accent> Transferir desde Ahorros - Usar Otro Monedero + Usar otro monedero Transferir desde billetera HW Saldo de gastos La forma más fácil es usar sus ahorros en Bitkit o enviar bitcoin desde un monedero diferente. @@ -322,6 +322,10 @@ Las comisiones son mayores que lo que recibirías. Ahora mismo no se puede leer on-chain parte de esta transferencia. Bitkit lo vuelve a intentar durante hasta una semana. {amount} que los operadores de Spark movieron on-chain espera a que lo liberen. Bitkit vuelve a pedirlo durante hasta una semana. + Tu saldo de gastos usa Spark, gestionado por Lightspark, Breez y Flashnet.\n\nSu seguridad depende de que al menos un operador actúe con honestidad. Los operadores pueden pausar el acceso, y retirar sin su cooperación requiere que inicies una salida on-chain. + Acerca de tu\n<accent>saldo de gastos</accent> + Tus fondos suelen estar listos para gastar en unos minutos, sin esperar confirmaciones. + Tus fondos estarán disponibles tras 3 confirmaciones, normalmente unos 30 minutos. Proveedor Spark mediante Breez Sin límite @@ -337,21 +341,21 @@ 25% Transferir\n<accent>a gasto</accent> A gasto + est. + máx. Las comisiones son {amount} más altas porque las tasas de comisión o tu saldo de ahorro cambiaron mientras estabas en esta pantalla. Desliza de nuevo para confirmar. Las comisiones han cambiado Listo en unos minutos - Tras 3 confirmaciones, unos 30 minutos Comisión de servicio Comisión de red + Listo en unos 30 minutos Bitkit no pudo obtener las comisiones actuales de esta transferencia. Compruebe su conexión e inténtelo de nuevo. Comisiones no disponibles - Comisión de gastos Total Empezar Transfiera fondos a su saldo de gasto para disfrutar de transacciones baratas e instantáneas con amigos, familia y comerciantes. Transferir\n<accent>a gasto</accent> Saldo para gastos - Instantáneo paga al proveedor para añadir su transferencia a su saldo para gastos antes de que se confirme, normalmente en unos minutos.\n\nMás tarde espera 3 confirmaciones, unos 30 minutos, con una comisión menor. Transfer\n<accent>speed</accent> Estatus Soporte @@ -363,10 +367,12 @@ Por favor,\n<accent>confirme</accent> Transferir fondos Deslizar para transferir + Transferir desde Ahorros + Dirección (confirma en el dispositivo) Abrir Trezor Connect TRANSFERENCIA EN CURSO Empezar - Rellene el saldo de gasto para disfrutar de transacciones baratas e instantáneas con amigos, familia y comerciantes. + Recarga tu saldo de gastos para disfrutar de pagos Lightning instantáneos y baratos. Saldo de\n<accent>Gasto</accent> Transferencia exitosa Tus fondos han sido transferidos. Puedes usar estos fondos inmediatamente. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index d4169e022f..2caf07ae43 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -131,10 +131,10 @@ Hora de actualización de caché de comisiones Comisiones No se pueden transferir los fondos de vuelta a ahorros. Por favor, inténtalo de nuevo. - Usar Otro Monedero + Usar otro monedero Transferir desde billetera HW La forma más fácil es usar tus ahorros de Bitkit o enviar bitcoin desde un monedero diferente. - Configuración Manual + Configuración manual Capacidad de entrada HTLC de entrada máximo HTLC de entrada mínimo @@ -264,6 +264,10 @@ Las comisiones son mayores que lo que recibirías. Ahora mismo no se puede leer on-chain parte de esta transferencia. Bitkit lo vuelve a intentar durante hasta una semana. {amount} que los operadores de Spark movieron on-chain espera a que lo liberen. Bitkit vuelve a pedirlo durante hasta una semana. + Tu saldo de gastos usa Spark, operado por Lightspark, Breez y Flashnet.\n\nSu seguridad depende de que al menos un operador actúe con honestidad. Los operadores pueden pausar el acceso, y retirar sin su cooperación requiere que inicies una salida on-chain. + Acerca de tu\n<accent>saldo de gastos</accent> + Tus fondos suelen estar listos para gastar en unos minutos, sin esperar confirmaciones. + Tus fondos estarán disponibles tras 3 confirmaciones, normalmente unos 30 minutos. Proveedor Spark mediante Breez Sin límite @@ -275,16 +279,20 @@ Importe demasiado bajo Transferir\n<accent>a gastos</accent> A gastos + est. + máx. Las comisiones son {amount} más altas porque las tasas de comisión o su saldo de ahorro cambiaron mientras estaba en esta pantalla. Deslice de nuevo para confirmar. Las comisiones han cambiado Listo en unos minutos - Tras 3 confirmaciones, unos 30 minutos + Listo en unos 30 minutos Reserva total de canales ancla Total Lightning Total onchain + Transferir desde Ahorros + Dirección (confirma en el dispositivo) TRANSFERENCIA EN PROGRESO Empezar - Rellene el saldo de gasto para disfrutar de transacciones baratas e instantáneas con amigos, familia y comerciantes. + Recarga tu saldo de gastos para disfrutar de pagos Lightning instantáneos y baratos. Saldo de\n<accent>Gasto</accent> Saldo de gastos Rellene su <accent>saldo de gastos</accent> @@ -297,7 +305,6 @@ Comisión de red Bitkit no pudo obtener las comisiones actuales de esta transferencia. Comprueba tu conexión e inténtalo de nuevo. Comisiones no disponibles - Comisión de gastos Comisión de servicio Total Empezar @@ -327,7 +334,6 @@ Ahorros Insuficientes Ahorro Saldo para gastos - Instantáneo paga al proveedor para añadir tu transferencia a tu saldo para gastos antes de que se confirme, normalmente en unos minutos.\n\nMás tarde espera 3 confirmaciones, unos 30 minutos, con una comisión menor. Transfer\n<accent>speed</accent> Capacidad de recepción Nodo Lightning diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index f7b0b1ca87..8d7a39bded 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -204,6 +204,10 @@ Les frais sont supérieurs à ce que vous recevriez. Une partie de ce transfert ne peut pas être lue on-chain pour le moment. Bitkit réessaie jusqu\'à une semaine. {amount} que les opérateurs Spark ont déplacé on-chain attend qu\'ils le libèrent. Bitkit le leur redemande pendant une semaine au maximum. + Votre solde de dépenses utilise Spark, géré par Lightspark, Breez et Flashnet.\n\nSa sécurité repose sur au moins un opérateur agissant honnêtement. Les opérateurs peuvent suspendre l\'accès, et retirer sans leur coopération vous oblige à lancer une sortie on-chain. + À propos de votre\n<accent>solde de dépenses</accent> + Vos fonds sont généralement disponibles en quelques minutes, sans attendre de confirmations. + Vos fonds deviennent disponibles après 3 confirmations, généralement environ 30 minutes. Fournisseur Spark via Breez Sans limite @@ -213,9 +217,14 @@ Transfert depuis l\'épargne Configuration manuelle Transfert \n<accent>Dépenses</accent> + est. + max + Prêt dans environ 30 minutes Transfert de fonds Veuillez\n<accent>confirmer</accent> Glissez pour transférer + Transfert depuis l\'épargne + Adresse (confirmez sur l\'appareil) Ouvrir Trezor Connect 25% Seuil Maximum Épargne @@ -225,13 +234,11 @@ Frais de réseau Bitkit n\'a pas pu obtenir les frais actuels de ce transfert. Vérifiez votre connexion et réessayez. Frais indisponibles - Frais de dépense Frais de service Vers Dépenses Les frais sont plus élevés de {amount}, car les taux de frais ou votre solde d\'épargne ont changé pendant que vous étiez sur cet écran. Glissez à nouveau pour confirmer. Frais modifiés Prêt en quelques minutes - Après 3 confirmations, environ 30 minutes Total Commencer Transférez des fonds vers votre solde Dépenses pour profiter de transactions instantanées et moins chers avec vos amis, votre famille et les commerçants. @@ -251,6 +258,7 @@ Transfert \n<accent>interrompu</accent> Gardez Bitkit \n<accent>ouvert</accent> Les fonds n\'ont pas encore été transférés. Bitkit va essayer d\'initier le transfert au cours des <accent>30</accent> prochaines <accent>minutes</accent>. Veuillez garder votre application ouverte. + Alimentez votre solde de dépenses pour profiter de paiements Lightning instantanés et peu coûteux. Transfert réussi Fonds transférés \n<accent>à l\'épargne</accent> Fonds transférés \n<accent>vers Dépenses</accent> @@ -275,7 +283,6 @@ Épargne insuffisante Épargner Solde Dépenses - Instantané paie le fournisseur pour ajouter votre transfert à votre solde de dépenses avant sa confirmation, généralement en quelques minutes.\n\nPlus tard attend 3 confirmations, environ 30 minutes, pour des frais moins élevés. Transfer\n<accent>speed</accent> Capacité de réception Heure de l\'instantané Rapid Gossip Sync @@ -289,7 +296,6 @@ Total Onchain TRANSFERT EN COURS Commencer - Alimentez votre solde de dépenses pour profiter de transactions instantanées et bon marché avec vos amis, votre famille et les commerçants. Dépenses \n<accent>Solde</accent> Soldes du portefeuille Nœud Lightning diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index e3106f4b0a..baa9e08b1a 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -165,7 +165,7 @@ Conto di Spesa Il modo più semplice è usare i tuoi risparmi Bitkit o inviare bitcoin da un portafoglio diverso. Manda fondi al tuo <accent>conto di spesa</accent> - Configurazione Manuale + Configurazione manuale Capacita\' in Entrata HTLC Max in Entrata HTLC Min in Entrata @@ -321,6 +321,10 @@ Le commissioni sono più alte di quanto riceveresti. Una parte di questo trasferimento al momento non può essere letta on-chain. Bitkit riprova per un massimo di una settimana. {amount} che gli operatori Spark hanno spostato on-chain attende che lo sblocchino. Bitkit lo richiede di nuovo per un massimo di una settimana. + Il tuo saldo di spesa usa Spark, gestito da Lightspark, Breez e Flashnet.\n\nLa sua sicurezza dipende dal fatto che almeno un operatore agisca onestamente. Gli operatori possono sospendere l\'accesso, e prelevare senza la loro collaborazione richiede di avviare un\'uscita on-chain. + Info sul tuo\n<accent>saldo di spesa</accent> + I tuoi fondi sono di solito pronti da spendere in pochi minuti, senza attendere conferme. + I tuoi fondi diventano disponibili dopo 3 conferme, di solito circa 30 minuti. Fornitore Spark tramite Breez Nessun limite @@ -336,21 +340,21 @@ 25% Trasferisci\n<accent>alle spese</accent> Alle spese + stim. + max Le commissioni sono aumentate di {amount} perché i tassi di commissione o il saldo dei tuoi risparmi sono cambiati mentre eri su questa schermata. Scorri di nuovo per confermare. Commissioni cambiate Pronto in pochi minuti - Dopo 3 conferme, circa 30 minuti Commissioni servizio Commissioni rete + Pronto in circa 30 minuti Bitkit non è riuscito a ottenere le commissioni attuali per questo trasferimento. Controlla la connessione e riprova. Commissioni non disponibili - Commissione di spesa Totale Inizia Trasferisci fondi al tuo conto di spesa per usufruire di transazioni istantanee ed economiche con amici, familiari e commercianti. Trasferisci\n<accent>alle spese</accent> Conto di spesa - Istantanea paga il fornitore per aggiungere il tuo trasferimento al conto di spesa prima della conferma, di solito in pochi minuti.\n\nPiù tardi attende 3 conferme, circa 30 minuti, con una commissione più bassa. Transfer\n<accent>speed</accent> Stato Supporto @@ -362,10 +366,12 @@ Per favore\n<accent>conferma</accent> Trasferimento Fondi Swipe Per Trasferire + Trasferimento da risparmio + Indirizzo (conferma sul dispositivo) Apri Trezor Connect TRASFERIMENTO IN CORSO Inizia - Manda fondi al tuo conto di spesa per usufruire di transazioni istantanee ed economiche con amici, familiari e commercianti. + Ricarica il tuo saldo di spesa per pagamenti Lightning istantanei ed economici. Conto\n<accent>di Spesa</accent> Trasferimento Riuscito I tuoi fondi sono stati trasferiti. Puoi utilizzare questi fondi immediatamente. diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 9279e40cee..4eb48d34e6 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -320,6 +320,10 @@ De kosten zijn hoger dan wat je zou ontvangen. Een deel van deze overboeking kan nu niet on-chain worden gelezen. Bitkit probeert het tot een week opnieuw. {amount} dat de Spark-beheerders on-chain hebben verplaatst, wacht tot zij het vrijgeven. Bitkit vraagt het tot een week lang opnieuw. + Je bestedingssaldo gebruikt Spark, beheerd door Lightspark, Breez en Flashnet.\n\nDe veiligheid hangt ervan af dat ten minste één operator eerlijk handelt. Operators kunnen de toegang pauzeren, en opnemen zonder hun medewerking vereist dat je een on-chain exit start. + Over je\n<accent>bestedingssaldo</accent> + Je geld is meestal binnen een paar minuten klaar om te besteden, zonder op bevestigingen te wachten. + Je geld is beschikbaar na 3 bevestigingen, meestal na ongeveer 30 minuten. Aanbieder Spark via Breez Geen limiet @@ -335,21 +339,21 @@ 25% Overboeken\n<accent>naar bestedingssaldo</accent> Naar bestedingssaldo + ca. + max De vergoedingen zijn {amount} hoger, omdat de vergoedingstarieven of uw spaargeld zijn gewijzigd terwijl u op dit scherm was. Veeg opnieuw om te bevestigen. Vergoedingen gewijzigd Klaar binnen enkele minuten - Na 3 bevestigingen, ongeveer 30 minuten Servicevergoedingen Netwerkvergoedingen + Klaar in ongeveer 30 minuten Bitkit kon de huidige kosten voor deze overboeking niet ophalen. Controleer je verbinding en probeer het opnieuw. Kosten niet beschikbaar - Bestedingskosten Totaal Aan de slag Boek geld over naar je bestedingssaldo voor directe en goedkope transacties met vrienden, familie en winkeliers. Overboeken\n<accent>naar bestedingssaldo</accent> Bestedingssaldo - Direct betaalt de aanbieder om je overboeking al vóór de bevestiging aan je bestedingssaldo toe te voegen, meestal binnen enkele minuten.\n\nLater wacht op 3 bevestigingen, ongeveer 30 minuten, tegen lagere kosten. Transfer\n<accent>speed</accent> Status Ondersteuning @@ -361,10 +365,12 @@ Graag\n<accent>bevestigen</accent> Geld overboeken Veeg om over te boeken + Overboeken van spaargeld + Adres (bevestig op apparaat) Trezor Connect openen OVERBOEKING BEZIG Aan de slag - Vul je bestedingssaldo voor directe en goedkope transacties met vrienden, familie en winkeliers. + Vul je bestedingssaldo aan voor directe en goedkope Lightning-betalingen. Bestedings\n<accent>saldo</accent> Overboeking succesvol Je geld is overgeboekt. Je kunt dit geld direct gebruiken. diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index acd51f6924..2ba2c4c4aa 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -206,6 +206,10 @@ Opłaty są wyższe niż kwota, którą otrzymasz. Część tego transferu nie może teraz zostać odczytana on-chain. Bitkit ponawia próbę przez maksymalnie tydzień. {amount} przeniesione on-chain przez operatorów Spark czeka, aż je zwolnią. Bitkit będzie pytać ponownie przez maksymalnie tydzień. + Twoje saldo wydatków korzysta ze Spark, prowadzonego przez Lightspark, Breez i Flashnet.\n\nJego bezpieczeństwo zależy od tego, czy co najmniej jeden operator działa uczciwie. Operatorzy mogą wstrzymać dostęp, a wypłata bez ich współpracy wymaga rozpoczęcia wyjścia on-chain. + O Twoim\n<accent>saldzie wydatków</accent> + Twoje środki są zwykle gotowe do wydania w ciągu kilku minut, bez czekania na potwierdzenia. + Twoje środki będą dostępne po 3 potwierdzeniach, zwykle po około 30 minutach. Dostawca Spark przez Breez Bez limitu @@ -215,9 +219,14 @@ Prześlij z Oszczędności Konfiguracja ręczna Prześlij \n<accent>na saldo wydatków</accent> + szac. + maks. + Gotowe za około 30 minut Prześlij środki Proszę \n<accent>potwierdzić</accent> Przesuń, aby przesłać + Prześlij z Oszczędności + Adres (potwierdź na urządzeniu) Otwórz Trezor Connect 25% Maksymalne saldo wydatków @@ -227,13 +236,11 @@ Opłaty sieciowe Bitkit nie mógł pobrać aktualnych opłat za ten przelew. Sprawdź połączenie i spróbuj ponownie. Opłaty niedostępne - Opłata za wydatki Opłaty serwisowe Do salda wydatków Opłaty są wyższe o {amount}, ponieważ stawki opłat lub saldo oszczędności zmieniły się podczas wyświetlania tego ekranu. Przesuń ponownie, aby potwierdzić. Opłaty się zmieniły Gotowe w kilka minut - Po 3 potwierdzeniach, około 30 minut Razem Rozpocznij Przelewaj środki na swoje saldo wydatków, aby cieszyć się natychmiastowymi i tanimi transakcjami z przyjaciółmi, rodziną i sprzedawcami. @@ -253,6 +260,7 @@ Transfer środków\n<accent>przerwany</accent> Pozostaw Bitkit\n<accent>otwarty</accent> Środki nie zostały jeszcze przelane. Bitkit spróbuje zainicjować transfer w ciągu najbliższych <accent>30 minut</accent>. Proszę pozostawić aplikację otwartą. + Zasil saldo wydatków, aby korzystać z natychmiastowych i tanich płatności Lightning. Transfer środków powiódł się Środki przeniesione\n<accent>na saldo oszczędności</accent> Środki przeniesione\n<accent>na saldo wydatków</accent> @@ -277,7 +285,6 @@ Niewystarczające oszczędności Oszczędności Saldo wydatków - Natychmiast płaci dostawcy za dodanie przelewu do salda wydatków jeszcze przed potwierdzeniem, zwykle w kilka minut.\n\nPóźniej czeka na 3 potwierdzenia, około 30 minut, z niższą opłatą. Transfer\n<accent>speed</accent> Zdolność odbioru Węzeł Lightning @@ -373,7 +380,6 @@ Całkowite Onchain TRANSFER W TOKU Rozpocznij - Zasil swoje saldo wydatków, aby cieszyć się natychmiastowymi i tanimi transakcjami z przyjaciółmi, rodziną i sprzedawcami. Saldo \n<accent>Wydatków</accent> Saldo portfela Proszę poczekać, aż Bitkit połączy się z siecią płatności (±10 sekund). diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 6323d66da2..1c9b6c67ca 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -163,12 +163,12 @@ Não foi possível iniciar a transferência. Deseja forçar essa transferência? Vocè não poderá usar esses fundos por ±14 dias (!) Forçar\n<accent>Transferência</accent> Transferir do Saldo de Poupança - Transferir de Outra Carteira + Transferir de outra carteira Transferir da carteira HW Saldo de Gastos A forma mais fácil é usar suas economias do Bitkit ou enviar bitcoin de uma carteira diferente. Transfira para seu <accent>saldo de gastos</accent> - Setup Manual + Configuração manual Capacidade de Entrada HTLC de Entrada Máx HTLC de Entrada Mín @@ -324,6 +324,10 @@ As taxas são maiores do que o que você receberia. Parte desta transferência não pode ser lida on-chain agora. A Bitkit tenta de novo por até uma semana. {amount} que os operadores da Spark moveram on-chain aguarda a liberação por eles. A Bitkit pede de novo por até uma semana. + Seu saldo de gastos usa a Spark, operada pela Lightspark, Breez e Flashnet.\n\nSua segurança depende de pelo menos um operador agir com honestidade. Os operadores podem pausar o acesso, e sacar sem a cooperação deles exige que você inicie uma saída on-chain. + Sobre seu\n<accent>saldo de gastos</accent> + Seus fundos geralmente ficam prontos para gastar em poucos minutos, sem esperar confirmações. + Seus fundos ficam disponíveis após 3 confirmações, geralmente em cerca de 30 minutos. Provedor Spark via Breez Sem limite @@ -339,21 +343,21 @@ 25% Transferir\n<accent>para gastos</accent> Para gastos + est. + máx. As taxas estão {amount} mais altas porque as taxas de rede ou seu saldo de poupança mudaram enquanto você estava nesta tela. Deslize novamente para confirmar. Taxas alteradas Pronto em poucos minutos - Após 3 confirmações, cerca de 30 minutos Taxa de serviço Taxa da rede + Pronto em cerca de 30 minutos O Bitkit não conseguiu obter as taxas atuais desta transferência. Verifique sua conexão e tente novamente. Taxas indisponíveis - Taxa de gastos Total Começar Transfira fundos para seu saldo de gastos para desfrutar de transações instantâneas e baratas com amigos, familiares e comerciantes. Transferir\n<accent>para gastos</accent> Saldo de gastos - Instantâneo paga ao provedor para adicionar sua transferência ao saldo de gastos antes de ela ser confirmada, normalmente em poucos minutos.\n\nDepois aguarda 3 confirmações, cerca de 30 minutos, com uma taxa menor. Transfer\n<accent>speed</accent> Status Suporte @@ -365,10 +369,12 @@ Por favor\n<accent>confirme</accent> Transf. fundos Deslizar Para Transferir + Transferir do Saldo de Poupança + Endereço (confirme no dispositivo) Abrir Trezor Connect TRANSFERÊNCIA EM ANDAMENTO Começar - Use seu saldo de gastos para desfrutar de transações instantâneas e baratas com amigos, familiares e comerciantes. + Adicione fundos ao seu saldo de gastos para aproveitar pagamentos Lightning instantâneos e baratos. Saldo de\n<accent>Gastos</accent> Transferência bem-sucedida Seus fundos foram transferidos. Você já pode usar esses fundos imediatamente. diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 1b64701343..6e8a1f7991 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -95,7 +95,7 @@ Depende da taxa Depende da taxa Depende da taxa - Transferir de Outra Carteira + Transferir de outra carteira Transferir da carteira HW A forma mais fácil é usar as suas poupanças Bitkit ou enviar bitcoin de uma carteira diferente. Não foi possível transferir para a poupança @@ -201,6 +201,10 @@ As taxas são mais altas do que o que receberia. Parte desta transferência não pode ser lida on-chain neste momento. A Bitkit tenta novamente durante até uma semana. {amount} que os operadores da Spark moveram on-chain aguarda que o libertem. A Bitkit volta a pedir durante até uma semana. + O seu saldo de gastos usa a Spark, operada pela Lightspark, Breez e Flashnet.\n\nA sua segurança depende de pelo menos um operador agir com honestidade. Os operadores podem suspender o acesso, e levantar sem a cooperação deles exige que inicie uma saída on-chain. + Sobre o seu\n<accent>saldo de gastos</accent> + Os seus fundos ficam normalmente prontos a gastar em poucos minutos, sem esperar por confirmações. + Os seus fundos ficam disponíveis após 3 confirmações, normalmente cerca de 30 minutos. Fornecedor Spark via Breez Sem limite @@ -208,11 +212,16 @@ Saldo de Gastos Transfira para seu <accent>saldo de gastos</accent> Transferir do Saldo de Poupança - Setup Manual + Configuração manual Transferir\n<accent>para gastos</accent> + est. + máx. + Pronto em cerca de 30 minutos Transf. fundos Por favor\n<accent>confirme</accent> Deslizar Para Transferir + Transferir do Saldo de Poupança + Endereço (confirme no dispositivo) Abrir Trezor Connect 25% Saldo de gastos Máximo @@ -222,13 +231,11 @@ Taxa da rede A Bitkit não conseguiu obter as taxas atuais desta transferência. Verifique a sua ligação e tente novamente. Taxas indisponíveis - Taxa de gastos Taxa de serviço Para gastos As taxas estão {amount} mais altas porque as taxas de rede ou o seu saldo de poupança mudaram enquanto estava neste ecrã. Deslize novamente para confirmar. As taxas mudaram Pronto em poucos minutos - Após 3 confirmações, cerca de 30 minutos Total Começar Transfira fundos para seu saldo de gastos para desfrutar de transações instantâneas e baratas com amigos, familiares e comerciantes. @@ -248,6 +255,7 @@ Transferência\n<accent>interrompida</accent> Mantenha a Bitkit\n<accent>aberta</accent> Os fundos ainda não foram transferidos. A Bitkit tentará iniciar a transferência durante os próximos <accent>30 minutos</accent>. Por favor, mantenha o aplicativo aberto. + Carregue o seu saldo de gastos para desfrutar de pagamentos Lightning instantâneos e baratos. Transferência bem-sucedida Fundos transferidos\n<accent>para poupança</accent> Fundos transferidos\n<accent>para gastos</accent> @@ -272,7 +280,6 @@ Saldo de Poupança Insuficiente Poupança Saldo de gastos - Instantâneo paga ao fornecedor para adicionar a sua transferência ao saldo de gastos antes de ser confirmada, normalmente em poucos minutos.\n\nDepois aguarda 3 confirmações, cerca de 30 minutos, com uma taxa mais baixa. Transfer\n<accent>speed</accent> Capacidade de recebimento Nó Lightning @@ -369,7 +376,6 @@ Altura do Arquivo do Monitor de Canal TRANSFERÊNCIA EM ANDAMENTO Começar - Use seu saldo de gastos para desfrutar de transações instantâneas e baratas com amigos, familiares e comerciantes. Saldo de\n<accent>Gastos</accent> Começar Configure o seu saldo de despesas para desfrutar de transações instantâneas e económicas com amigos, familiares e comerciantes. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 7c1e3226f1..e06ffdadb0 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -171,12 +171,12 @@ Не удалось инициировать перевод. Хотите выполнить принудительный перевод? Вы не сможете использовать эти средства в течение ±14 дней (!) Принудительный\n<accent>Перевод</accent> Перевести из Сбережений - Использовать Другой Кошелёк + Использовать другой кошелёк Перевести с аппаратного кошелька Баланс Расходов Самый простой вариант — использовать ваши сбережения Bitkit или отправить биткоин с другого кошелька. Пополните свой <accent>Баланс Расходов</accent> - Ручная Настройка + Ручная настройка Входящая ёмкость Макс. входящий HTLC Мин. входящий HTLC @@ -332,6 +332,10 @@ Комиссии больше, чем сумма, которую вы получите. Часть этого перевода сейчас не удаётся прочитать в блокчейне. Bitkit будет пробовать снова в течение недели. {amount}, которые операторы Spark перевели ончейн, ждут, пока операторы их выдадут. Bitkit будет запрашивать снова в течение недели. + Ваш баланс расходов использует Spark, которым управляют Lightspark, Breez и Flashnet.\n\nЕго безопасность зависит от того, что хотя бы один оператор действует честно. Операторы могут приостановить доступ, а чтобы вывести средства без их участия, вам придётся запустить ончейн-вывод. + О вашем\n<accent>балансе расходов</accent> + Ваши средства обычно готовы к использованию через несколько минут, без ожидания подтверждений. + Ваши средства станут доступны после 3 подтверждений, обычно примерно через 30 минут. Провайдер Spark через Breez Без ограничений @@ -347,21 +351,21 @@ 25% Перевод\n<accent>на Расходы</accent> На Баланс Расходов + прим. + макс. Комиссии выросли на {amount}, потому что ставки комиссий или баланс сбережений изменились, пока вы были на этом экране. Проведите ещё раз для подтверждения. Комиссии изменились Готово через несколько минут - После 3 подтверждений, около 30 минут Сервисные Комиссии Сетевые Комиссии + Готово примерно через 30 минут Bitkit не смог получить текущие комиссии за этот перевод. Проверьте соединение и попробуйте снова. Комиссии недоступны - Комиссия расходов Итого Начать Переведите средства на свой баланс расходов, чтобы наслаждаться мгновенными и недорогими транзакциями с друзьями, семьёй и продавцами. Перевод\n<accent>на Расходы</accent> Баланс Расходов - Мгновенно платит провайдеру, чтобы зачислить перевод на баланс расходов до подтверждения, обычно за несколько минут.\n\nПозже ждёт 3 подтверждений, около 30 минут, с меньшей комиссией. Transfer\n<accent>speed</accent> Статус Поддержка @@ -373,10 +377,12 @@ Пожалуйста,\n<accent>Подтвердите</accent> Перевод Средств Проведите для Перевода + Перевести из Сбережений + Адрес (подтвердите на устройстве) Открыть Trezor Connect ПЕРЕВОД В ПРОЦЕССЕ Начать - Пополните свой баланс расходов, чтобы наслаждаться мгновенными и недорогими транзакциями с друзьями, семьёй и продавцами. + Пополните баланс расходов, чтобы пользоваться мгновенными и дешёвыми платежами Lightning. Расходы\n<accent>Баланс</accent> Перевод Выполнен Успешно Ваши средства переведены. Вы можете использовать эти средства немедленно. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 96deb9e3de..0b68747204 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -308,13 +308,13 @@ Force Transfer Could not initiate transfer. Do you want to force this transfer? You won’t be able to use these funds for ±14 days (!) Force\n<accent>Transfer</accent> - Transfer From Savings - Use Other Wallet + Transfer from Savings + Use other wallet Transfer from HW wallet Spending Balance The easiest option is to use your Bitkit savings or send bitcoin from a different wallet. Fund your <accent>spending balance</accent> - Manual Setup + Manual setup Inbound Capacity Inbound HTLC Max Inbound HTLC Min @@ -518,6 +518,10 @@ The fees are higher than what you would receive. Part of this transfer can\'t be read on-chain right now. Bitkit tries again for up to a week. {amount} that the Spark operators moved on-chain waits for them to release it. Bitkit asks again for up to a week. + Your spending balance uses Spark, operated by Lightspark, Breez and Flashnet.\n\nIts security depends on at least one operator acting honestly. Operators can pause access, and withdrawing without their cooperation requires you to initiate an on-chain exit. + About your\n<accent>spending balance</accent> + Your funds are usually ready to spend within a few minutes, no need to wait for confirmations. + Your funds become available after 3 confirmations, usually around 30 minutes. Provider Spark via Breez No limit @@ -532,26 +536,25 @@ Savings Balance Minimum 25% Transfer\n<accent>to spending</accent> - ± To spending Bitkit couldn\'t get the fees for this transfer. Check your connection and try again. + est + max Fees are {amount} higher because fee rates or your savings balance changed while you were on this screen. Swipe again to confirm. Fees changed Ready in a few minutes - After 3 confirmations, about 30 minutes Service fees The most you can transfer is now {amount}, because fee rates or your savings balance changed while you were on this screen. Swipe again to confirm. Amount changed Network fees + Ready in about 30 minutes Bitkit couldn\'t get the current fees for this transfer. Check your connection and try again. Fees Unavailable - Spending fee Total Get Started Transfer funds to your spending balance to enjoy instant and cheap transactions with friends, family, and merchants. Transfer\n<accent>to spending</accent> Spending balance - Instant pays the provider to add your transfer to your spending balance before it confirms, usually within a few minutes.\n\nLater waits for 3 confirmations, about 30 minutes, at a lower fee. Transfer\n<accent>speed</accent> Status Support @@ -564,6 +567,8 @@ Please\n<accent>confirm</accent> Transfer Funds Swipe To Transfer + Transfer From Savings + Address (confirm on device) Open Trezor Connect Please reconnect your hardware device, it appears to be disconnected from your phone. Reconnect Hardware Device @@ -571,7 +576,7 @@ Transaction\n<accent>signed</accent> TRANSFER IN PROGRESS Get Started - Fund your spending balance to enjoy instant and cheap transactions with friends, family, and merchants. + Fund your spending balance to enjoy instant and cheap Lightning payments. Spending\n<accent>Balance</accent> TRANSFER READY IN %s Transfer Successful diff --git a/app/src/test/java/to/bitkit/ui/screens/transfer/FundingScreenTest.kt b/app/src/test/java/to/bitkit/ui/screens/transfer/FundingScreenTest.kt index dafc6da5fa..afa842e045 100644 --- a/app/src/test/java/to/bitkit/ui/screens/transfer/FundingScreenTest.kt +++ b/app/src/test/java/to/bitkit/ui/screens/transfer/FundingScreenTest.kt @@ -1,7 +1,11 @@ package to.bitkit.ui.screens.transfer +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue import androidx.compose.ui.test.assertIsEnabled import androidx.compose.ui.test.assertIsNotEnabled +import androidx.compose.ui.test.getUnclippedBoundsInRoot import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.performClick @@ -14,6 +18,7 @@ import org.robolectric.annotation.Config import org.robolectric.shadows.ShadowSystemClock import to.bitkit.ui.theme.AppThemeSurface import kotlin.test.assertEquals +import kotlin.test.assertTrue import kotlin.time.Duration.Companion.seconds import kotlin.time.toJavaDuration @@ -59,4 +64,30 @@ class FundingScreenTest { composeRule.onNodeWithTag("FundHardware").performScrollTo().assertIsNotEnabled() composeRule.onNodeWithTag("FundReceive").performScrollTo().assertIsEnabled() } + + @Test + fun `spark lists savings, hardware, other wallet and manual setup in that order`() { + composeRule.setContent { + AppThemeSurface { FundingScreen(canFundWithSpark = true) } + } + + val tops = listOf("FundTransfer", "FundHardware", "FundReceive", "FundManual") + .map { composeRule.onNodeWithTag(it).getUnclippedBoundsInRoot().top } + + assertTrue(tops.zipWithNext().all { (above, below) -> above < below }, "tops are $tops") + } + + @Test + fun `learn more shows only while spark is not ready`() { + var isSparkReady by mutableStateOf(true) + composeRule.setContent { + AppThemeSurface { FundingScreen(canFundWithSpark = isSparkReady) } + } + + composeRule.onNodeWithTag("FundLearnMore").assertDoesNotExist() + + isSparkReady = false + + composeRule.onNodeWithTag("FundLearnMore").assertExists() + } } diff --git a/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingAmountScreenTest.kt b/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingAmountScreenTest.kt index aadb4526fb..ce25562543 100644 --- a/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingAmountScreenTest.kt +++ b/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingAmountScreenTest.kt @@ -3,6 +3,9 @@ package to.bitkit.ui.screens.transfer import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.padding import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalInspectionMode import androidx.compose.ui.test.getUnclippedBoundsInRoot @@ -17,9 +20,12 @@ import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.annotation.Config +import to.bitkit.models.PrimaryDisplay +import to.bitkit.repositories.AmountInputHandler import to.bitkit.repositories.CurrencyState import to.bitkit.ui.screens.transfer.SparkFundingContract.UiState import to.bitkit.ui.theme.AppThemeSurface +import to.bitkit.viewmodels.AmountInputViewModel import to.bitkit.viewmodels.previewAmountInputViewModel import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -39,6 +45,38 @@ class SpendingAmountScreenTest { assertEquals(78f, row.height.value, 0.5f) } + @Config(sdk = [34], qualifiers = "w448dp-h997dp") + @Test + fun `the available row sits 32 dp under the amount and the number pad stays at the bottom`() { + setContent() + + val amount = composeRule.onNodeWithTag("SpendingAmountNumberField").getUnclippedBoundsInRoot() + val available = composeRule.onNodeWithTag("SendAmountNumberPad").getUnclippedBoundsInRoot() + val lastRow = composeRule.onNodeWithTag("N0").getUnclippedBoundsInRoot() + val button = composeRule.onNodeWithTag("SpendingAmountContinue").getUnclippedBoundsInRoot() + val root = composeRule.onRoot().getUnclippedBoundsInRoot() + + assertEquals(32f, (available.top - amount.bottom).value, 0.5f) + assertEquals(lastRow.bottom.value, button.top.value, 0.5f) + assertEquals(root.bottom.value - 16f, button.bottom.value, 0.5f) + } + + @Config(sdk = [34], qualifiers = "w360dp-h780dp") + @Test + fun `the available row keeps its 32 dp gap on a mid-size screen`() { + setContent(statusBar = STATUS_BAR, navigationBar = NAVIGATION_BAR) + + val amount = composeRule.onNodeWithTag("SpendingAmountNumberField").getUnclippedBoundsInRoot() + val available = composeRule.onNodeWithTag("SendAmountNumberPad").getUnclippedBoundsInRoot() + val row = composeRule.onNodeWithTag("N1").getUnclippedBoundsInRoot() + val lastRow = composeRule.onNodeWithTag("N0").getUnclippedBoundsInRoot() + val button = composeRule.onNodeWithTag("SpendingAmountContinue").getUnclippedBoundsInRoot() + + assertEquals(32f, (available.top - amount.bottom).value, 0.5f) + assertTrue(row.height.value >= 40f, "row is ${row.height}") + assertTrue(lastRow.bottom <= button.top, "last row ends at ${lastRow.bottom}, continue at ${button.top}") + } + @Config(sdk = [34], qualifiers = "w360dp-h640dp") @Test fun `the amount screen fits a small screen with the continue button above the system bars`() { @@ -57,6 +95,78 @@ class SpendingAmountScreenTest { ) } + @Config(sdk = [34]) + @Test + fun `the amount follows a unit switched on another screen`() { + val btc = CurrencyState(primaryDisplay = PrimaryDisplay.BITCOIN) + val fiat = CurrencyState(primaryDisplay = PrimaryDisplay.FIAT) + val viewModel = AmountInputViewModel(AmountInputHandler.stub()).apply { setSats(4_567, btc) } + val reference = AmountInputViewModel(AmountInputHandler.stub()).apply { setSats(4_567, fiat) } + var currencies by mutableStateOf(btc) + composeRule.setContent { + CompositionLocalProvider(LocalInspectionMode provides true) { + AppThemeSurface { + Content( + uiState = UiState(isNodeRunning = true, isMaxLoading = false, maxSats = 158_234), + amountInputViewModel = viewModel, + currencies = currencies, + onBackClick = {}, + onClickQuarter = {}, + onClickMaxAmount = {}, + onConfirmAmount = {}, + ) + } + } + } + + currencies = fiat + composeRule.waitForIdle() + viewModel.handleNumberPadInput("1", fiat) + reference.handleNumberPadInput("1", fiat) + + assertEquals(reference.uiState.value.text, viewModel.uiState.value.text) + assertEquals(reference.uiState.value.sats, viewModel.uiState.value.sats) + } + + @Config(sdk = [34]) + @Test + fun `returning to the amount keeps what was typed`() { + val fiat = CurrencyState(primaryDisplay = PrimaryDisplay.FIAT) + val viewModel = AmountInputViewModel(AmountInputHandler.stub()) + val reference = AmountInputViewModel(AmountInputHandler.stub()) + listOf("1", "2").forEach { + viewModel.handleNumberPadInput(it, fiat) + reference.handleNumberPadInput(it, fiat) + } + var isShown by mutableStateOf(true) + composeRule.setContent { + CompositionLocalProvider(LocalInspectionMode provides true) { + AppThemeSurface { + if (isShown) { + Content( + uiState = UiState(isNodeRunning = true, isMaxLoading = false, maxSats = 158_234), + amountInputViewModel = viewModel, + currencies = fiat, + onBackClick = {}, + onClickQuarter = {}, + onClickMaxAmount = {}, + onConfirmAmount = {}, + ) + } + } + } + } + + isShown = false + composeRule.waitForIdle() + isShown = true + composeRule.waitForIdle() + viewModel.handleNumberPadInput("3", fiat) + reference.handleNumberPadInput("3", fiat) + + assertEquals(reference.uiState.value.text, viewModel.uiState.value.text) + } + /** Pads the screen as the system bars do on a device, since Robolectric reports no insets. */ private fun setContent(statusBar: Dp = 0.dp, navigationBar: Dp = 0.dp) { composeRule.setContent { diff --git a/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingFeeGridTest.kt b/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingFeeGridTest.kt index dd633ecc95..0e97674c16 100644 --- a/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingFeeGridTest.kt +++ b/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingFeeGridTest.kt @@ -2,20 +2,29 @@ package to.bitkit.ui.screens.transfer import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.ui.platform.LocalInspectionMode +import androidx.compose.ui.semantics.SemanticsActions +import androidx.compose.ui.test.SemanticsMatcher +import androidx.compose.ui.test.assert import androidx.compose.ui.test.hasAnyAncestor import androidx.compose.ui.test.hasTestTag import androidx.compose.ui.test.hasText import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.onNodeWithTag +import androidx.compose.ui.test.onNodeWithText +import androidx.compose.ui.test.performClick import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.annotation.Config +import org.robolectric.shadows.ShadowSystemClock import to.bitkit.repositories.SparkClaimSpeed import to.bitkit.ui.screens.transfer.SparkFundingContract.Quote import to.bitkit.ui.theme.AppThemeSurface -import kotlin.test.assertFalse +import kotlin.test.assertEquals import kotlin.test.assertTrue +import kotlin.time.Duration.Companion.seconds +import kotlin.time.toJavaDuration @Config(sdk = [34]) @RunWith(RobolectricTestRunner::class) @@ -23,45 +32,81 @@ class SpendingFeeGridTest { @get:Rule val composeRule = createComposeRule() + private val quote = Quote( + address = "bcrt1qdeposit", + amountSats = 50_000, + networkFeeSats = 577, + instantFeeSats = 1_093, + laterFeeSats = 198, + spendableSats = 158_234, + ) + @Test - fun `instant marks only the claim fee tiles as estimates`() { + fun `no fee tile carries an estimate prefix`() { setContent(SparkClaimSpeed.Instant) - assertEstimates() + val prefixed = composeRule.onAllNodes(hasText("±", substring = true), useUnmergedTree = true) + .fetchSemanticsNodes() + assertTrue(prefixed.isEmpty()) } @Test - fun `later marks only the claim fee tiles as estimates`() { + fun `the service fee tile shows the claim fee of the selected speed`() { setContent(SparkClaimSpeed.Later) - assertEstimates() + composeRule.onNode( + hasText("SERVICE FEES") and hasAnyAncestor(hasTestTag("SpendingConfirmServiceFee")), + useUnmergedTree = true, + ).assertExists() + composeRule.onNode( + hasText("198", substring = true) and hasAnyAncestor(hasTestTag("SpendingConfirmServiceFee")), + useUnmergedTree = true, + ).assertExists() + } + + @Test + fun `the address row shows only when an address is given`() { + setContent(SparkClaimSpeed.Instant, address = quote.address) + + composeRule.onNodeWithTag("SpendingConfirmAddress", useUnmergedTree = true).assertExists() + composeRule.onNodeWithText("ADDRESS (CONFIRM ON DEVICE)").assertExists() + composeRule.onNodeWithText(quote.address).assertExists() + } + + @Test + fun `the grid has no address row by default`() { + setContent(SparkClaimSpeed.Instant) + + composeRule.onNodeWithTag("SpendingConfirmAddress", useUnmergedTree = true).assertDoesNotExist() } - private fun assertEstimates() { - assertTrue(hasEstimate("SpendingConfirmSpendingFee")) - assertTrue(hasEstimate("SpendingConfirmAmount")) - assertFalse(hasEstimate("SpendingConfirmNetworkFee")) - assertFalse(hasEstimate("SpendingConfirmTotal")) + @Test + fun `a tap on the grid asks to switch the unit`() { + var clicks = 0 + setContent(SparkClaimSpeed.Instant, onClick = { clicks++ }) + ShadowSystemClock.advanceBy(1.seconds.toJavaDuration()) + + composeRule.onNodeWithTag("SpendingConfirmFees").performClick() + + assertEquals(1, clicks) + } + + @Test + fun `the grid is not clickable without a click handler`() { + setContent(SparkClaimSpeed.Instant) + + composeRule.onNodeWithTag( + "SpendingConfirmFees" + ).assert(SemanticsMatcher.keyNotDefined(SemanticsActions.OnClick)) } - private fun hasEstimate(tag: String): Boolean = composeRule - .onAllNodes(hasText("±", substring = true) and hasAnyAncestor(hasTestTag(tag)), useUnmergedTree = true) - .fetchSemanticsNodes() - .isNotEmpty() - - private fun setContent(speed: SparkClaimSpeed) { - val quote = Quote( - address = "bcrt1q", - amountSats = 50_000, - networkFeeSats = 577, - instantFeeSats = 1_093, - laterFeeSats = 198, - spendableSats = 158_234, - ) + private fun setContent(speed: SparkClaimSpeed, address: String? = null, onClick: (() -> Unit)? = null) { composeRule.setContent { // Inspection mode formats amounts without the currency view model, as previews do. CompositionLocalProvider(LocalInspectionMode provides true) { - AppThemeSurface { SpendingFeeGrid(quote = quote, speed = speed) } + AppThemeSurface { + SpendingFeeGrid(quote = quote, speed = speed, address = address, onClick = onClick) + } } } } diff --git a/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingSpeedRowsTest.kt b/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingSpeedRowsTest.kt index 683dbd5ce6..1651e23809 100644 --- a/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingSpeedRowsTest.kt +++ b/app/src/test/java/to/bitkit/ui/screens/transfer/SpendingSpeedRowsTest.kt @@ -2,7 +2,12 @@ package to.bitkit.ui.screens.transfer import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.ui.platform.LocalInspectionMode +import androidx.compose.ui.test.assertIsNotSelected +import androidx.compose.ui.test.assertIsSelected import androidx.compose.ui.test.getUnclippedBoundsInRoot +import androidx.compose.ui.test.hasAnyAncestor +import androidx.compose.ui.test.hasTestTag +import androidx.compose.ui.test.hasText import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.onNodeWithText @@ -26,30 +31,65 @@ class SpendingSpeedRowsTest { @get:Rule val composeRule = createComposeRule() + private val quote = Quote( + address = "bcrt1q", + amountSats = 50_000, + networkFeeSats = 577, + instantFeeSats = 1_350, + laterFeeSats = 99, + spendableSats = 158_234, + ) + @Test - fun `the later fee fits inside its row on a narrow screen`() { - val quote = Quote( - address = "bcrt1q", - amountSats = 50_000, - networkFeeSats = 577, - instantFeeSats = 1_350, - laterFeeSats = 99, - spendableSats = 158_234, - ) - composeRule.setContent { - // Inspection mode formats amounts without the currency view model, as previews do. - CompositionLocalProvider(LocalInspectionMode provides true) { - AppThemeSurface { SpendingSpeedRows(quote = quote, speed = SparkClaimSpeed.Later, onSpeedChange = {}) } - } - } + fun `the normal fee fits inside its row on a narrow screen`() { + // Inspection mode formats amounts without the currency view model, as previews do. + setRows(SparkClaimSpeed.Later) val row = composeRule.onNodeWithTag("SpendingConfirmLater").getUnclippedBoundsInRoot() - val laterFee = composeRule.onNodeWithText("99", substring = true, useUnmergedTree = true) + val normalFee = composeRule.onNodeWithText("99", substring = true, useUnmergedTree = true) .getUnclippedBoundsInRoot() - val instantFee = composeRule.onNodeWithText("350", substring = true, useUnmergedTree = true) + val fastFee = composeRule.onNodeWithText("350", substring = true, useUnmergedTree = true) .getUnclippedBoundsInRoot() - assertTrue(laterFee.right <= row.right, "fee ends at ${laterFee.right}, row at ${row.right}") - assertEquals(instantFee.height.value, laterFee.height.value, 0.5f, "the later fee wraps to a second line") + assertTrue(normalFee.right <= row.right, "fee ends at ${normalFee.right}, row at ${row.right}") + assertEquals(fastFee.height.value, normalFee.height.value, 0.5f, "the normal fee wraps to a second line") + } + + @Test + fun `fast caps its fee and normal estimates it`() { + setRows(SparkClaimSpeed.Instant) + + rowText("SpendingConfirmInstant", "Fast").assertExists() + rowText("SpendingConfirmInstant", "max").assertExists() + rowText("SpendingConfirmLater", "Normal").assertExists() + rowText("SpendingConfirmLater", "Ready in about 30 minutes").assertExists() + rowText("SpendingConfirmLater", "est").assertExists() + } + + @Test + fun `without a quote the rows show no fee`() { + setRows(SparkClaimSpeed.Instant, quote = null) + + rowText("SpendingConfirmInstant", "max").assertDoesNotExist() + rowText("SpendingConfirmLater", "est").assertDoesNotExist() + } + + private fun rowText(rowTag: String, text: String) = + composeRule.onNode(hasText(text) and hasAnyAncestor(hasTestTag(rowTag)), useUnmergedTree = true) + + @Test + fun `only the chosen speed is selected`() { + setRows(SparkClaimSpeed.Later) + + composeRule.onNodeWithTag("SpendingConfirmLater").assertIsSelected() + composeRule.onNodeWithTag("SpendingConfirmInstant").assertIsNotSelected() + } + + private fun setRows(speed: SparkClaimSpeed, quote: Quote? = this.quote) { + composeRule.setContent { + CompositionLocalProvider(LocalInspectionMode provides true) { + AppThemeSurface { SpendingSpeedRows(quote = quote, speed = speed, onSpeedChange = {}) } + } + } } } diff --git a/app/src/test/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignedScreenTest.kt b/app/src/test/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignedScreenTest.kt new file mode 100644 index 0000000000..43f5ca8774 --- /dev/null +++ b/app/src/test/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignedScreenTest.kt @@ -0,0 +1,46 @@ +package to.bitkit.ui.screens.transfer.hardware + +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.ui.platform.LocalInspectionMode +import androidx.compose.ui.test.getUnclippedBoundsInRoot +import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.onNodeWithTag +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config +import to.bitkit.ui.screens.transfer.SparkFundingContract.Quote +import to.bitkit.ui.screens.transfer.SparkFundingContract.UiState +import to.bitkit.ui.theme.AppThemeSurface +import kotlin.test.assertEquals + +@RunWith(RobolectricTestRunner::class) +class SpendingHwSignedScreenTest { + @get:Rule + val composeRule = createComposeRule() + + @Config(sdk = [34], qualifiers = "w360dp-h640dp") + @Test + fun `the check sits 32 dp under the fee grid on a small screen`() { + val quote = Quote( + address = "bcrt1q", + amountSats = 50_000, + networkFeeSats = 1_141, + instantFeeSats = 1_350, + laterFeeSats = 198, + spendableSats = 120_000, + ) + composeRule.setContent { + // Inspection mode formats amounts without the currency view model, as previews do. + CompositionLocalProvider(LocalInspectionMode provides true) { + AppThemeSurface { Content(state = UiState(quote = quote, hwWalletId = "trezor")) } + } + } + + val grid = composeRule.onNodeWithTag("SpendingConfirmFees").getUnclippedBoundsInRoot() + val check = composeRule.onNodeWithTag("HardwareTransferSignedCheck").getUnclippedBoundsInRoot() + + assertEquals(32f, (check.top - grid.bottom).value, 0.5f) + } +} diff --git a/changelog.d/next/1963.changed.md b/changelog.d/next/1963.changed.md new file mode 100644 index 0000000000..ee4a5c746e --- /dev/null +++ b/changelog.d/next/1963.changed.md @@ -0,0 +1 @@ +Transfers to spending show the new fee breakdown with Fast and Normal speeds, a clearer Learn More, and an updated hardware wallet signing screen. diff --git a/docs/screens-map.md b/docs/screens-map.md index 94d8d52997..cae3a8b81f 100644 --- a/docs/screens-map.md +++ b/docs/screens-map.md @@ -129,18 +129,18 @@ Frame names are stable across handoff iterations; node ids are not, so the map l | Android | Figma | | - | - | -| FundingScreen.kt | `todo` | +| FundingScreen.kt | Lightning Onboarding From Suggestion Card › Fund Spending Balance / No Bitkit Savings | | SavingsAdvancedScreen.kt | Transfer to Savings (Channel Closure or Spark transfer) › Advanced | | SavingsAvailabilityScreen.kt | Transfer to Savings (Channel Closure or Spark transfer) › Network Fee & Availability | | SavingsConfirmScreen.kt | Transfer to Savings (Channel Closure or Spark transfer) › Review Transfer to Savings | | SavingsIntroScreen.kt | Transfer to Savings (Channel Closure or Spark transfer) › Transfer to Savings Intro | | SavingsProgressScreen.kt | Transfer to Savings (Channel Closure or Spark transfer) › Funds In Transfer | | SettingUpScreen.kt | Funds In Transfer (spark) › Transfer - Processing Payment | -| SpendingAmountScreen.kt | Transfer to Spending Balance From Savings (Channel Opening) › Transfer to Spending Input | -| SpendingConfirmScreen.kt | Transfer to Spending Balance From Savings (Channel Opening) › Transfer to Spending Confirm | -| SpendingIntroScreen.kt | Transfer to Spending Balance From Savings (Channel Opening) › Transfer to Spending Intro | -| TransferIntroScreen.kt | Lightning Onboarding From Suggestion Card › Lightning onboarding Intro | -| TransferLearnMoreScreen.kt | Transfer to Spending Balance From Savings (Channel Opening) › Transfer to Spending Receiving Capacity | +| SpendingAmountScreen.kt | Transfer to Spending Balance From Savings (Spark) › Transfer to Spending / Transfer to Spending Balance From HW Device (spark) › Transfer to Spending | +| SpendingConfirmScreen.kt | Transfer to Spending Balance From Savings (Spark) › Review | +| SpendingIntroScreen.kt | Transfer to Spending Balance From Savings (Spark) › Introduction | +| TransferIntroScreen.kt | Lightning Onboarding From Suggestion Card › Introduction | +| TransferLearnMoreScreen.kt | Transfer to Spending Balance From Savings (Spark) › Learn More | ## ui/screens/transfer/external @@ -156,8 +156,8 @@ Frame names are stable across handoff iterations; node ids are not, so the map l | Android | Figma | | - | - | -| SpendingHwSignScreen.kt | Transfer to Spending Balance From HW Device › Transfer to Spending Confirm HW | -| SpendingHwSignedScreen.kt | Transfer to Spending Balance From HW Device › Transfer to Spending Confirmed HW | +| SpendingHwSignScreen.kt | Transfer to Spending Balance From HW Device (spark) › Review & Sign | +| SpendingHwSignedScreen.kt | Transfer to Spending Balance From HW Device (spark) › Transfer Confirmed (TX signed) | ## ui/screens/trezor diff --git a/journeys/amount-limits/external-amount-over-max.xml b/journeys/amount-limits/external-amount-over-max.xml index b633dbdced..8e70b82f2e 100644 --- a/journeys/amount-limits/external-amount-over-max.xml +++ b/journeys/amount-limits/external-amount-over-max.xml @@ -13,8 +13,8 @@ Open Settings, then the "Advanced" tab, then "Lightning Connections" - Tap "Get Started" to open the funding options screen - Tap "Manual Setup" (testTag "FundManual") + Tap "Get Started", or "Add Connection" (testTag "add_connection_button") when Spark is connected, to open the funding options screen + Tap "Manual setup" (testTag "FundManual") Type the node id into the node id field (testTag "NodeIdInput") Type the host into the host field (testTag "HostInput") Type the port into the port field (testTag "PortInput") diff --git a/journeys/backup-restore/restore-keeps-tags-and-closed-channels.xml b/journeys/backup-restore/restore-keeps-tags-and-closed-channels.xml index 2bfe8af14f..daa14cef63 100644 --- a/journeys/backup-restore/restore-keeps-tags-and-closed-channels.xml +++ b/journeys/backup-restore/restore-keeps-tags-and-closed-channels.xml @@ -24,7 +24,7 @@ Tap the received activity row (testTag "ActivityShort-0") and verify its detail screen opens Tap "Tag" (testTag "ActivityTag"), enter the tag restoretag in the tag input (testTag "AddTagInput") and save it (testTag "AddTagSave") Verify the tag restoretag is listed on the activity detail screen (testTag "ActivityTags"), then go back to Home - Open Settings, then the "Advanced" tab (testTag "Tab-advanced"), then "Lightning Connections" (testTag "Channels"), tap add connection (testTag "add_connection_button") and then "Manual Setup" (testTag "FundManual") + Open Settings, then the "Advanced" tab (testTag "Tab-advanced"), then "Lightning Connections" (testTag "Channels"), tap add connection (testTag "add_connection_button") and then "Manual setup" (testTag "FundManual") Enter the staging LSP node from `./lsp GET /info` into the node id (testTag "NodeIdInput"), host (testTag "HostInput") and port (testTag "PortInput") fields, continue, fund the connection with 100 000 sats and confirm it Mine confirmations with `./lsp POST /regtest/chain/mine '{"count":3}'` and wait for the connection to open Open Settings, then the "Advanced" tab (testTag "Tab-advanced"), then "Lightning Connections" (testTag "Channels") diff --git a/journeys/cjit-notifications/non-cjit-channel-no-payment-notification.xml b/journeys/cjit-notifications/non-cjit-channel-no-payment-notification.xml index 3af134abaf..cd4a6fffdc 100644 --- a/journeys/cjit-notifications/non-cjit-channel-no-payment-notification.xml +++ b/journeys/cjit-notifications/non-cjit-channel-no-payment-notification.xml @@ -9,7 +9,7 @@ Keep the app in the foreground on the wallet home screen - Open a regular spending channel through Settings › Advanced › Lightning Connections › add connection › Manual Setup (testTag "FundManual") to the staging LSP node from `./lsp GET /info`, funding it with some sats + Open a regular spending channel through Settings › Advanced › Lightning Connections › add connection › Manual setup (testTag "FundManual") to the staging LSP node from `./lsp GET /info`, funding it with some sats Mine confirmations if required: ./lsp POST /regtest/chain/mine '{"count":3}' Wait for the ChannelReady event (~5-10s) Verify an in-app "Spending balance ready" toast appears (testTag "SpendingBalanceReadyToast") diff --git a/journeys/hardware-wallet/transfer-to-spending.xml b/journeys/hardware-wallet/transfer-to-spending.xml index 867791fe5a..a4c75bb6fa 100644 --- a/journeys/hardware-wallet/transfer-to-spending.xml +++ b/journeys/hardware-wallet/transfer-to-spending.xml @@ -4,7 +4,9 @@ Your Device -> Transaction Signed -> setting-up progress, then verifies the new transfer is represented once in the hardware wallet's Core activity scope. Requires Spark connected on its regtest, built with `ESPLORA_URL` on Spark's regtest chain through `scripts/spark-regtest-esplora.py` (without it the transfer opens the Transfer Unavailable sheet), and a paired Bridge emulator whose native-segwit account holds spendable regtest funds and - at least one older hardware receive row with a distinct amount. + at least one older hardware receive row with a distinct amount. The hardware wallet syncs over Electrum, not + `ESPLORA_URL`, so fund the Trezor on the Electrum regtest (`./lsp`); its signed deposit then never reaches + Spark's chain, and the transfer stays in progress after the journey ends. @@ -32,7 +34,7 @@ Tap "Continue" (testTag "HardwareTransferAmountContinue") and wait for the fee estimate - Verify the sign screen opens (testTag "HardwareTransferSign"), titled "SIGN WITH YOUR DEVICE", showing the NETWORK FEES, SPENDING FEE, TO SPENDING and TOTAL cells, the Instant and Later rows, the Learn More button, and the Trezor illustration + Verify the sign screen opens (testTag "HardwareTransferSign"), titled "SIGN WITH YOUR DEVICE", showing the NETWORK FEES, SERVICE FEES, TO SPENDING and TOTAL cells, the deposit address on one line under "ADDRESS (CONFIRM ON DEVICE)" (testTag "SpendingConfirmAddress"), cut with an ellipsis at its end, the Fast and Normal rows with Fast selected, and the angled Trezor illustration running behind the "Open Trezor Connect" button Tap "Open Trezor Connect" (testTag "HardwareTransferOpenTrezorConnect"). If the fees rose since they were shown, verify a "Fees changed" toast, the fee cells refresh, and tap "Open Trezor Connect" again; otherwise signing starts immediately diff --git a/journeys/transfer/spark-transfer-status.xml b/journeys/transfer/spark-transfer-status.xml index 67d9e14e7d..7f91b4673b 100644 --- a/journeys/transfer/spark-transfer-status.xml +++ b/journeys/transfer/spark-transfer-status.xml @@ -3,10 +3,10 @@ Verifies the transfer status screen after a transfer to spending through Spark, against the Figma section "Funds In Transfer (spark)". Every in-progress frame shows the nav title "Transfer Funds" with the menu and no back button, three steps, the active step's label under them and one bottom-pinned button; headlines show in - capitals. A fast (Instant) transfer moves through "Processing Payment" (step 1, Spark has not listed the + capitals. A Fast transfer moves through "Processing Payment" (step 1, Spark has not listed the deposit), "Payment Successful" (step 1 done, Spark lists it) and "Adding To Spending Balance" (steps 1 and 2 done), all with the transfer arrows in dashed rings, and ends on "Transfer Successful" with the check and - "Awesome!". A normal speed (Later) transfer shows the same steps with "This should take about 30 minutes.". + "Awesome!". A Normal transfer shows the same steps with "This should take about 30 minutes.". Whether Spark reprices the fast transfer or offers none is the provider's call, so those two frames (coins in place of the arrows) are conditional steps here; TransferStatusTest.kt and SettingUpScreenTest.kt cover every frame. On Spark's regtest a fast @@ -19,13 +19,13 @@ Tap the Savings balance card (testTag "ActivitySavings"), tap "Transfer To Spending" (testTag "TransferToSpending"), tap "25%" (testTag "SpendingAmountQuarter") and tap "Continue" (testTag "SpendingAmountContinue") - Verify "Instant" (testTag "SpendingConfirmInstant") is selected and swipe to confirm + Verify "Fast" (testTag "SpendingConfirmInstant") is selected and swipe to confirm Verify the status screen (testTag "LightningSettingUp") shows "Transfer Funds", the headline "Funds in transfer", the text (testTag "SettingUpText") "Please wait, your funds transfer is in progress. This should take a few minutes.", step 1 active with "Processing Payment", and "Continue Using Bitkit" (testTag "TransferSuccess-button") Wait up to 3 minutes for "Payment Successful" with step 1 checked, then, if it shows before the transfer ends, "Adding To Spending Balance" with steps 1 and 2 checked; each keeps the same headline, text and button, and the label never goes back to an earlier step If the fast transfer fee rose, verify the headline "Fast transfer fee changed", the text "The fast transfer fee is now ₿ …. Approve to access your funds quickly, or wait ±30 min.", the coins, the label "Fast Transfer Fee Changed" and "Wait" (testTag "SettingUpWait") and "Approve" (testTag "SettingUpPay") side by side; tap "Wait" and verify the headline "Funds in transfer", the text ending "about 30 minutes." and the label "Using Normal Transfer Speed" on step 3 If the fast transfer is unavailable, verify the headline "Fast transfer unavailable", the text ending "about 30 minutes.", the coins and the label "Using Normal Transfer Speed" Wait for "Transfer Successful" (testTag "TransferSuccess"), up to 3 minutes for a fast transfer; after Wait or an unavailable fast transfer, up to 10 minutes for the deposit's 3 confirmations (Spark's regtest mines about once a minute): the headline "Funds moved to spending", "Your funds have been transferred and your spending balance is ready to use.", the check and "Awesome!" (testTag "TransferSuccess-button") Tap "Awesome!" and verify the wallet home screen shows the higher Spending balance - Start another transfer the same way, tap "Later" (testTag "SpendingConfirmLater"), swipe to confirm and verify the text ends "about 30 minutes." with step 1 active and "Processing Payment", then "Payment Successful" once Spark lists the deposit + Start another transfer the same way, tap "Normal" (testTag "SpendingConfirmLater"), swipe to confirm and verify the text ends "about 30 minutes." with step 1 active and "Processing Payment", then "Payment Successful" once Spark lists the deposit diff --git a/journeys/transfer/spark-transfer-to-spending.xml b/journeys/transfer/spark-transfer-to-spending.xml index 7d3712dccf..2a195bcb78 100644 --- a/journeys/transfer/spark-transfer-to-spending.xml +++ b/journeys/transfer/spark-transfer-to-spending.xml @@ -1,12 +1,13 @@ Verifies the transfer to spending flow on Spark. With Spark ready, the Spending suggestion card opens the - "Spending Balance" intro once, then Funding, which leads with "Transfer From Savings" (testTag "FundTransfer") - and "Use Other Wallet" (testTag "FundReceive") above "Manual Setup" (testTag "FundManual"). Transfer from - Savings opens the "Transfer to spending" intro once, then the amount screen (testTag "SpendingAmount"). The - confirm screen shows "Network fees", "Spending fee", "To spending" and "Total", and the Instant and Later rows: - Both rows show their fee as "±" in sats and fiat, and picking a row updates the Spending fee and To spending - tiles. Learn more explains Instant and Later. Whether the provider offers Instant needs a real deposit Spark + "Spending Balance" intro once, then Funding, which lists "Transfer from Savings" (testTag "FundTransfer"), + "Transfer from HW wallet" (testTag "FundHardware"), "Use other wallet" (testTag "FundReceive") and "Manual setup" + (testTag "FundManual"), in that order, with no Learn More button. Transfer from Savings opens the "Transfer to + spending" intro once, then the amount screen (testTag "SpendingAmount"). The confirm screen shows "Network fees", + "Service fees", "To spending" and "Total", and the Fast and Normal rows: Fast's fee is marked "max" and Normal's + "est", and picking a row updates the Service fees and To spending tiles. Learn more explains the Fast and Later + transfer speeds and the spending balance. Whether the provider offers a fast transfer needs a real deposit Spark sees, so this journey stops before the swipe; the states after it are covered by SettingUpScreen previews and SparkRepoTest. @@ -16,14 +17,18 @@ Tap the Spending suggestion card and verify the "Spending Balance" intro opens; tap "Get Started" (testTag "TransferIntro-button") - Verify "Transfer From Savings" (testTag "FundTransfer") and "Use Other Wallet" (testTag "FundReceive") are enabled above "Manual Setup" (testTag "FundManual") - Tap "Transfer From Savings" and verify the "Transfer to spending" intro opens; tap "Get Started" (testTag "SpendingIntro-button") + Verify "Transfer from Savings" (testTag "FundTransfer"), "Transfer from HW wallet" (testTag "FundHardware"), "Use other wallet" (testTag "FundReceive") and "Manual setup" (testTag "FundManual") are listed in that order and enabled, with no "Learn More" button (testTag "FundLearnMore") + Tap "Transfer from Savings" and verify the "Transfer to spending" intro opens; tap "Get Started" (testTag "SpendingIntro-button") Verify the amount screen (testTag "SpendingAmount") opens and wait until the available amount (testTag "SpendingAmountAvailable") shows a positive value Tap "25%" (testTag "SpendingAmountQuarter") and verify the amount is a quarter of the available amount; tap "Max" (testTag "SpendingAmountMax") and verify it equals the available amount - Tap "Continue" (testTag "SpendingAmountContinue") and verify the confirm screen shows "Network fees", "Spending fee", "To spending" and "Total", with "Instant" (testTag "SpendingConfirmInstant") selected and its fee shown as "±" - Tap "Later" (testTag "SpendingConfirmLater") and verify the Spending fee shows "±" with a lower amount and "To spending" grows by the difference - Tap "Learn More" (testTag "SpendingConfirmMore"), verify the "Transfer speed" screen with the spending balance bar, and tap "Understood" (testTag "LiquidityContinue") - Verify the confirm screen still shows Later selected; go back to the wallet home + Tap "Continue" (testTag "SpendingAmountContinue") and verify the confirm screen shows "Network fees", "Service fees", "To spending" and "Total", with "Fast" (testTag "SpendingConfirmInstant") selected, its fee marked "max", and "Normal" (testTag "SpendingConfirmLater") below it, its fee marked "est" + Verify "Service fees" equals the Fast row's fee, and "To spending" equals the amount less that fee + Tap "Normal" and verify "Service fees" shows the Normal row's fee and "To spending" grows by the difference, while "Network fees" and "Total" stay the same + Tap the fees (testTag "SpendingConfirmFees") and verify every amount on the screen switches to the local currency; tap them again and verify they switch back to bitcoin + Tap "Learn More" (testTag "SpendingConfirmMore"), verify the screen explains the Fast and Later transfer speeds and the spending balance, then tap "Understood" (testTag "LiquidityContinue") + Verify the confirm screen still shows Normal selected + Tap the fees (testTag "SpendingConfirmFees") so the amounts show the local currency, go back to the amount screen and verify the amount (testTag "SpendingAmountNumberField") shows in the local currency; tap delete (testTag "NRemove") and verify the amount loses its last typed digit in the local currency (50.00 becomes 50.0) with no maximum toast + Tap the unit button (testTag "SpendingNumberPadUnit") to switch back to bitcoin; go back to the wallet home Tap the Savings balance card (testTag "ActivitySavings"), tap "Transfer To Spending" (testTag "TransferToSpending") and verify the amount screen opens directly, with no intro diff --git a/journeys/transfer/transfer-banner-opens-progress.xml b/journeys/transfer/transfer-banner-opens-progress.xml index cc434e00cd..97172d8a0e 100644 --- a/journeys/transfer/transfer-banner-opens-progress.xml +++ b/journeys/transfer/transfer-banner-opens-progress.xml @@ -1,8 +1,9 @@ Verifies that tapping the "TRANSFER IN PROGRESS" banner on Home reopens the "Funds in transfer" screen of the - pending transfer to spending at its current step, also after a relaunch. A Later transfer keeps its deposit - pending until 3 confirmations, so the banner stays up while the journey taps it. + pending transfer to spending at its current step, also after a relaunch. Spark's regtest mines about once a + minute and claims a Normal deposit in the first block or two after it, so the journey relaunches right after + the first banner tap, while the banner is still up. Precondition: a Debug build with Spark connected on its regtest, launched against that regtest's Esplora (as spark-transfer-to-spending.xml sets up), a wallet with a positive confirmed on-chain Savings balance, no pending @@ -11,12 +12,11 @@ Tap the Savings balance card (testTag "ActivitySavings"), then "Transfer To Spending" (testTag "TransferToSpending"); tap "Get Started" (testTag "SpendingIntro-button") if the intro appears Tap "25%" (testTag "SpendingAmountQuarter") and "Continue" (testTag "SpendingAmountContinue") - Tap "Later" (testTag "SpendingConfirmLater") and swipe the "Swipe To Transfer" handle (testTag "GRAB") fully to the right + Tap "Normal" (testTag "SpendingConfirmLater") and swipe the "Swipe To Transfer" handle (testTag "GRAB") fully to the right Verify the "Funds in transfer" screen (testTag "LightningSettingUp") opens, then tap "Continue Using Bitkit" (testTag "TransferSuccess-button") Verify Home shows the "TRANSFER IN PROGRESS" banner (testTag "ActivityBanner") Tap the banner and verify "Funds in transfer" (testTag "LightningSettingUp") opens at its current step: "Processing Payment", or "Payment Successful" once Spark lists the deposit, with "This should take about 30 minutes." (testTag "SettingUpText") - Tap "Continue Using Bitkit" (testTag "TransferSuccess-button") and verify the wallet home screen shows with the banner still visible - Relaunch the app, tap the banner and verify the same screen and step open again - Wait up to 10 minutes for the deposit's 3 confirmations (Spark's regtest mines about once a minute) until the screen shows the transfer as done (testTag "TransferSuccess"); tap its button and verify Home no longer shows the banner + Relaunch the app at once, tap the banner and verify the same screen opens, at the same or a later step + Wait for Spark to claim the deposit until the screen shows the transfer as done (testTag "TransferSuccess"); tap its button and verify Home no longer shows the banner diff --git a/journeys/transfer/transfer-unavailable-sheet.xml b/journeys/transfer/transfer-unavailable-sheet.xml index e8160a993f..e6af2bd96f 100644 --- a/journeys/transfer/transfer-unavailable-sheet.xml +++ b/journeys/transfer/transfer-unavailable-sheet.xml @@ -8,11 +8,13 @@ (testTag "TransferUnavailableContinue"), which opens the existing Manual Setup screen. Receive's Lightning path shows the same sheet content. - Precondition: dev build, onboarded wallet with a positive on-chain Savings balance, no channels and Spark - not running (a build without a Breez API key, or Spark's regtest unreachable), or a regtest build without - `ESPLORA_URL`, whose deposits Spark can't see; with Spark ready on its chain, see - spark-transfer-to-spending.xml. Start on - the wallet home screen. + Precondition: dev build, onboarded wallet with a positive on-chain Savings balance, an empty Spending + balance, no channels and Spark failing to start. On regtest Spark needs no Breez key and starts from local + state even when its servers are blocked; on a debug build, stop it by replacing the app's + `files/regtest/wallet0/spark` directory with a plain file through `run-as`, then relaunch (the log shows + "Failed to start Spark wallet"). A build without `ESPLORA_URL` reaches the sheet from the Transfer To + Spending entries, but Lightning Connections and Receive need Spark down; with Spark connected, see + spark-transfer-to-spending.xml. Start on the wallet home screen. Tap the Savings balance card (testTag "ActivitySavings") and verify "Transfer To Spending" (testTag "TransferToSpending") is shown @@ -21,7 +23,7 @@ Tap "Continue" and verify the sheet closes and the "MANUAL SETUP" screen shows the node id (testTag "NodeIdInput"), host (testTag "HostInput") and port (testTag "PortInput") fields Go back to the wallet home, tap the Spending balance card (testTag "ActivitySpending"), tap the transfer button (testTag "TransferFromSavings") and verify the same sheet opens; close it Open Settings › Advanced › Lightning Connections, tap add connection (testTag "add_connection_button") and verify the screen text reads "Automatic transfers to your spending balance are no longer available. Use your own node, or set up a connection with another provider." - Verify "Manual Setup" (testTag "FundManual") is the first option and enabled, and "Transfer From Savings" (testTag "FundTransfer"), "Transfer from HW wallet" (testTag "FundHardware") and "Use Other Wallet" (testTag "FundReceive") below it are disabled; tap "Transfer From Savings" and verify nothing opens + Verify "Manual setup" (testTag "FundManual") is the first option and enabled, and "Transfer from Savings" (testTag "FundTransfer"), "Transfer from HW wallet" (testTag "FundHardware") and "Use other wallet" (testTag "FundReceive") below it are disabled; tap "Transfer from Savings" and verify nothing opens Tap "Learn More" (testTag "FundLearnMore") at the bottom and verify the browser opens blog.bitkit.to, then return to Bitkit and go back to the wallet home Tap "Receive" (testTag "Receive"), select the Spending tab (testTag "Tab-spending") and tap "Receive Lightning Funds" Verify the screen titled "Transfer Unavailable" shows "MANUAL SETUP REQUIRED" and "Automatic transfers to your spending balance are no longer available. Use your own node, or set up a connection with another provider.", with a back button