loadingNode: hide ProgressIndicator in some cases.
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user