From d3c38604b5d2584c23de07751d6e225aa745e4e4 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Thu, 24 Sep 2026 23:41:07 +0000 Subject: [PATCH] delay the mini player's return until the keyboard has mostly slid away --- app/src/main/kotlin/com/subtracks/ui/AppRoot.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/subtracks/ui/AppRoot.kt b/app/src/main/kotlin/com/subtracks/ui/AppRoot.kt index b7ec7c3b..2b99e842 100644 --- a/app/src/main/kotlin/com/subtracks/ui/AppRoot.kt +++ b/app/src/main/kotlin/com/subtracks/ui/AppRoot.kt @@ -82,6 +82,7 @@ private const val NAVIGATION_DURATION_MS = 260 private const val OVERLAY_DURATION_MS = 200 private const val EXPAND_FADE = 0.1f private const val FLING_VELOCITY = 1000f +private val MINI_PLAYER_REVEAL = 64.dp private object Routes { const val LIBRARY = "library" @@ -150,8 +151,10 @@ private fun MainNavigation() { } val density = LocalDensity.current val navBarInset = with(density) { WindowInsets.navigationBars.getBottom(this).toDp() } - val imeLeaving = WindowInsets.imeAnimationTarget.getBottom(density) == 0 - val showMiniPlayer = playerVisible && imeLeaving + val imeBottom = WindowInsets.ime.getBottom(density) + val imeTarget = WindowInsets.imeAnimationTarget.getBottom(density) + val revealBelowPx = with(density) { MINI_PLAYER_REVEAL.toPx() } + val showMiniPlayer = playerVisible && imeTarget <= imeBottom && imeBottom <= revealBelowPx Box(Modifier.fillMaxSize()) { Column(Modifier.fillMaxSize().imePadding()) {