mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-12 19:35:00 +00:00
android: status bar color fix in non-oneHandUI (#4603)
This commit is contained in:
committed by
GitHub
parent
5a42c0c1d2
commit
f6ee6338c4
@@ -276,7 +276,9 @@ fun AndroidScreen(settingsState: SettingsViewState) {
|
||||
snapshotFlow { ModalManager.center.modalCount.value > 0 }
|
||||
.filter { chatModel.chatId.value == null }
|
||||
.collect { modalBackground ->
|
||||
if (modalBackground && !chatModel.newChatSheetVisible.value) {
|
||||
if (chatModel.newChatSheetVisible.value) {
|
||||
platform.androidSetStatusAndNavBarColors(CurrentColors.value.colors.isLight, CurrentColors.value.colors.background, false, appPrefs.oneHandUI.get())
|
||||
} else if (modalBackground) {
|
||||
platform.androidSetStatusAndNavBarColors(CurrentColors.value.colors.isLight, CurrentColors.value.colors.background, false, false)
|
||||
} else {
|
||||
platform.androidSetStatusAndNavBarColors(CurrentColors.value.colors.isLight, CurrentColors.value.colors.background, !appPrefs.oneHandUI.get(), appPrefs.oneHandUI.get())
|
||||
|
||||
+18
-7
@@ -47,13 +47,24 @@ private fun showNewChatSheet(oneHandUI: State<Boolean>) {
|
||||
ModalManager.start.closeModals()
|
||||
ModalManager.end.closeModals()
|
||||
chatModel.newChatSheetVisible.value = true
|
||||
ModalManager.start.showModalCloseable(
|
||||
closeOnTop = !oneHandUI.value,
|
||||
) { close ->
|
||||
NewChatSheet(rh = chatModel.currentRemoteHost.value, close)
|
||||
DisposableEffect(Unit) {
|
||||
onDispose {
|
||||
chatModel.newChatSheetVisible.value = false
|
||||
ModalManager.start.showCustomModal { close ->
|
||||
val close = {
|
||||
// It will set it faster than in onDispose. It's important to catch the actual state before
|
||||
// closing modal for reacting with status bar changes in [App]
|
||||
chatModel.newChatSheetVisible.value = false
|
||||
close()
|
||||
}
|
||||
ModalView(close, closeOnTop = !oneHandUI.value) {
|
||||
if (appPlatform.isAndroid) {
|
||||
BackHandler {
|
||||
close()
|
||||
}
|
||||
}
|
||||
NewChatSheet(rh = chatModel.currentRemoteHost.value, close)
|
||||
DisposableEffect(Unit) {
|
||||
onDispose {
|
||||
chatModel.newChatSheetVisible.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user