From 3d9e032900d6b199b96356034357cb838337b342 Mon Sep 17 00:00:00 2001 From: Diogo Date: Wed, 4 Sep 2024 13:53:41 +0100 Subject: [PATCH] reset navbar colors on navigate --- .../common/views/chatlist/UserPicker.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.kt index f8609e7011..3fcb84b9aa 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.kt @@ -380,6 +380,24 @@ fun UserPicker( ) } + LaunchedEffect(Unit) { + launch { + snapshotFlow { ModalManager.start.modalCount.value } + .collect { modalCount -> + val colors = CurrentColors.value.colors + + if (modalCount == 0 && newChat.isVisible()) { + platform.androidSetDrawerStatusAndNavBarColor( + isLight = colors.isLight, + drawerShadingColor = animatedColor, + toolbarOnTop = !appPrefs.oneHandUI.get(), + navBarColor = colors.surface + ) + } + } + } + } + LaunchedEffect(Unit) { snapshotFlow { currentTheme } .distinctUntilChanged()