开源一个小小的可以使控件从右侧滑入的Behavior,借鉴了不少BottomSheetBehavior中的代码。不多说,直接上github地址
https://github.com/qgswsg/SideslipEntry
示例代码
<ViewGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="16dp"
app:fitToContents="false"
app:halfable="true"
app:hideable="true"
app:layout_behavior="com.qgswsg.side_slip_entry.SideSlipEntryBehavior"
app:smallTailMovedOut="true"
app:smallTailWidth="50dp"
app:smallTailView="@id/smallTailView"
tools:ignore="MissingPrefix">
...
</ViewGroup>
//依赖
implementation 'com.qgswsg.side_slip_entry:SideSlipEntry:1.5'