Android 滑动删除控件推荐
implementation 'com.github.mcxtzhang:SwipeDelMenuLayout:V1.3.0'
<?xml version="1.0" encoding="utf-8"?> <com.mcxtzhang.swipemenulib.SwipeMenuLayout android:layout_height="wrap_content" android:layout_width="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:clickable="true" android:focusable="true" android:paddingBottom="1dp" app:ios="false" app:leftSwipe="true" app:swipeEnable="true" xmlns:android="http://schemas.android.com/apk/res/android"> <自己的布局/> <Button android:id="@+id/btnDelete" android:layout_width="@dimen/dp_80" android:layout_height="match_parent" android:background="@color/red" android:text="删除" android:textColor="@android:color/white"/> </com.mcxtzhang.swipemenulib.SwipeMenuLayout>
使用方法:
btnDelete.setOnClickListener { DialogModel.showSelectDialog("提示", "删除后该转货单不可恢复也不可进行出发到达操作", confirmText = "确定", cancelAble = true) { list.removeAt(position) notifyItemRemoved(position) } }
我给你买橘子