refactor: improve status bar handling in ChatDetailScreen and ChatsListScreen
This commit is contained in:
@@ -221,8 +221,12 @@ fun ChatDetailScreen(
|
|||||||
|
|
||||||
DisposableEffect(Unit) {
|
DisposableEffect(Unit) {
|
||||||
onDispose {
|
onDispose {
|
||||||
// Восстановить при уходе с экрана
|
// Восстановить белые иконки статус-бара для chat list header
|
||||||
SystemBarsStyleUtils.applyChatStatusBar(window, view, isDarkTheme)
|
if (window != null && view != null) {
|
||||||
|
val ic = androidx.core.view.WindowCompat.getInsetsController(window, view)
|
||||||
|
window.statusBarColor = android.graphics.Color.TRANSPARENT
|
||||||
|
ic.isAppearanceLightStatusBars = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -224,8 +224,7 @@ fun ChatsListScreen(
|
|||||||
focusManager.clearFocus()
|
focusManager.clearFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update status bar appearance — only set once on entry, not every recomposition
|
// Update status bar appearance
|
||||||
// This prevents overriding ChatDetailScreen's status bar when ChatsListScreen is in back stack
|
|
||||||
DisposableEffect(isDarkTheme) {
|
DisposableEffect(isDarkTheme) {
|
||||||
val window = (view.context as android.app.Activity).window
|
val window = (view.context as android.app.Activity).window
|
||||||
val insetsController =
|
val insetsController =
|
||||||
|
|||||||
Reference in New Issue
Block a user