loadingNode: hide ProgressIndicator in some cases.

This commit is contained in:
Benoit Marty 2025-09-30 11:54:43 +02:00
parent fa77166092
commit 36070c3e2b
4 changed files with 10 additions and 5 deletions

View file

@ -281,7 +281,7 @@ class LoggedInFlowNode(
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node { override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
return when (navTarget) { return when (navTarget) {
NavTarget.Placeholder -> loadingNode(buildContext) NavTarget.Placeholder -> loadingNode(buildContext, showProgressIndicator = false)
NavTarget.LoggedInPermanent -> { NavTarget.LoggedInPermanent -> {
val callback = object : LoggedInNode.Callback { val callback = object : LoggedInNode.Callback {
override fun navigateToNotificationTroubleshoot() { override fun navigateToNotificationTroubleshoot() {

View file

@ -216,7 +216,7 @@ import timber.log.Timber
return when (navTarget) { return when (navTarget) {
is NavTarget.LoggedInFlow -> { is NavTarget.LoggedInFlow -> {
val matrixClient = matrixSessionCache.getOrNull(navTarget.sessionId) val matrixClient = matrixSessionCache.getOrNull(navTarget.sessionId)
?: return loadingNode(buildContext).also { ?: return loadingNode(buildContext, showProgressIndicator = false).also {
Timber.w("Couldn't find any session, go through SplashScreen") Timber.w("Couldn't find any session, go through SplashScreen")
} }
val inputs = LoggedInAppScopeFlowNode.Inputs(matrixClient) val inputs = LoggedInAppScopeFlowNode.Inputs(matrixClient)

View file

@ -95,7 +95,7 @@ class LockScreenSettingsFlowNode(
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node { override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
return when (navTarget) { return when (navTarget) {
NavTarget.Loading -> { NavTarget.Loading -> {
loadingNode(buildContext) loadingNode(buildContext, showProgressIndicator = false)
} }
NavTarget.Unlock -> { NavTarget.Unlock -> {
val callback = object : PinUnlockNode.Callback { val callback = object : PinUnlockNode.Callback {

View file

@ -15,8 +15,13 @@ import com.bumble.appyx.core.node.Node
import com.bumble.appyx.core.node.node import com.bumble.appyx.core.node.node
import io.element.android.libraries.designsystem.theme.components.CircularProgressIndicator import io.element.android.libraries.designsystem.theme.components.CircularProgressIndicator
fun loadingNode(buildContext: BuildContext): Node = node(buildContext) { modifier -> fun loadingNode(
buildContext: BuildContext,
showProgressIndicator: Boolean = true,
): Node = node(buildContext) { modifier ->
Box(modifier = modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Box(modifier = modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
CircularProgressIndicator() if (showProgressIndicator) {
CircularProgressIndicator()
}
} }
} }