Repository Details
Shared by


HelloGitHub Rating
0 ratings
Free•Apache-2.0
Claim
Discuss
Collect
Share
2.1k
Stars
Yes
Chinese
Java
Language
No
Active
2
Contributors
33
Issues
No
Organization
1.1.0
Latest
260
Forks
Apache-2.0
License
More

一个侧滑处理框架,而不是具体某种侧滑效果的实现。其内部封装十几种侧滑效果,包括侧滑返回、侧滑删除、百叶窗、开门等效果,总有那么几款能让你眼前一亮。示例代码:
```java
//为控件添加仿MIUI的弹性拉伸效果:
// 当纵向不能滚动(或滚动到顶/底)时,若继续拖动,则 UI 呈现弹性拉伸效果,释放后平滑恢复
SmartSwipe.wrap(view)
.addConsumer(new StretchConsumer())
.enableVertical();
SmartSwipe.wrap(view)
.addConsumer(new StretchConsumer())
.enableVertical() //仿 MIUI 拉伸效果的方向为:上下 2 个方向
.addConsumer(new SpaceConsumer())
.enableHorizontal() //仿 iOS 弹性留白效果的方向为:左右 2 个方向
;
SmartSwipeBack.activityBezierBack(application, null); //仿小米 MIUI 系统的贝塞尔曲线返回效果
SmartSwipeBack.activityStayBack(application, null); //仿手机 QQ 的手势滑动返回
SmartSwipeBack.activitySlidingBack(application, null); //仿微信带联动效果的透明侧滑返回
SmartSwipeBack.activityDoorBack(application, null); //侧滑开门样式关闭 activity
SmartSwipeBack.activityShuttersBack(application, null); //侧滑百叶窗样式关闭 activity
//xxxMode 第二个参数为 false,表示工作方向为纵向:下拉刷新&上拉加载更多
//如果第二个参数设置为 true,则表示工作方向为横向:右拉刷新&左拉加载更多
SmartSwipeRefresh.drawerMode(view, false).setDataLoader(loader);
SmartSwipeRefresh.behindMode(view, false).setDataLoader(loader);
SmartSwipeRefresh.scaleMode(view, false).setDataLoader(loader);
SmartSwipeRefresh.translateMode(view, false).setDataLoader(loader);
```
Included in:
Vol.41
Comments
Rating:
No comments yet