I use persistent bottom sheet
view in coordinatorLayout
. my layout:
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- main content -->
<RelativeLayout
android:id="@+id/mainContentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- i need Dragging this layout to slide up bottom sheet -->
</RelativeLayout>
<!-- persistent bottom sheet -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/bottomSheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/bottom_sheet_behavior"
app:behavior_hideable="false"
app:behavior_peekHeight="70dp">
<!-- content bottom sheet (recyclerview or ...) -->
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
and register bottom sheet view:
BottomSheetBehavior bottomSheetBehavior;
View bottomSheet = findViewById(R.id.bottomSheet);
bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
bottomSheetBehavior.setHideable(false);
now, in addition to slide through bottom R.id.bottomSheet
, I also need dragging main content R.id.mainContentLayout
to slide up bottomSheet.
How to add this feature?