From 5ea2ccfc7c51396760c233a09ad15ea16d88876f Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Sat, 17 Jan 2026 09:36:58 -0700 Subject: [PATCH] Revert "ui: 3rd fix to bottom sheet insets overlap" This reverts commit 5af437e47f0adf45cbfc103903615009f885cad3. --- .../org/oxycblt/auxio/ui/BaseBottomSheetBehavior.kt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/src/main/java/org/oxycblt/auxio/ui/BaseBottomSheetBehavior.kt b/app/src/main/java/org/oxycblt/auxio/ui/BaseBottomSheetBehavior.kt index f83e7689a..8f4488a7d 100644 --- a/app/src/main/java/org/oxycblt/auxio/ui/BaseBottomSheetBehavior.kt +++ b/app/src/main/java/org/oxycblt/auxio/ui/BaseBottomSheetBehavior.kt @@ -97,15 +97,6 @@ abstract class BaseBottomSheetBehavior(context: Context, attributeSet: true override fun onLayoutChild(parent: CoordinatorLayout, child: V, layoutDirection: Int): Boolean { - // Pre-calculate peekHeight before the sheet is positioned by super.onLayoutChild(). - // This ensures correct positioning during configuration changes (e.g., split-screen - // resize) where layout happens before insets are applied. Use the bar's measured - // height if available, otherwise fall back to the ideal height. - val bar = (child as ViewGroup).getChildAt(0) - val barHeight = - if (bar.measuredHeight > 0) bar.measuredHeight else getIdealBarHeight(child.context) - peekHeight = barHeight + idealBottomGestureInsets - val layout = super.onLayoutChild(parent, child, layoutDirection) // Don't repeat redundant initialization. if (!initalized) { @@ -118,6 +109,7 @@ abstract class BaseBottomSheetBehavior(context: Context, attributeSet: setOnApplyWindowInsetsListener(::applyWindowInsets) } initalized = true + peekHeight = getIdealBarHeight(child.context) + idealBottomGestureInsets } // Sometimes CoordinatorLayout doesn't dispatch window insets to us, likely due to how // much we overload it. Ensure that we get them.