放圖
sheet.gif
sheet2.gif
github
在原有的基礎上讓BottomSheetBehavior 支持從上往下拉.
xml 使用:
<LinearLayout
android:id="@+id/design_bottom_sheet"
android:layout_width="match_parent"
app:layout_behavior="@string/SheetBehavior"
app:peekHeight=“50dp"
app:hiddenEnable=“false”
app:slideMode=“top”
android:layout_height="match_parent">
...
</LinearLayout>
在原有的基礎上加入了slideMode
slideMode 的值為top,bottom,默認為bottom.
java 的使用與BottomSheetBehavior 一致.
并添加了3個便捷方法.expand
,collapsed
,hidden
并且在代碼中解決了上一篇說提到的問題http://www.lxweimin.com/p/21bb14e3be94.