滑动关闭页面
<com.wiser.swipeactivity.SwipeFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fl_swipe"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/design_default_color_secondary"
app:sf_enable_drag="true"
app:sf_friction="2"
app:sf_percent_spring="4"
app:sf_duration="200"
app:sf_orientation="vertical"
app:sf_close_act="true"
tools:context=".MainActivity">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="swipe页面"
android:gravity="center"
android:textColor="@color/design_default_color_primary"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</com.wiser.swipeactivity.SwipeFrameLayout>
- sf_friction:摩擦力
- sf_percent_spring:滑动百分比距离关闭 4/height 默认是高度的1/4
- sf_enable_drag:是否能拖拽
- sf_duration:动画时长
- sf_close_act:是否关闭Activity
- sf_orientation:滑动方向
- horizontal
- vertical