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.
This commit is contained in:
OxygenCobalt 2022-08-08 22:21:10 -06:00
parent fe38c70d34
commit 3c3b9ac7cc
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 13 additions and 8 deletions

View file

@ -23,7 +23,6 @@ import android.view.View
import android.view.WindowInsets import android.view.WindowInsets
import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.coordinatorlayout.widget.CoordinatorLayout
import com.google.android.material.shape.MaterialShapeDrawable import com.google.android.material.shape.MaterialShapeDrawable
import com.google.android.material.shape.ShapeAppearanceModel
import org.oxycblt.auxio.R import org.oxycblt.auxio.R
import org.oxycblt.auxio.ui.AuxioSheetBehavior import org.oxycblt.auxio.ui.AuxioSheetBehavior
import org.oxycblt.auxio.util.* import org.oxycblt.auxio.util.*
@ -57,13 +56,6 @@ class QueueSheetBehavior<V : View>(context: Context, attributeSet: AttributeSet?
MaterialShapeDrawable.createWithElevationOverlay(context).apply { MaterialShapeDrawable.createWithElevationOverlay(context).apply {
fillColor = context.getAttrColorCompat(R.attr.colorSurface) fillColor = context.getAttrColorCompat(R.attr.colorSurface)
elevation = context.getDimen(R.dimen.elevation_normal) 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 { override fun applyWindowInsets(child: View, insets: WindowInsets): WindowInsets {

View file

@ -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 * A behavior that automatically re-layouts and re-insets content to align with the parent layout's
* bottom sheet. * 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 * @author OxygenCobalt
*/ */
class BottomSheetContentBehavior<V : View>(context: Context, attributeSet: AttributeSet?) : class BottomSheetContentBehavior<V : View>(context: Context, attributeSet: AttributeSet?) :