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