AndroidSwipeLayout:最强大的 Swipe Layout
2016-04-20 14:48
453 查看
http://hao.jobbole.com/androidswipelayout/
AndroidSwipeLayout是一个很强大的 Swipe Layout,和SwipeListView相比, 它不局限于ListView,点击图片观看效果
特性
轻松的整合ListView GridView ViewGroup
能回调 onOpen(), onUpdate
可以通知子元素
可以处理复杂的情况
下载
gradle
Java
mavenJava
使用例子
Java
Java
github网址 https://github.com/daimajia/AndroidSwipeLayout/wiki/usage
AndroidSwipeLayout是一个很强大的 Swipe Layout,和SwipeListView相比, 它不局限于ListView,点击图片观看效果
特性
轻松的整合ListView GridView ViewGroup
能回调 onOpen(), onUpdate
可以通知子元素
可以处理复杂的情况
下载
gradle
Java
1234 | dependencies { compile 'com.android.support:support-v4:20.+' compile "com.daimajia.swipelayout:library:1.1.7@aar"} |
1 2 3 4 5 6 7 8 9 10 11 | <dependency> <groupId>com.google.android</groupId> <artifactId>support-v4</artifactId> <version>r6</version> </dependency> <dependency> <groupId>com.daimajia.swipelayout</groupId> <artifactId>library</artifactId> <version>1.1.7</version> <type>apklib</type> </dependency> |
Java
1234567891011121314151617181920212223 | <com.daimajia.swipe.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="80dp"> <!-- Bottom View Start--> <LinearLayout android:background="#66ddff00" android:id="@+id/bottom_wrapper" android:layout_width="160dp" android:weightSum="1" android:layout_height="match_parent"> <!--What you want to show--> </LinearLayout> <!-- Bottom View End--> <!-- Surface View Start --> <LinearLayout android:padding="10dp" android:background="#ffffff" android:layout_width="match_parent" android:layout_height="match_parent"> <!--What you want to show in SurfaceView--> </LinearLayout> <!-- Surface View End --></com.daimajia.swipe.SwipeLayout> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | SwipeLayoutswipeLayout= (SwipeLayout)findViewById(R.id.sample1); //set show mode. swipeLayout.setShowMode(SwipeLayout.ShowMode.LayDown); //set drag edge. swipeLayout.setDragEdge(SwipeLayout.DragEdge.Left); swipeLayout.addSwipeListener(newSwipeLayout.SwipeListener(){ @Override publicvoidonClose(SwipeLayoutlayout){ //when the SurfaceView totally cover the BottomView. } @Override publicvoidonUpdate(SwipeLayoutlayout,intleftOffset,inttopOffset){ //you are swiping. } @Override publicvoidonOpen(SwipeLayoutlayout){ //when the BottomView totally show. } @Override publicvoidonHandRelease(SwipeLayoutlayout,floatxvel,floatyvel){ //when user's hand released. } }); |
相关文章推荐
- android 自定义AlertDialog(一段)
- android 中获取视频文件的缩略图(非原创)
- ndk配置+android jni开发笔记
- 从JAVA到Android开发
- Android基础--调用系统相机,打开相册,裁剪图片并展示到界面
- android开发环境
- android开发游记:ItemTouchHelper 使用RecyclerView打造可拖拽的GridView
- android开发的逗逼事件
- Android Handler防止内存溢出的写法
- Android中使用Notifaction无反应
- Android startActivityForResult
- android自定义view(一)
- Android中TextView滚动
- Android 5.0 后如何除去标题栏
- android开发游记:RecyclerView无法添加onItemClickListener最佳的高效解决方案
- Android中Raw和Asset的区别
- Android 获取屏幕宽高值
- android-Junit测试单个activity一
- Android 计算屏幕尺寸
- Android ActivityManagerService根据oom_adj数值内存回收机制