From 3c3b9ac7cc438cecb08603f28fe07d6b45b44ea7 Mon Sep 17 00:00:00 2001 From: OxygenCobalt Date: Mon, 8 Aug 2022 22:21:10 -0600 Subject: [PATCH] queue: make sheet corner radius sharp Make the corner radius of the queue sheet also sharp. This is to ensure consistency with the playback sheet as it currently stands. As soon as I can do only-inset content behavior and can thus round the playback bar, I'll also re-round the queue bar. --- .../auxio/playback/queue/QueueSheetBehavior.kt | 8 -------- .../oxycblt/auxio/ui/BottomSheetContentBehavior.kt | 13 +++++++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueSheetBehavior.kt b/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueSheetBehavior.kt index ff67e1d0c..9586ba7da 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueSheetBehavior.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueSheetBehavior.kt @@ -23,7 +23,6 @@ import android.view.View import android.view.WindowInsets import androidx.coordinatorlayout.widget.CoordinatorLayout import com.google.android.material.shape.MaterialShapeDrawable -import com.google.android.material.shape.ShapeAppearanceModel import org.oxycblt.auxio.R import org.oxycblt.auxio.ui.AuxioSheetBehavior import org.oxycblt.auxio.util.* @@ -57,13 +56,6 @@ class QueueSheetBehavior(context: Context, attributeSet: AttributeSet? MaterialShapeDrawable.createWithElevationOverlay(context).apply { fillColor = context.getAttrColorCompat(R.attr.colorSurface) elevation = context.getDimen(R.dimen.elevation_normal) - - val cornersMedium = context.getDimen(R.dimen.size_corners_medium) - shapeAppearanceModel = - ShapeAppearanceModel.Builder() - .setTopLeftCornerSize(cornersMedium) - .setTopRightCornerSize(cornersMedium) - .build() } override fun applyWindowInsets(child: View, insets: WindowInsets): WindowInsets { 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 bac1ae091..a531fa22c 100644 --- a/app/src/main/java/org/oxycblt/auxio/ui/BottomSheetContentBehavior.kt +++ b/app/src/main/java/org/oxycblt/auxio/ui/BottomSheetContentBehavior.kt @@ -31,6 +31,19 @@ import org.oxycblt.auxio.util.systemBarInsetsCompat /** * A behavior that automatically re-layouts and re-insets content to align with the parent layout's * bottom sheet. + * + * Ideally, we would one day want to switch to only re-insetting content, however this comes with + * several issues:: + * 1. Scroll position. I need to find a good way to save padding in order to prevent desync, as + * window insets tend to be applied after restoration. + * 2. Over scrolling. Glow scrolls will not cut it, as the bottom glow will be caught under the bar, + * and moving it above the insets will result in an incorrect glow position when the bar is not + * shown. I have to emulate stretch scrolling below Android 12 instead. However, this is also + * similarly distorted by the insets, and thus I must go further and modify the edge effect to be + * at least somewhat clamped to the insets themselves. + * 3. Touch events. Bottom sheets must always intercept touches in their bounds, or they will + * click the now overlapping content view that is only inset by it and not unhidden by it. + * * @author OxygenCobalt */ class BottomSheetContentBehavior(context: Context, attributeSet: AttributeSet?) :