# SwipeDelMenuLayout
[![](https://jitpack.io/v/mcxtzhang/SwipeDelMenuLayout.svg)](https://jitpack.io/#mcxtzhang/SwipeDelMenuLayout)
#### [中文版文档](https://github.com/mcxtzhang/SwipeDelMenuLayout/blob/master/README-cn.md)
Related blog:
V1.0:
http://blog.csdn.net/zxt0601/article/details/52303781
V1.2:
http://blog.csdn.net/zxt0601/article/details/53157090
If you like,please give me a star, thank you very much
## Where to find me:
Github:
https://github.com/mcxtzhang
CSDN:
http://blog.csdn.net/zxt0601
gold.xitu.io:
http://gold.xitu.io/user/56de210b816dfa0052e66495
jianshu:
http://www.jianshu.com/users/8e91ff99b072/timeline
***
# Important words: not for the RecyclerView or ListView, for the Any ViewGroup.
# Intro
This control has since rolled out in the project use over the past seven months, distance on a push to making it the first time, also has + 2 month. (before, I published an article. Portal: http://gold.xitu.io/entry/57d1115dbf22ec005f9593c6/detail, it describes in detail the control how V1.0 version is done.)
During a lot of friends in the comment, put forward some improvement of ** in the issue, such as support setting sliding direction (or so), high imitation QQ interaction, support GridLayoutManager etc, as well as some bug **. I have been all real, repair **. And its packaging to jitpack, introducing more convenient**. Compared to the first edition, change a lot. So to arrange, new version.
So this paper start with how to use it, and then introduces the features of it contains, in support of the property. Finally a few difficulties and conflict resolution.
ItemDecorationIndexBar + SwipeMenuLayout
(The biggest charm is 0 coupling at the controls,So, you see first to cooperate with me another library assembly effect):
(ItemDecorationIndexBar : https://github.com/mcxtzhang/ItemDecorationIndexBar)
![image](https://github.com/mcxtzhang/SwipeDelMenuLayout/blob/master/gif/ItemDecorationIndexBar_SwipeDel.gif)
Casually to use in a flow layout also easy:
![](https://github.com/mcxtzhang/SwipeDelMenuLayout/blob/master/gif/FlowSwipe.gif)
Android Special Version (Without blocking type, when the lateral spreads menus, still can be expanded to other side menu, at the same time on a menu will automatically shut down):
![image](https://github.com/mcxtzhang/SwipeDelMenuLayout/blob/master/gif/LinearLayoutManager1.gif)
GridLayoutManager (And the above code than, need to modify RecyclerView LayoutManager):
![image](https://github.com/mcxtzhang/SwipeDelMenuLayout/blob/master/gif/grid.gif)
LinearLayout (Without any modification, even can simple LinearLayout implementation side menu):
![image](https://github.com/mcxtzhang/SwipeDelMenuLayout/blob/master/gif/linear.gif)
iOS interaction (Block type interaction, high imitation QQ, sideslip menu expansion, blocking other ITEM all operations):
![image](https://github.com/mcxtzhang/SwipeDelMenuLayout/blob/master/gif/iOS.gif)
# Usage:
Step 1. Add the JitPack repository to your build file。
Add it in your root build.gradle at the end of repositories:
```
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```
Step 2. Add the dependency
```
dependencies {
compile 'com.github.mcxtzhang:SwipeDelMenuLayout:V1.2.5'
}
```
Step 3. Outside the need sideslip delete ContentItem on the controls, within the control lined ContentItem, menu:
**At this point You can use high copy IOS, QQ sideslip delete menu functions**
(Sideslip menu click events is by setting the id to get, in line with other controls, no longer here)
Demo, I ContentItem is a TextView, then I'm in the outside its nested controls, and order, in the side menu, in turn, can arrange menu controls.
```
<?xml version="1.0" encoding="utf-8"?>
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="100dp"
android:clickable="true"
android:paddingBottom="1dp">
<TextView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="项目中我是任意复杂的原ContentItem布局"/>
<!-- 以下都是侧滑菜单的内容依序排列 -->
<Button
android:id="@+id/btnTop"
android:layout_width="60dp"
android:layout_height="match_parent"
android:background="#d9dee4"
android:text="置顶"
android:textColor="@android:color/white"/>
<Button
android:id="@+id/btnUnRead"
android:layout_width="120dp"
android:layout_height="match_parent"
android:background="#ecd50a"
android:clickable="true"
android:text="标记未读"
android:textColor="@android:color/white"/>
<Button
android:id="@+id/btnDelete"
android:layout_width="60dp"
android:layout_height="match_parent"
android:background="@color/red_ff4a57"
android:text="删除"
android:textColor="@android:color/white"/>
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
```
**One Tips**:
If it is used in the ListView, RecyclerView, click event Settings should be correct in the Adapter for ContentItem Settings, cannot use ListView. SetOnItemClickListener.
When the Item is control, not the ContentItem inside the area, and there are a lot of touch judge the control area, internal contain ContentItem and sideslip Menu Menu.
---
# Attributes:
1 Through isIos variable control whether IOS block type interaction, is on by default.
2 Through isSwipeEnable variable control whether open right menu, open by default. (in some scenarios, reuse item, no edit permissions the user cannot slide from right)
3 Through the left slide right slide switch isLeftSwipe support
how to setting:
One:xml:
```xml
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
app:ios="false"
app:leftSwipe="true"
app:swipeEnable="true">
```
Other: java Codes:
```java
//这句话关掉IOS阻塞式交互效果 并依次打开左滑右滑 禁用掉侧滑菜单
((SwipeMenuLayout) holder.itemView).setIos(false).setLeftSwipe(position % 2 == 0 ? true : false).setSwipeEnable(false);
```
# Speciality:
* don't simultaneously 2 + a side menu. (visible interface will appear, at most, only a side menu).
* in the process of sideslip, banning parent slide up and down.
* more refers to slide at the same time, the screen after the touch of a few fingers.
* increase viewChache the get () method, which can be used in: when click on the external space, shut down is the slide of the menu.
* to the first child Item (i.e. ContentItem) to control the width of the width
# checklist:
Will happen due to the last iteration, after completing a feature, fix a bug that caused new bug.
So, to sort out a checkList for validation after each iteration, all through, will push to making library.
feature | desc | verify
--- |----------| ---
isIos | Switch to the IOS obstruction interaction patterns, Android features non-blocking feature under interactive mode can work normally|
isSwipeEnable |Whether to support close function of sideslip
isLeftSwipe | Whether to support two-way sliding
Click the ContentItem content |
ContentItem content can be long press |
Sideslip menu display, ContentItem not click |
Sideslip menu is displayed, ContentItem not long press |
Lateral spreads menu is displayed, sideslip can click on the menu |
Sideslip menu is displayed, click ContentItem area close the menu |
Lateral spreads, in the process of shielding long pr
没有合适的资源?快使用搜索试试~ 我知道了~
android可以包含任意viewgroup的侧滑删除
共162个文件
xml:60个
java:14个
sample:9个
需积分: 10 23 下载量 196 浏览量
2017-09-14
16:38:52
上传
评论
收藏 6.82MB ZIP 举报
温馨提示
可以嵌套任意viewgroup,可以自定义侧滑按钮,按钮个数不限,非常适合recyclerview和listview使用;可以嵌套任意viewgroup,可以自定义侧滑按钮,按钮个数不限,非常适合recyclerview和listview使用.
资源推荐
资源详情
资源评论
收起资源包目录
android可以包含任意viewgroup的侧滑删除 (162个子文件)
swipemenulib-release.aar 9KB
swipemenulib-debug.aar 1KB
resources-debug-androidTest.ap_ 1KB
gradlew.bat 2KB
fileSnapshots.bin 1.12MB
fileHashes.bin 271KB
taskArtifacts.bin 104KB
localClassSetAnalysis.bin 33KB
localClassSetAnalysis.bin 21KB
localJarClasspathSnapshot.bin 21KB
localJarClasspathSnapshot.bin 18KB
SwipeMenuLayout.class 11KB
SwipeMenuLayout$1.class 1KB
SwipeMenuLayout$3.class 1KB
SwipeMenuLayout$2.class 867B
SwipeMenuLayout$4.class 866B
R$styleable.class 668B
BuildConfig.class 600B
R$attr.class 542B
R.class 423B
config 341B
description 73B
exclude 240B
LinearLayoutManager1.gif 598KB
iOS.gif 471KB
FlowSwipe.gif 428KB
ItemDecorationIndexBar_SwipeDel.gif 423KB
doubleSwipe.gif 376KB
grid.gif 204KB
linear.gif 148KB
.gitignore 127B
.gitignore 8B
.gitignore 8B
build.gradle 885B
build.gradle 565B
build.gradle 508B
settings.gradle 33B
gradlew 5KB
HEAD 195B
HEAD 195B
HEAD 32B
HEAD 23B
pack-52a4957f49319521b6982f240892d70f4c3576b6.idx 27KB
app.iml 10KB
swipemenulib.iml 8KB
SwipeDelMenuLayout.iml 895B
index 6KB
gradle-wrapper.jar 52KB
classes.jar 9KB
SwipeMenuLayout.java 29KB
FullDelDemoAdapter.java 5KB
R.java 4KB
R.java 4KB
R.java 4KB
FullDelDemoActivity.java 4KB
ListViewDelDemoActivity.java 2KB
LinearLayoutDelDemoActivity.java 2KB
LauncherActivity.java 1KB
R.java 799B
BuildConfig.java 469B
BuildConfig.java 459B
BuildConfig.java 438B
SwipeBean.java 220B
values.json 227B
localClassSetAnalysis.lock 17B
taskArtifacts.lock 17B
localJarClasspathSnapshot.lock 17B
localJarClasspathSnapshot.lock 17B
localClassSetAnalysis.lock 17B
master 195B
master 41B
LICENSE.md 11KB
README.md 10KB
README-cn.md 10KB
pack-52a4957f49319521b6982f240892d70f4c3576b6.pack 3.82MB
packed-refs 1KB
ic_launcher.png 8KB
point_icon_delete.png 1KB
proguard-rules.pro 688B
proguard-rules.pro 675B
gradle.properties 747B
local.properties 554B
gradle-wrapper.properties 236B
compile-file-map.properties 31B
compile-file-map.properties 31B
compile-file-map.properties 31B
pre-rebase.sample 5KB
update.sample 4KB
pre-commit.sample 2KB
pre-push.sample 1KB
prepare-commit-msg.sample 1KB
commit-msg.sample 896B
applypatch-msg.sample 478B
pre-applypatch.sample 424B
post-update.sample 189B
dependency.store 5B
dependency.store 5B
dependency.store 5B
R.txt 286B
R.txt 286B
共 162 条
- 1
- 2
资源评论
昊帅
- 粉丝: 12
- 资源: 27
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Matlab人脸肤色定理的教师人数统计+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab霍夫曼变换的表盘读数识别+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab火灾烟雾检测源码带GUI界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab的恶劣天气交通标志识别系统+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的霍夫曼变换的表盘示数识别+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab的车道线识别系统 +源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的教室人数统计系统带Gui界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB的教室人数统计系统带Gui界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于MATLAB 的霍夫曼变换答题卡识别源码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab+bp神经网络的神经网络汉字识别系统+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功