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

View File

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