Billy Newman
01/10/2022, 10:46 PMSimple nested scrolling requires no action on your part. Gestures that initiate a scrolling action are propagated from children to parents automatically, such that when the child can't scroll any further, the gesture is handled by its parent element.
When I scroll up in the bottom sheet, the bottom sheet first resizes to fill the screen then properly scrolls to the bottom of the content, which is the expected behavior. However, when trying to scroll back to the top of the content (ie dragging down), the bottom sheet starts to collapse instead of scrolling the content down first.<androidx.compose.ui.platform.ComposeView
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:behavior_hideable="true"
app:behavior_peekHeight="200dp"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" />
And my content in compose:
Column(
modifier = Modifier.verticalScroll(scrollState)
) { ... }
Albert Chang
01/11/2022, 2:37 AMBilly Newman
01/11/2022, 1:21 PM<FrameLayout
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:behavior_hideable="true"
app:behavior_peekHeight="200dp"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" >
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.compose.ui.platform.ComposeView
android:id="@+id/compose_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</androidx.compose.ui.platform.ComposeView>
</androidx.core.widget.NestedScrollView>
</FrameLayout>