diff --git a/CHANGELOG.md b/CHANGELOG.md index 75d0e4c8..0ab9fcdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ and this application adheres to [Semantic Versioning](https://semver.org/spec/v2 ### Changed - The About screen has been redesigned to align with the new design guidelines - `StyledBalance` text styles have been refactored from `Pair` into `BalanceTextStyle` +- The Restore Success dialog has been reworked into a separate screen, allowing users to opt out of the Keep screen + on while restoring option ## [1.1.3 (682)] - 2024-07-03 diff --git a/docs/whatsNew/WHATS_NEW_EN.md b/docs/whatsNew/WHATS_NEW_EN.md index a6d5e40a..808dc47a 100644 --- a/docs/whatsNew/WHATS_NEW_EN.md +++ b/docs/whatsNew/WHATS_NEW_EN.md @@ -14,3 +14,5 @@ directly impact users rather than highlighting other key architectural updates.* ### Changed - The About screen has been redesigned to align with the new design guidelines +- The Restore Success dialog has been reworked into a separate screen, allowing users to opt out of the Keep screen + on while restoring option diff --git a/preference-impl-android-lib/src/main/java/co/electriccoin/zcash/preference/AndroidPreferenceProvider.kt b/preference-impl-android-lib/src/main/java/co/electriccoin/zcash/preference/AndroidPreferenceProvider.kt index 6edf7203..af5037b4 100644 --- a/preference-impl-android-lib/src/main/java/co/electriccoin/zcash/preference/AndroidPreferenceProvider.kt +++ b/preference-impl-android-lib/src/main/java/co/electriccoin/zcash/preference/AndroidPreferenceProvider.kt @@ -14,6 +14,8 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map +import kotlinx.coroutines.sync.Mutex +import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.withContext import java.util.concurrent.Executors @@ -30,6 +32,8 @@ class AndroidPreferenceProvider( private val sharedPreferences: SharedPreferences, private val dispatcher: CoroutineDispatcher ) : PreferenceProvider { + private val mutex = Mutex() + /* * Implementation note: EncryptedSharedPreferences are not thread-safe, so this implementation * confines them to a single background thread. @@ -45,13 +49,15 @@ class AndroidPreferenceProvider( key: PreferenceKey, value: String? ) = withContext(dispatcher) { - val editor = sharedPreferences.edit() + mutex.withLock { + val editor = sharedPreferences.edit() - editor.putString(key.key, value) + editor.putString(key.key, value) - editor.commit() + editor.commit() - Unit + Unit + } } override suspend fun getString(key: PreferenceKey) = diff --git a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Checkbox.kt b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Checkbox.kt index 8c23332e..827c3aae 100644 --- a/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Checkbox.kt +++ b/ui-design-lib/src/main/java/co/electriccoin/zcash/ui/design/component/Checkbox.kt @@ -3,7 +3,6 @@ package co.electriccoin.zcash.ui.design.component import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Checkbox import androidx.compose.material3.CheckboxDefaults @@ -76,7 +75,6 @@ fun LabeledCheckBox( modifier = modifier.then( Modifier - .wrapContentSize() .clip(RoundedCornerShape(ZcashTheme.dimens.regularRippleEffectCorner)) .clickable { setCheckedState(!checkedState) diff --git a/ui-lib/build.gradle.kts b/ui-lib/build.gradle.kts index d52fed40..689edd06 100644 --- a/ui-lib/build.gradle.kts +++ b/ui-lib/build.gradle.kts @@ -44,6 +44,7 @@ android { "src/main/res/ui/onboarding", "src/main/res/ui/receive", "src/main/res/ui/restore", + "src/main/res/ui/restore_success", "src/main/res/ui/scan", "src/main/res/ui/security_warning", "src/main/res/ui/seed_recovery", diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/HomeViewModel.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/HomeViewModel.kt index 01594da5..9294f9f2 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/HomeViewModel.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/common/viewmodel/HomeViewModel.kt @@ -33,9 +33,9 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) { booleanStateFlow(StandardPreferenceKeys.IS_KEEP_SCREEN_ON_DURING_SYNC) /** - * A flow of whether the app presented the user with an initial restoring dialog + * A flow of whether the app presented the user with restore success screem */ - val isRestoringInitialWarningSeen: StateFlow = + val isRestoreSuccessSeen: StateFlow = booleanStateFlow(StandardPreferenceKeys.IS_RESTORING_INITIAL_WARNING_SEEN) fun setRestoringInitialWarningSeen() { diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/home/AndroidHome.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/home/AndroidHome.kt index 75f6b463..d8d5ecea 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/home/AndroidHome.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/home/AndroidHome.kt @@ -55,8 +55,6 @@ internal fun WrapHome( val isKeepScreenOnWhileSyncing = homeViewModel.isKeepScreenOnWhileSyncing.collectAsStateWithLifecycle().value - val isRestoringInitialWarningSeen = homeViewModel.isRestoringInitialWarningSeen.collectAsStateWithLifecycle().value - val walletSnapshot = walletViewModel.walletSnapshot.collectAsStateWithLifecycle().value val walletRestoringState = walletViewModel.walletRestoringState.collectAsStateWithLifecycle().value @@ -66,20 +64,24 @@ internal fun WrapHome( walletViewModel.persistWalletRestoringState(WalletRestoringState.SYNCING) } - var isShowingRestoreInitDialog by rememberSaveable { mutableStateOf(false) } - val setShowingRestoreInitDialog = { + // TODO [#1523]: Refactor RestoreSuccess screen navigation + // TODO [#1523]: https://github.com/Electric-Coin-Company/zashi-android/issues/1523 + val isRestoreSuccessSeen = homeViewModel.isRestoreSuccessSeen.collectAsStateWithLifecycle().value + + var isShowingRestoreSuccess by rememberSaveable { mutableStateOf(false) } + val setShowingRestoreSuccess = { homeViewModel.setRestoringInitialWarningSeen() - isShowingRestoreInitDialog = false + isShowingRestoreSuccess = false } - // Show initial restoring warn dialog - isRestoringInitialWarningSeen?.let { restoringWarningSeen -> - if (!restoringWarningSeen && walletRestoringState == WalletRestoringState.RESTORING) { - LaunchedEffect(key1 = isShowingRestoreInitDialog) { - // Adding an extra little delay before displaying the dialog for a better UX + // Show initial restore success screen + isRestoreSuccessSeen?.let { restoreSuccessSeen -> + if (!restoreSuccessSeen && walletRestoringState == WalletRestoringState.RESTORING) { + LaunchedEffect(key1 = isShowingRestoreSuccess) { + // Adding an extra little delay before displaying for a better UX @Suppress("MagicNumber") delay(1500) - isShowingRestoreInitDialog = true + isShowingRestoreSuccess = true } } } @@ -90,9 +92,9 @@ internal fun WrapHome( goSettings = goSettings, goMultiTrxSubmissionFailure = goMultiTrxSubmissionFailure, isKeepScreenOnWhileSyncing = isKeepScreenOnWhileSyncing, - isShowingRestoreInitDialog = isShowingRestoreInitDialog, + isShowingRestoreSuccess = isShowingRestoreSuccess, sendArguments = sendArguments, - setShowingRestoreInitDialog = setShowingRestoreInitDialog, + setShowingRestoreSuccess = setShowingRestoreSuccess, walletSnapshot = walletSnapshot ) } @@ -106,9 +108,9 @@ internal fun WrapHome( goScan: () -> Unit, goSendConfirmation: (ZecSend) -> Unit, isKeepScreenOnWhileSyncing: Boolean?, - isShowingRestoreInitDialog: Boolean, + isShowingRestoreSuccess: Boolean, sendArguments: SendArguments, - setShowingRestoreInitDialog: () -> Unit, + setShowingRestoreSuccess: () -> Unit, walletSnapshot: WalletSnapshot?, ) { val focusManager = LocalFocusManager.current @@ -209,8 +211,8 @@ internal fun WrapHome( Home( subScreens = tabs, isKeepScreenOnWhileSyncing = isKeepScreenOnWhileSyncing, - isShowingRestoreInitDialog = isShowingRestoreInitDialog, - setShowingRestoreInitDialog = setShowingRestoreInitDialog, + isShowingRestoreSuccess = isShowingRestoreSuccess, + setShowingRestoreSuccess = setShowingRestoreSuccess, walletSnapshot = walletSnapshot, pagerState = pagerState, ) diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/home/view/HomeView.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/home/view/HomeView.kt index 8c558b90..83524681 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/home/view/HomeView.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/home/view/HomeView.kt @@ -19,21 +19,19 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag -import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension import cash.z.ecc.android.sdk.Synchronizer -import co.electriccoin.zcash.ui.R import co.electriccoin.zcash.ui.common.compose.DisableScreenTimeout import co.electriccoin.zcash.ui.common.model.WalletSnapshot -import co.electriccoin.zcash.ui.design.component.AppAlertDialog import co.electriccoin.zcash.ui.design.component.BlankSurface import co.electriccoin.zcash.ui.design.component.NavigationTabText import co.electriccoin.zcash.ui.design.theme.ZcashTheme import co.electriccoin.zcash.ui.fixture.WalletSnapshotFixture import co.electriccoin.zcash.ui.screen.home.model.TabItem +import co.electriccoin.zcash.ui.screen.restoresuccess.WrapRestoreSuccess import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf import kotlinx.coroutines.launch @@ -46,8 +44,8 @@ private fun ComposablePreview() { BlankSurface { Home( isKeepScreenOnWhileSyncing = false, - isShowingRestoreInitDialog = false, - setShowingRestoreInitDialog = {}, + isShowingRestoreSuccess = false, + setShowingRestoreSuccess = {}, subScreens = persistentListOf(), walletSnapshot = WalletSnapshotFixture.new(), ) @@ -60,8 +58,8 @@ private fun ComposablePreview() { @Composable fun Home( isKeepScreenOnWhileSyncing: Boolean?, - isShowingRestoreInitDialog: Boolean, - setShowingRestoreInitDialog: () -> Unit, + isShowingRestoreSuccess: Boolean, + setShowingRestoreSuccess: () -> Unit, subScreens: ImmutableList, walletSnapshot: WalletSnapshot?, pagerState: PagerState = @@ -76,8 +74,8 @@ fun Home( subScreens = subScreens, ) - if (isShowingRestoreInitDialog) { - HomeRestoringInitialDialog(setShowingRestoreInitDialog) + if (isShowingRestoreSuccess) { + WrapRestoreSuccess(onDone = setShowingRestoreSuccess) } if (isKeepScreenOnWhileSyncing == true && @@ -182,13 +180,3 @@ private fun HomeContent( } } } - -@Composable -fun HomeRestoringInitialDialog(setShowingRestoreInitDialog: () -> Unit) { - AppAlertDialog( - title = stringResource(id = R.string.restoring_initial_dialog_title), - text = stringResource(id = R.string.restoring_initial_dialog_description), - confirmButtonText = stringResource(id = R.string.restoring_initial_dialog_positive_button), - onConfirmButtonClick = setShowingRestoreInitDialog - ) -} diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/restoresuccess/AndroidRestoreSuccess.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/restoresuccess/AndroidRestoreSuccess.kt new file mode 100644 index 00000000..344bb22d --- /dev/null +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/restoresuccess/AndroidRestoreSuccess.kt @@ -0,0 +1,27 @@ +package co.electriccoin.zcash.ui.screen.restoresuccess + +import androidx.activity.viewModels +import androidx.compose.runtime.Composable +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import co.electriccoin.zcash.ui.common.compose.LocalActivity +import co.electriccoin.zcash.ui.screen.restoresuccess.view.RestoreSuccess +import co.electriccoin.zcash.ui.screen.restoresuccess.viewmodel.RestoreSuccessViewModel + +@Composable +fun WrapRestoreSuccess(onDone: () -> Unit) { + val activity = LocalActivity.current + + val viewModel by activity.viewModels() + + val state = viewModel.state.collectAsStateWithLifecycle().value + + RestoreSuccess( + state = + state.copy( + onPositiveClick = { + state.onPositiveClick() + onDone() + } + ) + ) +} diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/restoresuccess/view/RestoreSuccessView.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/restoresuccess/view/RestoreSuccessView.kt new file mode 100644 index 00000000..93c9bb0a --- /dev/null +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/restoresuccess/view/RestoreSuccessView.kt @@ -0,0 +1,164 @@ +package co.electriccoin.zcash.ui.screen.restoresuccess.view + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.buildAnnotatedString +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.withStyle +import androidx.compose.ui.tooling.preview.Devices +import androidx.compose.ui.tooling.preview.Preview +import co.electriccoin.zcash.ui.R +import co.electriccoin.zcash.ui.design.component.BlankSurface +import co.electriccoin.zcash.ui.design.component.GridBgScaffold +import co.electriccoin.zcash.ui.design.component.LabeledCheckBox +import co.electriccoin.zcash.ui.design.component.PrimaryButton +import co.electriccoin.zcash.ui.design.theme.ZcashTheme + +@Composable +fun RestoreSuccess(state: RestoreSuccessViewState) { + GridBgScaffold { paddingValues -> + RestoreSuccessContent( + state = state, + modifier = + Modifier + .fillMaxSize() + .padding( + top = paddingValues.calculateTopPadding(), + bottom = paddingValues.calculateBottomPadding() + ) + .verticalScroll(rememberScrollState()) + ) + } +} + +@Composable +@Suppress("LongMethod") +private fun RestoreSuccessContent( + state: RestoreSuccessViewState, + modifier: Modifier = Modifier +) { + Column( + modifier = + modifier.then( + Modifier.padding( + start = ZcashTheme.dimens.screenHorizontalSpacingBig, + end = ZcashTheme.dimens.screenHorizontalSpacingBig + ) + ), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Spacer(modifier = Modifier.height(ZcashTheme.dimens.spacingBig)) + + Text( + text = stringResource(id = R.string.restore_success_title), + style = ZcashTheme.typography.secondary.headlineMedium + ) + + Spacer(Modifier.height(ZcashTheme.dimens.spacingUpLarge)) + + Image( + painter = painterResource(id = R.drawable.img_success_dialog), + contentDescription = stringResource(id = R.string.restore_success_subtitle), + colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onBackground) + ) + + Spacer(Modifier.height(ZcashTheme.dimens.spacingUpLarge)) + + Text( + text = stringResource(id = R.string.restore_success_subtitle), + textAlign = TextAlign.Center, + style = ZcashTheme.typography.secondary.headlineSmall, + fontWeight = FontWeight.SemiBold + ) + + Spacer(Modifier.height(ZcashTheme.dimens.spacingUpLarge)) + + Text( + text = stringResource(id = R.string.restore_success_description), + style = ZcashTheme.typography.secondary.bodySmall, + ) + + Spacer(Modifier.height(ZcashTheme.dimens.spacingLarge)) + + LabeledCheckBox( + modifier = Modifier.align(Alignment.Start), + checked = state.isKeepScreenOnChecked, + onCheckedChange = { state.onCheckboxClick() }, + text = stringResource(id = R.string.restoring_initial_dialog_checkbox) + ) + + Spacer(Modifier.height(ZcashTheme.dimens.spacingLarge)) + + Text( + text = + buildAnnotatedString { + withStyle(SpanStyle(fontWeight = FontWeight.Bold)) { + append(stringResource(id = R.string.restore_success_note_part_1)) + } + append(" ") + append(stringResource(id = R.string.restore_success_note_part_2)) + }, + style = ZcashTheme.extendedTypography.footnote, + ) + + Spacer(Modifier.height(ZcashTheme.dimens.spacingBig)) + + Spacer(Modifier.weight(1f)) + + PrimaryButton( + onClick = state.onPositiveClick, + text = stringResource(id = R.string.restore_success_button) + ) + + Spacer(modifier = Modifier.height(ZcashTheme.dimens.spacingBig)) + } +} + +data class RestoreSuccessViewState( + val isKeepScreenOnChecked: Boolean, + val onCheckboxClick: () -> Unit, + val onPositiveClick: () -> Unit, +) + +@Composable +private fun RestoreSuccessViewPreview() = + BlankSurface { + RestoreSuccess( + state = + RestoreSuccessViewState( + isKeepScreenOnChecked = true, + onCheckboxClick = {}, + onPositiveClick = {}, + ) + ) + } + +@Preview(device = Devices.PIXEL_7_PRO) +@Composable +private fun RestoreSuccessViewPreviewLight() = + ZcashTheme(false) { + RestoreSuccessViewPreview() + } + +@Preview(device = Devices.PIXEL_7_PRO) +@Composable +private fun RestoreSuccessViewPreviewDark() = + ZcashTheme(true) { + RestoreSuccessViewPreview() + } diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/restoresuccess/viewmodel/RestoreSuccessViewModel.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/restoresuccess/viewmodel/RestoreSuccessViewModel.kt new file mode 100644 index 00000000..c2a106fd --- /dev/null +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/restoresuccess/viewmodel/RestoreSuccessViewModel.kt @@ -0,0 +1,53 @@ +package co.electriccoin.zcash.ui.screen.restoresuccess.viewmodel + +import android.app.Application +import androidx.lifecycle.AndroidViewModel +import androidx.lifecycle.viewModelScope +import co.electriccoin.zcash.preference.model.entry.BooleanPreferenceDefault +import co.electriccoin.zcash.ui.common.ANDROID_STATE_FLOW_TIMEOUT +import co.electriccoin.zcash.ui.preference.StandardPreferenceKeys +import co.electriccoin.zcash.ui.preference.StandardPreferenceSingleton +import co.electriccoin.zcash.ui.screen.restoresuccess.view.RestoreSuccessViewState +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.SharingStarted +import kotlinx.coroutines.flow.WhileSubscribed +import kotlinx.coroutines.flow.map +import kotlinx.coroutines.flow.stateIn +import kotlinx.coroutines.flow.update +import kotlinx.coroutines.launch + +class RestoreSuccessViewModel(application: Application) : AndroidViewModel(application) { + private val keepScreenOn = MutableStateFlow(DEFAULT_KEEP_SCREEN_ON) + + val state = + keepScreenOn + .map { createState(keepScreenOn = it) } + .stateIn( + viewModelScope, + SharingStarted.WhileSubscribed(ANDROID_STATE_FLOW_TIMEOUT), + createState(keepScreenOn = DEFAULT_KEEP_SCREEN_ON) + ) + + private fun createState(keepScreenOn: Boolean) = + RestoreSuccessViewState( + isKeepScreenOnChecked = keepScreenOn, + onCheckboxClick = { this.keepScreenOn.update { !keepScreenOn } }, + onPositiveClick = { + setKeepScreenOnWhileSyncing(keepScreenOn) + } + ) + + private fun setKeepScreenOnWhileSyncing(enabled: Boolean) { + setBooleanPreference(StandardPreferenceKeys.IS_KEEP_SCREEN_ON_DURING_SYNC, enabled) + } + + private fun setBooleanPreference( + default: BooleanPreferenceDefault, + newState: Boolean + ) = viewModelScope.launch { + val prefs = StandardPreferenceSingleton.getInstance(getApplication()) + default.putValue(prefs, newState) + } +} + +private const val DEFAULT_KEEP_SCREEN_ON = true diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/settings/viewmodel/SettingsViewModel.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/settings/viewmodel/SettingsViewModel.kt index a29a83d7..b3efa1f7 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/settings/viewmodel/SettingsViewModel.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/screen/settings/viewmodel/SettingsViewModel.kt @@ -14,12 +14,8 @@ import kotlinx.coroutines.flow.emitAll import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch -import kotlinx.coroutines.sync.Mutex -import kotlinx.coroutines.sync.withLock class SettingsViewModel(application: Application) : AndroidViewModel(application) { - private val mutex = Mutex() - val isAnalyticsEnabled: StateFlow = booleanStateFlow(StandardPreferenceKeys.IS_ANALYTICS_ENABLED) val isBackgroundSync: StateFlow = booleanStateFlow(StandardPreferenceKeys.IS_BACKGROUND_SYNC_ENABLED) @@ -51,9 +47,7 @@ class SettingsViewModel(application: Application) : AndroidViewModel(application ) { viewModelScope.launch { val prefs = StandardPreferenceSingleton.getInstance(getApplication()) - mutex.withLock { - default.putValue(prefs, newState) - } + default.putValue(prefs, newState) } } } diff --git a/ui-lib/src/main/res/ui/home/values/strings.xml b/ui-lib/src/main/res/ui/home/values/strings.xml index 94bc5cdd..f8a81084 100644 --- a/ui-lib/src/main/res/ui/home/values/strings.xml +++ b/ui-lib/src/main/res/ui/home/values/strings.xml @@ -3,8 +3,4 @@ Send Receive Balances - - Success - Your wallet has been successfully restored! During the initial sync, your funds cannot be spent or sent. Depending on the age of your wallet, it may take a few hours to fully sync. - OK diff --git a/ui-lib/src/main/res/ui/restore_success/drawable/img_success_dialog.xml b/ui-lib/src/main/res/ui/restore_success/drawable/img_success_dialog.xml new file mode 100644 index 00000000..f88ad772 --- /dev/null +++ b/ui-lib/src/main/res/ui/restore_success/drawable/img_success_dialog.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + diff --git a/ui-lib/src/main/res/ui/restore_success/values/strings.xml b/ui-lib/src/main/res/ui/restore_success/values/strings.xml new file mode 100644 index 00000000..2160c2a5 --- /dev/null +++ b/ui-lib/src/main/res/ui/restore_success/values/strings.xml @@ -0,0 +1,10 @@ + + Keep Zashi open! + Your wallet has been successfully restored and is now syncing + To prevent interruption, keep your screen awake, plug your device into a power source, and keep it in a secure place. + Keep screen on while restoring. + Note: + During the initial sync your funds cannot be sent or + spent. Depending on the age of your wallet, it may take a few hours to fully sync. + GOT IT! +