From f62d929c376e3d8b13d755a9728c0fff88aea180 Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Sat, 10 Jan 2026 19:07:58 -0700 Subject: [PATCH] detail: try to fix list overlap on redmi/honor --- .../auxio/ui/BottomSheetContentBehavior.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/src/main/java/org/oxycblt/auxio/ui/BottomSheetContentBehavior.kt b/app/src/main/java/org/oxycblt/auxio/ui/BottomSheetContentBehavior.kt index aed8ea316..f4bd308e4 100644 --- a/app/src/main/java/org/oxycblt/auxio/ui/BottomSheetContentBehavior.kt +++ b/app/src/main/java/org/oxycblt/auxio/ui/BottomSheetContentBehavior.kt @@ -68,6 +68,10 @@ class BottomSheetContentBehavior(context: Context, attributeSet: Attri if (consumed != lastConsumed) { L.d("Consumed amount changed, re-applying insets") lastConsumed = consumed + // Force insets to be recalculated. On some OEM devices (MIUI, EMUI), + // initial inset dispatch happens before the sheet is ready, and without + // this explicit request, content never receives correct bottom padding. + child.requestApplyInsets() lastInsets?.let(child::dispatchApplyWindowInsets) measureContent(parent, child) layoutContent(child) @@ -116,6 +120,19 @@ class BottomSheetContentBehavior(context: Context, attributeSet: Attri setup = true } + // Ensure consumed value is up-to-date on every layout pass. This handles cases + // where configuration changes (split-screen resize) trigger layout before + // onDependentViewChanged is called. + val dep = dep + if (dep != null) { + val behavior = dep.coordinatorLayoutBehavior as BackportBottomSheetBehavior + val consumed = behavior.calculateConsumedByBar() + if (consumed != Int.MIN_VALUE && consumed != lastConsumed) { + lastConsumed = consumed + child.requestApplyInsets() + } + } + return true }