loadingNode: hide ProgressIndicator in some cases.
This commit is contained in:
parent
fa77166092
commit
36070c3e2b
4 changed files with 10 additions and 5 deletions
|
|
@ -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() {
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue