mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-02 09:56:08 +00:00
ui: fix crash opening About SimpleX Chat (#6902)
* ui: fix crash and logo cutoff on About SimpleX Chat OnboardingShrinkingLayout calls .first() on each slot's measurables, crashing when the button slot is empty. About passes onboardingStage = null, in which case the button slot emits no children. Have the About branch emit a 0x0 Spacer so the slot always has one measurable. Also add a top inset for the SimpleX logo when reached from About in non-oneHandUI mode — without it the top app bar overlaps the logo. * style Co-authored-by: Evgeny <evgeny@poberezkin.com> * Apply suggestion from @epoberezkin Co-authored-by: Evgeny <evgeny@poberezkin.com> --------- Co-authored-by: Evgeny <evgeny@poberezkin.com>
This commit is contained in:
+5
-1
@@ -105,7 +105,9 @@ fun SimpleXInfoLayout(
|
||||
user: User?,
|
||||
onboardingStage: SharedPreference<OnboardingStage>?
|
||||
) {
|
||||
Column(Modifier.fillMaxSize().systemBarsPadding().padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING), horizontalAlignment = Alignment.CenterHorizontally) {
|
||||
val topBar = onboardingStage == null && !appPrefs.oneHandUI.state.value
|
||||
val modifier = Modifier.fillMaxSize().systemBarsPadding().padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING)
|
||||
Column(if (topBar) modifier.padding(top = AppBarHeight * fontSizeSqrtMultiplier) else modifier, horizontalAlignment = Alignment.CenterHorizontally) {
|
||||
Box(Modifier.padding(top = DEFAULT_PADDING * 2).widthIn(max = if (appPlatform.isAndroid) 185.dp else 160.dp), contentAlignment = Alignment.Center) {
|
||||
SimpleXLogo()
|
||||
}
|
||||
@@ -156,6 +158,8 @@ fun SimpleXInfoLayout(
|
||||
ModalManager.fullscreen.showModal { HowItWorks(user, onboardingStage) }
|
||||
})
|
||||
}
|
||||
} else {
|
||||
Spacer(Modifier)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user