We can implement BottomSheet design like a GoogleMap.
AOSP: BottomSheetBehavior.java
Layout Sample
We add the param app:layout_behavior="@string/bottom_sheet_behavior" in child view of CoordinatorLayout.1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | < android.support.design.widget.CoordinatorLayout android:layout_width = "match_parent" android:layout_height = "match_parent" tools:context = ".MainActivity" > < LinearLayout android:layout_width = "match_parent" android:layout_height = "match_parent" android:orientation = "vertical" app:layout_behavior = "@string/bottom_sheet_behavior" app:behavior_peekHeight = "240dp" app:behavior_hideable = "false" android:background = "@android:color/white" > < TextView android:layout_width = "match_parent" android:layout_height = "match_parent" android:text = "BottomSheet Sample" /> </ LinearLayout > </ android.support.design.widget.CoordinatorLayout > |
- app:behavior_peekHeight
- BottomSheet minimum size
- app:behavior_hideable
- BottomSheet is hidden when scroll to bottom.
No comments:
Post a Comment