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
|
val bars = insets.systemBarInsetsCompat
|
||||||
|
|
||||||
insets.replaceSystemBarInsetsCompat(
|
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
|
setup = true
|
||||||
|
@ -127,9 +127,7 @@ class BottomSheetContentBehavior<V : View>(context: Context, attributeSet: Attri
|
||||||
val contentWidthSpec =
|
val contentWidthSpec =
|
||||||
View.MeasureSpec.makeMeasureSpec(parent.measuredWidth, View.MeasureSpec.EXACTLY)
|
View.MeasureSpec.makeMeasureSpec(parent.measuredWidth, View.MeasureSpec.EXACTLY)
|
||||||
val contentHeightSpec =
|
val contentHeightSpec =
|
||||||
View.MeasureSpec.makeMeasureSpec(
|
View.MeasureSpec.makeMeasureSpec(parent.measuredHeight, View.MeasureSpec.EXACTLY)
|
||||||
parent.measuredHeight - consumed, View.MeasureSpec.EXACTLY)
|
|
||||||
|
|
||||||
child.measure(contentWidthSpec, contentHeightSpec)
|
child.measure(contentWidthSpec, contentHeightSpec)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,19 +17,24 @@
|
||||||
app:navGraph="@navigation/inner"
|
app:navGraph="@navigation/inner"
|
||||||
tools:layout="@layout/fragment_home" />
|
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
|
<View
|
||||||
android:id="@+id/main_sheet_scrim"
|
android:id="@+id/main_sheet_scrim"
|
||||||
android:background="?attr/colorSurfaceContainerLow"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
android:alpha="0"
|
android:alpha="0"
|
||||||
android:layout_height="match_parent" />
|
android:background="?attr/colorSurfaceContainerLow" />
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
android:id="@+id/playback_sheet"
|
android:id="@+id/playback_sheet"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
app:layout_behavior="org.oxycblt.auxio.playback.PlaybackBottomSheetBehavior">
|
app:layout_behavior="org.oxycblt.auxio.playback.PlaybackBottomSheetBehavior">
|
||||||
|
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
|
@ -39,9 +44,9 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
style="@style/Widget.Auxio.DisableDropShadows"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
style="@style/Widget.Auxio.DisableDropShadows"
|
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
|
@ -82,7 +87,10 @@
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</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>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
android:id="@+id/playback_sheet"
|
android:id="@+id/playback_sheet"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
app:layout_behavior="org.oxycblt.auxio.playback.PlaybackBottomSheetBehavior">
|
app:layout_behavior="org.oxycblt.auxio.playback.PlaybackBottomSheetBehavior">
|
||||||
|
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
|
@ -54,7 +56,9 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:elevation="1dp"
|
android:elevation="1dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
app:layout_behavior="org.oxycblt.auxio.playback.queue.QueueBottomSheetBehavior">
|
app:layout_behavior="org.oxycblt.auxio.playback.queue.QueueBottomSheetBehavior">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
|
Loading…
Reference in a new issue