fix: smooth sidebar

This commit is contained in:
k1ngsterr1
2026-02-03 16:58:25 +05:00
parent af4df0a353
commit c2283fe0e5
2 changed files with 11 additions and 1 deletions

View File

@@ -1927,6 +1927,13 @@ fun ChatDetailScreen(
showImageViewer = false
imageViewerSourceBounds = null
},
onClosingStart = {
// Сразу сбрасываем status bar при начале закрытия (до анимации)
window?.statusBarColor = android.graphics.Color.TRANSPARENT
window?.let { w ->
WindowCompat.getInsetsController(w, view)?.isAppearanceLightStatusBars = !isDarkTheme
}
},
isDarkTheme = isDarkTheme,
sourceBounds = imageViewerSourceBounds
)

View File

@@ -113,6 +113,7 @@ fun ImageViewerScreen(
initialIndex: Int,
privateKey: String,
onDismiss: () -> Unit,
onClosingStart: () -> Unit = {}, // Вызывается сразу при начале закрытия (для status bar)
isDarkTheme: Boolean = true,
sourceBounds: ImageSourceBounds? = null
) {
@@ -159,6 +160,7 @@ fun ImageViewerScreen(
fun closeWithAnimation() {
if (isClosing) return
isClosing = true
onClosingStart() // Сразу сбрасываем status bar
scope.launch {
if (sourceBounds != null) {
@@ -216,7 +218,8 @@ fun ImageViewerScreen(
fun smoothDismiss() {
if (isClosing) return
isClosing = true
onClosingStart() // Сразу сбрасываем status bar
scope.launch {
// Плавно исчезаем - более длинная анимация
dismissAlpha.animateTo(