fix: smooth sidebar
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user