loadingNode: hide ProgressIndicator in some cases.

This commit is contained in:
Benoit Marty
2025-09-30 11:54:43 +02:00
parent 1cd75af666
commit bfb51e188e
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 {
return when (navTarget) {
NavTarget.Placeholder -> loadingNode(buildContext)
NavTarget.Placeholder -> loadingNode(buildContext, showProgressIndicator = false)
NavTarget.LoggedInPermanent -> {
val callback = object : LoggedInNode.Callback {
override fun navigateToNotificationTroubleshoot() {

View File

@@ -216,7 +216,7 @@ import timber.log.Timber
return when (navTarget) {
is NavTarget.LoggedInFlow -> {
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")
}
val inputs = LoggedInAppScopeFlowNode.Inputs(matrixClient)

View File

@@ -95,7 +95,7 @@ class LockScreenSettingsFlowNode(
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
return when (navTarget) {
NavTarget.Loading -> {
loadingNode(buildContext)
loadingNode(buildContext, showProgressIndicator = false)
}
NavTarget.Unlock -> {
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 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) {
CircularProgressIndicator()
if (showProgressIndicator) {
CircularProgressIndicator()
}
}
}