From 6a88755b7d7b8d4518cce4f732f2f6f557bff9bf Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Sat, 27 Dec 2025 20:57:23 -0500 Subject: [PATCH] playback: attempt to fix queue sheet insets --- .../auxio/playback/queue/QueueBottomSheetBehavior.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueBottomSheetBehavior.kt b/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueBottomSheetBehavior.kt index 8e56dad16..10608aa6e 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueBottomSheetBehavior.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueBottomSheetBehavior.kt @@ -83,9 +83,11 @@ class QueueBottomSheetBehavior(context: Context, attributeSet: Attribu override fun applyWindowInsets(child: View, insets: WindowInsets): WindowInsets { super.applyWindowInsets(child, insets) // Offset our expanded panel by the size of the playback bar, as that is shown when - // we slide up the panel. + // we slide up the panel. Use ideal bar height as fallback when the bar hasn't been + // measured yet (can occur when window insets are applied before onDependentViewChanged). val bars = insets.systemBarInsetsCompat - expandedOffset = barHeight + barSpacing + val effectiveBarHeight = if (barHeight > 0) barHeight else getIdealBarHeight(child.context) + expandedOffset = effectiveBarHeight + barSpacing return insets.replaceSystemBarInsetsCompat( bars.left, bars.top, bars.right, expandedOffset + bars.bottom) }