Fix WelcomeAnimation in testing (#1668)
- These changes also improve the UX of the app launch, as it only waits for the animation duration.
This commit is contained in:
parent
72e3eca548
commit
261510a42c
|
@ -259,7 +259,7 @@ class MainActivity : FragmentActivity() {
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
// Wait until the welcome animation finishes, then mark it as presented to the user
|
// Wait until the welcome animation finishes, then mark it as presented to the user
|
||||||
delay((AnimationConstants.together()).milliseconds)
|
delay((AnimationConstants.durationOnly()).milliseconds)
|
||||||
authenticationViewModel.appAccessAuthentication.value = AuthenticationUIState.Successful
|
authenticationViewModel.appAccessAuthentication.value = AuthenticationUIState.Successful
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,6 +8,7 @@ import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.platform.testTag
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontStyle
|
import androidx.compose.ui.text.font.FontStyle
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
@ -16,6 +17,7 @@ import co.electriccoin.zcash.ui.common.viewmodel.AuthenticationResult
|
||||||
import co.electriccoin.zcash.ui.design.component.AppAlertDialog
|
import co.electriccoin.zcash.ui.design.component.AppAlertDialog
|
||||||
import co.electriccoin.zcash.ui.design.component.BlankSurface
|
import co.electriccoin.zcash.ui.design.component.BlankSurface
|
||||||
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
|
import co.electriccoin.zcash.ui.design.theme.ZcashTheme
|
||||||
|
import co.electriccoin.zcash.ui.screen.authentication.view.AnimationConstants.WELCOME_ANIM_TEST_TAG
|
||||||
|
|
||||||
@Preview("App Access Authentication")
|
@Preview("App Access Authentication")
|
||||||
@Composable
|
@Composable
|
||||||
|
@ -72,7 +74,7 @@ fun AppAccessAuthentication(
|
||||||
animationState = welcomeAnimVisibility,
|
animationState = welcomeAnimVisibility,
|
||||||
onRetry = onRetry,
|
onRetry = onRetry,
|
||||||
showAuthLogo = showAuthLogo,
|
showAuthLogo = showAuthLogo,
|
||||||
modifier = modifier,
|
modifier = modifier.testTag(WELCOME_ANIM_TEST_TAG),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,8 @@ object AnimationConstants {
|
||||||
const val WELCOME_ANIM_TEST_TAG = "WELCOME_ANIM_TEST_TAG"
|
const val WELCOME_ANIM_TEST_TAG = "WELCOME_ANIM_TEST_TAG"
|
||||||
|
|
||||||
fun together() = (ANIMATION_DURATION + INITIAL_DELAY).toLong()
|
fun together() = (ANIMATION_DURATION + INITIAL_DELAY).toLong()
|
||||||
|
|
||||||
|
fun durationOnly() = (ANIMATION_DURATION).toLong()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO [#1002]: Welcome screen animation masking
|
// TODO [#1002]: Welcome screen animation masking
|
||||||
|
|
Loading…
Reference in New Issue