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