secant-android-wallet/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/restore/view/RestoreView.kt

656 lines
22 KiB
Kotlin
Raw Normal View History

2023-03-21 12:04:16 -07:00
@file:Suppress("TooManyFunctions")
package co.electriccoin.zcash.ui.screen.restore.view
2021-12-09 12:21:30 -08:00
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
2021-12-09 12:21:30 -08:00
import androidx.compose.foundation.layout.Column
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
import androidx.compose.foundation.layout.PaddingValues
2021-12-09 12:21:30 -08:00
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
2021-12-09 12:21:30 -08:00
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
2021-12-09 12:21:30 -08:00
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
2022-02-21 06:33:40 -08:00
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
2022-02-21 06:33:40 -08:00
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface
2022-02-21 06:33:40 -08:00
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.material3.TopAppBar
2021-12-09 12:21:30 -08:00
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
2021-12-09 12:21:30 -08:00
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Alignment.Companion.CenterVertically
import androidx.compose.ui.ExperimentalComposeUiApi
2021-12-09 12:21:30 -08:00
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.shadow
2021-12-09 12:21:30 -08:00
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.Color
2023-08-04 04:01:16 -07:00
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
2021-12-09 12:21:30 -08:00
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextAlign
2021-12-09 12:21:30 -08:00
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
2023-03-21 12:04:16 -07:00
import cash.z.ecc.android.sdk.model.BlockHeight
import cash.z.ecc.android.sdk.model.ZcashNetwork
2021-12-09 12:21:30 -08:00
import cash.z.ecc.sdk.model.SeedPhraseValidation
import co.electriccoin.zcash.spackle.model.Index
import co.electriccoin.zcash.ui.BuildConfig
import co.electriccoin.zcash.ui.R
import co.electriccoin.zcash.ui.common.SecureScreen
import co.electriccoin.zcash.ui.design.MINIMAL_WEIGHT
import co.electriccoin.zcash.ui.design.component.Body
import co.electriccoin.zcash.ui.design.component.CHIP_GRID_ROW_SIZE
import co.electriccoin.zcash.ui.design.component.Chip
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
import co.electriccoin.zcash.ui.design.component.FormTextField
import co.electriccoin.zcash.ui.design.component.GradientSurface
import co.electriccoin.zcash.ui.design.component.Header
import co.electriccoin.zcash.ui.design.component.NavigationButton
import co.electriccoin.zcash.ui.design.component.PrimaryButton
2023-03-21 12:04:16 -07:00
import co.electriccoin.zcash.ui.design.component.TertiaryButton
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
2023-03-21 12:04:16 -07:00
import co.electriccoin.zcash.ui.design.theme.ZcashTheme.dimens
import co.electriccoin.zcash.ui.screen.restore.RestoreTag
import co.electriccoin.zcash.ui.screen.restore.model.ParseResult
2023-03-21 12:04:16 -07:00
import co.electriccoin.zcash.ui.screen.restore.model.RestoreStage
import co.electriccoin.zcash.ui.screen.restore.state.RestoreState
import co.electriccoin.zcash.ui.screen.restore.state.WordList
import co.electriccoin.zcash.ui.screen.restore.state.wordValidation
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.ImmutableSet
import kotlinx.collections.immutable.persistentHashSetOf
import kotlinx.coroutines.launch
2021-12-09 12:21:30 -08:00
@Preview("Restore Wallet")
@Composable
private fun PreviewRestore() {
ZcashTheme(darkTheme = false) {
2021-12-09 12:21:30 -08:00
GradientSurface {
RestoreWallet(
2023-03-21 12:04:16 -07:00
ZcashNetwork.Mainnet,
restoreState = RestoreState(RestoreStage.Seed),
completeWordList = persistentHashSetOf(
2021-12-09 12:21:30 -08:00
"abandon",
"ability",
"able",
"about",
"above",
"absent",
"absorb",
"abstract",
"rib",
"ribbon"
2021-12-09 12:21:30 -08:00
),
userWordList = WordList(listOf("abandon", "absorb")),
2023-03-21 12:04:16 -07:00
restoreHeight = null,
setRestoreHeight = {},
2021-12-09 12:21:30 -08:00
onBack = {},
paste = { "" },
onFinished = {}
)
}
}
}
@Preview("Restore Complete")
@Composable
private fun PreviewRestoreComplete() {
ZcashTheme(darkTheme = false) {
2021-12-09 12:21:30 -08:00
RestoreComplete(
onComplete = {}
)
}
}
2023-03-21 12:04:16 -07:00
/**
* Note that the restore review doesn't allow the user to go back once the seed is entered correctly.
*
* @param restoreHeight A null height indicates no user input.
*/
@Suppress("LongParameterList", "LongMethod")
@OptIn(ExperimentalComposeUiApi::class)
2021-12-09 12:21:30 -08:00
@Composable
fun RestoreWallet(
2023-03-21 12:04:16 -07:00
zcashNetwork: ZcashNetwork,
restoreState: RestoreState,
completeWordList: ImmutableSet<String>,
2021-12-09 12:21:30 -08:00
userWordList: WordList,
2023-03-21 12:04:16 -07:00
restoreHeight: BlockHeight?,
setRestoreHeight: (BlockHeight?) -> Unit,
2021-12-09 12:21:30 -08:00
onBack: () -> Unit,
paste: () -> String?,
onFinished: () -> Unit
) {
var textState by rememberSaveable { mutableStateOf("") }
val focusRequester = remember { FocusRequester() }
val parseResult = ParseResult.new(completeWordList, textState)
2023-03-21 12:04:16 -07:00
val currentStage = restoreState.current.collectAsStateWithLifecycle().value
Scaffold(
topBar = {
RestoreTopAppBar(
onBack = {
if (currentStage.hasPrevious()) {
restoreState.goPrevious()
} else {
onBack()
}
},
isShowClear = currentStage == RestoreStage.Seed,
onClear = { userWordList.set(emptyList()) }
)
},
bottomBar = {
when (currentStage) {
RestoreStage.Seed -> {
RestoreSeedBottomBar(
userWordList = userWordList,
parseResult = parseResult,
2023-03-21 12:04:16 -07:00
setTextState = { textState = it },
focusRequester = focusRequester,
modifier = Modifier.padding(
bottom = ZcashTheme.dimens.spacingHuge
).fillMaxWidth()
)
}
2023-03-21 12:04:16 -07:00
RestoreStage.Birthday -> {
// No content
}
RestoreStage.Complete -> {
// No content
}
2021-12-09 12:21:30 -08:00
}
2023-03-21 12:04:16 -07:00
},
content = { paddingValues ->
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
val commonModifier = Modifier
// We intentionally set the bottom smaller to save space in case of the software keyboard is visible
.padding(
top = paddingValues.calculateTopPadding() + dimens.spacingDefault,
bottom = paddingValues.calculateBottomPadding() + dimens.spacingSmall,
start = dimens.spacingDefault,
end = dimens.spacingDefault
)
2023-03-21 12:04:16 -07:00
when (currentStage) {
RestoreStage.Seed -> {
if (BuildConfig.IS_SECURE_SCREEN_ENABLED) {
SecureScreen()
}
2023-03-21 12:04:16 -07:00
RestoreSeedMainContent(
userWordList = userWordList,
textState = textState,
setTextState = { textState = it },
focusRequester = focusRequester,
parseResult = parseResult,
paste = paste,
goNext = { restoreState.goNext() },
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
modifier = commonModifier
2023-03-21 12:04:16 -07:00
)
}
RestoreStage.Birthday -> {
RestoreBirthday(
zcashNetwork = zcashNetwork,
initialRestoreHeight = restoreHeight,
setRestoreHeight = setRestoreHeight,
onNext = { restoreState.goNext() },
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
modifier = commonModifier
2023-03-21 12:04:16 -07:00
)
}
RestoreStage.Complete -> {
// In some cases we need to hide the software keyboard manually, as it stays shown after
// input on prior screens
LocalSoftwareKeyboardController.current?.hide()
RestoreComplete(
onComplete = onFinished,
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
modifier = commonModifier
2023-03-21 12:04:16 -07:00
)
}
}
2021-12-09 12:21:30 -08:00
}
2023-03-21 12:04:16 -07:00
)
2021-12-09 12:21:30 -08:00
}
@Composable
@OptIn(ExperimentalMaterial3Api::class)
2023-03-21 12:04:16 -07:00
private fun RestoreTopAppBar(onBack: () -> Unit, isShowClear: Boolean, onClear: () -> Unit) {
TopAppBar(
title = { Text(text = stringResource(id = R.string.restore_title)) },
navigationIcon = {
2021-12-09 12:21:30 -08:00
IconButton(
onClick = onBack
) {
Icon(
imageVector = Icons.Filled.ArrowBack,
contentDescription = stringResource(R.string.restore_back_content_description)
)
}
},
actions = {
2023-03-21 12:04:16 -07:00
if (isShowClear) {
NavigationButton(onClick = onClear, stringResource(R.string.restore_button_clear))
}
2021-12-09 12:21:30 -08:00
}
)
2021-12-09 12:21:30 -08:00
}
// TODO [#672]: Implement custom seed phrase pasting for wallet import
// TODO [#672]: https://github.com/zcash/secant-android-wallet/issues/672
2023-01-17 11:13:46 -08:00
2023-03-21 12:04:16 -07:00
@OptIn(ExperimentalComposeUiApi::class)
@Suppress("UNUSED_PARAMETER", "LongParameterList")
2021-12-09 12:21:30 -08:00
@Composable
2023-03-21 12:04:16 -07:00
private fun RestoreSeedMainContent(
2021-12-09 12:21:30 -08:00
userWordList: WordList,
2023-03-21 12:04:16 -07:00
textState: String,
setTextState: (String) -> Unit,
focusRequester: FocusRequester,
parseResult: ParseResult,
2023-03-21 12:04:16 -07:00
paste: () -> String?,
goNext: () -> Unit,
modifier: Modifier = Modifier
2021-12-09 12:21:30 -08:00
) {
val currentUserWordList = userWordList.current.collectAsStateWithLifecycle().value
val scrollState = rememberScrollState()
val scope = rememberCoroutineScope()
2021-12-09 12:21:30 -08:00
if (parseResult is ParseResult.Add) {
2023-03-21 12:04:16 -07:00
setTextState("")
2021-12-09 12:21:30 -08:00
userWordList.append(parseResult.words)
}
2023-03-21 12:04:16 -07:00
val isSeedValid = userWordList.wordValidation().collectAsState(null).value is SeedPhraseValidation.Valid
Column(
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
Modifier
.fillMaxHeight()
.verticalScroll(scrollState)
.then(modifier),
horizontalAlignment = Alignment.CenterHorizontally
) {
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
Body(text = stringResource(id = R.string.restore_seed_instructions))
Spacer(Modifier.height(dimens.spacingSmall))
2021-12-09 12:21:30 -08:00
ChipGridWithText(currentUserWordList)
2023-03-21 12:04:16 -07:00
if (!isSeedValid) {
NextWordTextField(
parseResult = parseResult,
text = textState,
setText = { setTextState(it) },
modifier = Modifier.focusRequester(focusRequester)
)
}
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
Spacer(
modifier = Modifier
.fillMaxHeight()
.weight(MINIMAL_WEIGHT)
)
2023-03-21 12:04:16 -07:00
PrimaryButton(
onClick = goNext,
text = stringResource(id = R.string.restore_seed_button_restore),
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
enabled = isSeedValid,
outerPaddingValues = PaddingValues(top = dimens.spacingSmall)
2023-03-21 12:04:16 -07:00
)
Spacer(modifier = Modifier.height(ZcashTheme.dimens.spacingDefault))
2021-12-09 12:21:30 -08:00
}
2023-03-21 12:04:16 -07:00
if (isSeedValid) {
// Hides the keyboard, making it easier for users to see the next button
LocalSoftwareKeyboardController.current?.hide()
}
// Cause text field to refocus
2021-12-09 12:21:30 -08:00
DisposableEffect(parseResult) {
2023-03-21 12:04:16 -07:00
if (!isSeedValid) {
focusRequester.requestFocus()
}
scope.launch {
scrollState.scrollTo(scrollState.maxValue)
}
2021-12-09 12:21:30 -08:00
onDispose { }
}
}
2023-03-21 12:04:16 -07:00
@Composable
private fun RestoreSeedBottomBar(
userWordList: WordList,
parseResult: ParseResult,
setTextState: (String) -> Unit,
focusRequester: FocusRequester,
modifier: Modifier = Modifier
) {
val isSeedValid = userWordList.wordValidation().collectAsState(null).value is SeedPhraseValidation.Valid
// Hide the field once the user has completed the seed phrase; if they need the field back then
// the user can hit the clear button
if (!isSeedValid) {
Column(
modifier = modifier
) {
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
Warn(
parseResult = parseResult,
modifier = Modifier
.fillMaxWidth()
// Note we don't set the top, as it's set by the confirm button above
.padding(
bottom = dimens.spacingDefault,
start = dimens.spacingDefault,
end = dimens.spacingDefault
)
)
2023-03-21 12:04:16 -07:00
Autocomplete(parseResult = parseResult, {
setTextState("")
userWordList.append(listOf(it))
focusRequester.requestFocus()
})
}
}
}
2021-12-09 12:21:30 -08:00
@Composable
private fun ChipGridWithText(
userWordList: ImmutableList<String>
2021-12-09 12:21:30 -08:00
) {
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
Column(Modifier.testTag(RestoreTag.CHIP_LAYOUT)) {
2021-12-09 12:21:30 -08:00
userWordList.chunked(CHIP_GRID_ROW_SIZE).forEachIndexed { chunkIndex, chunk ->
Row(Modifier.fillMaxWidth(), verticalAlignment = CenterVertically) {
2021-12-09 12:21:30 -08:00
val remainder = (chunk.size % CHIP_GRID_ROW_SIZE)
val singleItemWeight = 1f / CHIP_GRID_ROW_SIZE
chunk.forEachIndexed { subIndex, word ->
Chip(
index = Index(chunkIndex * CHIP_GRID_ROW_SIZE + subIndex),
text = word,
modifier = Modifier.weight(singleItemWeight)
)
}
if (0 != remainder) {
Spacer(modifier = Modifier.weight((CHIP_GRID_ROW_SIZE - chunk.size) * singleItemWeight))
2021-12-09 12:21:30 -08:00
}
}
}
}
}
@Composable
private fun NextWordTextField(
parseResult: ParseResult,
text: String,
setText: (String) -> Unit,
modifier: Modifier = Modifier
) {
Surface(
2021-12-09 12:21:30 -08:00
modifier = modifier
.fillMaxWidth()
.padding(dimens.spacingTiny)
.shadow(
elevation = 12.dp,
ambientColor = MaterialTheme.colorScheme.primary,
spotColor = MaterialTheme.colorScheme.primary
),
2023-08-04 04:01:16 -07:00
shape = RectangleShape,
color = MaterialTheme.colorScheme.surface,
) {
2023-03-21 12:04:16 -07:00
/*
* Treat the user input as a password for more secure input, but disable the transformation
* to obscure typing.
*/
TextField(
modifier = Modifier
.fillMaxWidth()
2023-03-21 12:04:16 -07:00
.padding(dimens.spacingTiny)
.testTag(RestoreTag.SEED_WORD_TEXT_FIELD),
value = text,
onValueChange = setText,
keyboardOptions = KeyboardOptions(
KeyboardCapitalization.None,
autoCorrect = false,
imeAction = ImeAction.Done,
keyboardType = KeyboardType.Password
),
keyboardActions = KeyboardActions(onAny = {}),
shape = RoundedCornerShape(8.dp),
isError = parseResult is ParseResult.Warn,
2023-03-22 12:05:19 -07:00
colors = TextFieldDefaults.colors(
focusedContainerColor = Color.Transparent,
unfocusedContainerColor = Color.Transparent,
disabledContainerColor = Color.Transparent,
errorContainerColor = Color.Transparent,
focusedIndicatorColor = Color.Transparent,
unfocusedIndicatorColor = Color.Transparent,
disabledIndicatorColor = Color.Transparent
)
)
}
2021-12-09 12:21:30 -08:00
}
@Composable
private fun Autocomplete(
parseResult: ParseResult,
onSuggestionSelected: (String) -> Unit,
modifier: Modifier = Modifier
2021-12-09 12:21:30 -08:00
) {
val (isHighlight, suggestions) = when (parseResult) {
is ParseResult.Autocomplete -> {
Pair(false, parseResult.suggestions)
}
2021-12-09 12:21:30 -08:00
is ParseResult.Warn -> {
return
2021-12-09 12:21:30 -08:00
}
2021-12-09 12:21:30 -08:00
else -> {
Pair(false, null)
}
}
suggestions?.let {
val highlightModifier = if (isHighlight) {
modifier.border(2.dp, ZcashTheme.colors.highlight)
} else {
modifier
}
@Suppress("ModifierReused")
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
LazyRow(
modifier = highlightModifier.testTag(RestoreTag.AUTOCOMPLETE_LAYOUT),
// Note we don't set the top, as it's set by the confirm button above
// And we also set the bottom smaller, as the keyboard will be always visible
contentPadding = PaddingValues(
bottom = dimens.spacingDefault,
start = dimens.spacingDefault,
end = dimens.spacingSmall
)
) {
2021-12-09 12:21:30 -08:00
items(it) {
Chip(
text = it,
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
modifier = Modifier
.testTag(RestoreTag.AUTOCOMPLETE_ITEM)
.clickable { onSuggestionSelected(it) }
)
2021-12-09 12:21:30 -08:00
}
}
}
}
@Composable
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
private fun Warn(
parseResult: ParseResult,
modifier: Modifier = Modifier
) {
2021-12-09 12:21:30 -08:00
if (parseResult is ParseResult.Warn) {
Surface(
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
modifier = modifier,
2023-08-04 04:01:16 -07:00
shape = RectangleShape,
color = MaterialTheme.colorScheme.secondary,
shadowElevation = 4.dp
2021-12-09 12:21:30 -08:00
) {
Text(
modifier = Modifier
.fillMaxWidth()
2023-03-21 12:04:16 -07:00
.padding(dimens.spacingTiny),
textAlign = TextAlign.Center,
text = if (parseResult.suggestions.isEmpty()) {
2023-03-21 12:04:16 -07:00
stringResource(id = R.string.restore_seed_warning_no_suggestions)
} else {
2023-03-21 12:04:16 -07:00
stringResource(id = R.string.restore_seed_warning_suggestions)
}
2021-12-09 12:21:30 -08:00
)
}
}
}
2023-03-21 12:04:16 -07:00
@Composable
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
@Suppress("LongMethod")
2023-03-21 12:04:16 -07:00
private fun RestoreBirthday(
zcashNetwork: ZcashNetwork,
initialRestoreHeight: BlockHeight?,
setRestoreHeight: (BlockHeight?) -> Unit,
onNext: () -> Unit,
modifier: Modifier = Modifier
) {
val (height, setHeight) = rememberSaveable {
mutableStateOf(initialRestoreHeight?.value?.toString() ?: "")
}
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
Column(
Modifier
.fillMaxHeight()
.verticalScroll(rememberScrollState())
.then(modifier),
horizontalAlignment = Alignment.CenterHorizontally
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
) {
2023-03-21 12:04:16 -07:00
Header(stringResource(R.string.restore_birthday_header))
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
Spacer(modifier = Modifier.height(dimens.spacingDefault))
2023-03-21 12:04:16 -07:00
Body(stringResource(R.string.restore_birthday_body))
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
Spacer(modifier = Modifier.height(dimens.spacingDefault))
FormTextField(
2023-03-21 12:04:16 -07:00
value = height,
onValueChange = { heightString ->
val filteredHeightString = heightString.filter { it.isDigit() }
setHeight(filteredHeightString)
},
Modifier
.fillMaxWidth()
.padding(dimens.spacingTiny)
.testTag(RestoreTag.BIRTHDAY_TEXT_FIELD),
label = { Text(stringResource(id = R.string.restore_birthday_hint)) },
keyboardOptions = KeyboardOptions(
KeyboardCapitalization.None,
autoCorrect = false,
imeAction = ImeAction.Done,
keyboardType = KeyboardType.Number
),
keyboardActions = KeyboardActions(onAny = {}),
2023-08-04 04:01:16 -07:00
shape = RectangleShape,
2023-03-21 12:04:16 -07:00
)
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
2023-03-21 12:04:16 -07:00
Spacer(
modifier = Modifier
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
.fillMaxHeight()
2023-03-21 12:04:16 -07:00
.weight(MINIMAL_WEIGHT)
)
val isBirthdayValid = height.toLongOrNull()?.let {
it >= zcashNetwork.saplingActivationHeight.value
} ?: false
PrimaryButton(
onClick = {
setRestoreHeight(BlockHeight.new(zcashNetwork, height.toLong()))
onNext()
},
text = stringResource(R.string.restore_birthday_button_restore),
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
enabled = isBirthdayValid,
outerPaddingValues = PaddingValues(top = dimens.spacingSmall)
2023-03-21 12:04:16 -07:00
)
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
2023-03-21 12:04:16 -07:00
TertiaryButton(
onClick = {
setRestoreHeight(null)
onNext()
},
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
text = stringResource(R.string.restore_birthday_button_skip),
outerPaddingValues = PaddingValues(top = dimens.spacingSmall)
2023-03-21 12:04:16 -07:00
)
Spacer(modifier = Modifier.height(ZcashTheme.dimens.spacingDefault))
2023-03-21 12:04:16 -07:00
}
}
2021-12-09 12:21:30 -08:00
@Composable
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
private fun RestoreComplete(
onComplete: () -> Unit,
modifier: Modifier = Modifier
) {
Column(
Modifier
.fillMaxHeight()
.verticalScroll(rememberScrollState())
.then(modifier),
horizontalAlignment = Alignment.CenterHorizontally
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
) {
2021-12-09 12:21:30 -08:00
Header(stringResource(R.string.restore_complete_header))
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
Spacer(modifier = Modifier.height(dimens.spacingDefault))
2021-12-09 12:21:30 -08:00
Body(stringResource(R.string.restore_complete_info))
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
Spacer(modifier = Modifier.height(dimens.spacingDefault))
2021-12-09 12:21:30 -08:00
Spacer(
modifier = Modifier
.fillMaxHeight()
.weight(MINIMAL_WEIGHT)
)
[#808] Use Dimens Across App * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * [#705] Instrumentation coverage generation fails locally * [#808] Use Dimens across the app - Shorter Onboarding screen design enhanced * Shorter New Wallet Backup screen UI enhanced * Home screen UI enhance * Seed screen UI enhance * Link SendArgumentsWrapper issue * Move custom buttons paddings to PaddingValues - Optional Modifier parameter should have a default value of Modifier - Thanks to this we introduced the outerPaddingValues parameter to all our buttons with default paddings - Also notice the difference between e.g. ShortOnboardingView and ShortNewWalletBackupView. In the backup, we have the bottom button to be part of Scaffold’s bottomBar, which is maybe a better pattern than stretching the buttons with spacers in case of part of the screen content view, but it has also its tradeoffs. * Settings screen enhance * Support screen UI enhance * About screen UI enhance * Scan screen UI enhance - Move modifiers to the caller’s side - Match texts to predefined styles - Add color to Small text component + reorder parameters * Send screen UI enahnce - Lifted out some modifiers arguments to the caller’s side - Fixed button’s horizontal paddings * Scan move BackHandler to Android class * Update screen UI enhance * Receive screen UI enhance * Address screen UI enhance * Ignore AndroidUpdate back action test - Will be refactored soon * Remove TODO as already implemented * Restore screens UI enhance * Create UpdateViewAndroidTest * [#807][Design system] Remove deprecated Paddings * Address review comments
2023-04-04 05:21:18 -07:00
PrimaryButton(
onClick = onComplete,
text = stringResource(R.string.restore_button_see_wallet),
outerPaddingValues = PaddingValues(top = dimens.spacingSmall)
)
Spacer(modifier = Modifier.height(ZcashTheme.dimens.spacingDefault))
2021-12-09 12:21:30 -08:00
}
}