ui: only offset bottom sheet content via insets
This commit is contained in:
parent
ec5aca0b4c
commit
b89499fb36
3 changed files with 20 additions and 10 deletions
|
@ -114,7 +114,7 @@ class BottomSheetContentBehavior<V : View>(context: Context, attributeSet: Attri
|
|||
val bars = insets.systemBarInsetsCompat
|
||||
|
||||
insets.replaceSystemBarInsetsCompat(
|
||||
bars.left, bars.top, bars.right, (bars.bottom - consumed).coerceAtLeast(0))
|
||||
bars.left, bars.top, bars.right, consumed.coerceAtLeast(bars.bottom))
|
||||
}
|
||||
|
||||
setup = true
|
||||
|
@ -127,9 +127,7 @@ class BottomSheetContentBehavior<V : View>(context: Context, attributeSet: Attri
|
|||
val contentWidthSpec =
|
||||
View.MeasureSpec.makeMeasureSpec(parent.measuredWidth, View.MeasureSpec.EXACTLY)
|
||||
val contentHeightSpec =
|
||||
View.MeasureSpec.makeMeasureSpec(
|
||||
parent.measuredHeight - consumed, View.MeasureSpec.EXACTLY)
|
||||
|
||||
View.MeasureSpec.makeMeasureSpec(parent.measuredHeight, View.MeasureSpec.EXACTLY)
|
||||
child.measure(contentWidthSpec, contentHeightSpec)
|
||||
}
|
||||
|
||||
|
|
|
@ -17,19 +17,24 @@
|
|||
app:navGraph="@navigation/inner"
|
||||
tools:layout="@layout/fragment_home" />
|
||||
|
||||
<View android:id="@+id/main_scrim" android:layout_height="match_parent" android:layout_width="match_parent"/>
|
||||
<View
|
||||
android:id="@+id/main_scrim"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/main_sheet_scrim"
|
||||
android:background="?attr/colorSurfaceContainerLow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0"
|
||||
android:layout_height="match_parent" />
|
||||
android:background="?attr/colorSurfaceContainerLow" />
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/playback_sheet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:layout_behavior="org.oxycblt.auxio.playback.PlaybackBottomSheetBehavior">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
|
@ -39,9 +44,9 @@
|
|||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
style="@style/Widget.Auxio.DisableDropShadows"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
style="@style/Widget.Auxio.DisableDropShadows"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
|
@ -82,7 +87,10 @@
|
|||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View android:id="@+id/sheet_scrim" android:layout_height="match_parent" android:layout_width="match_parent"/>
|
||||
<View
|
||||
android:id="@+id/sheet_scrim"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
android:id="@+id/playback_sheet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:layout_behavior="org.oxycblt.auxio.playback.PlaybackBottomSheetBehavior">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
|
@ -55,6 +57,8 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:elevation="1dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:layout_behavior="org.oxycblt.auxio.playback.queue.QueueBottomSheetBehavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
|
Loading…
Reference in a new issue