• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

EasySwipeLayout: A simple sliding layout view, 一款简单高效的滑动库,模仿MIUI滑 ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

EasySwipeLayout

开源软件地址:

https://gitee.com/dkzwm/EasySwipeLayout

开源软件介绍:

EasySwipeLayout

ReleaseMinSdkLicense

English | 中文

A simple sliding layout view, 一款简单高效的滑动库,模仿MIUI滑动返回功能。

特性:

  • 支持上下左右边缘拉出.
  • 支持全局添加、Xml添加、单独添加.
  • 支持自定义效果.
  • 支持多点触摸.

引入

添加如下依赖到你的 build.gradle 文件:

dependencies {    implementation 'me.dkzwm.widget.esl:core:0.0.2'    AndroidX版本    implementation 'me.dkzwm.widget.esl:core:0.0.2.androidx'    AndroidX Kotlin版本    implementation 'me.dkzwm.widget.esl:core:0.0.2.androidxKT'}

快照

演示程序

下载 Demo.apk

使用

在Xml中配置

<?xml version="1.0" encoding="utf-8"?><me.dkzwm.widget.esl.EasySwipeLayout    android:id="@+id/easySwipeLayout"    xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    android:layout_width="match_parent"    android:layout_height="match_parent"    app:esl_direction="right"	//指定自定义Drawer的类名    app:esl_specified="@string/specified_the_class_name"	//指定样式为自定义,此时需要配置esl_specified属性    app:esl_style="custom"></me.dkzwm.widget.esl.EasySwipeLayout>

Java代码全局配置

EasySwipeConfig config =      new EasySwipeConfig.Builder(application)              .direction(Constants.DIRECTION_ALL)              .style(Constants.STYLE_MIUI)              .build();EasySwipeManager.init(config);}

Java代码单独配置

EasySwipeLayout layout = EasySwipeManager.attach(activity);if (layout != null) {     layout.setDirection(Constants.DIRECTION_LEFT);     layout.setDrawer(new CustomDrawer(this));     layout.setSwipeListener(             new OnSwipeListener() {                 @Override                 public void onSwipe(int side) {                     onBackPressed();                 }             });}

Xml属性

名称类型描述
esl_edgeDiffreference配置边缘点击容差,默认为2倍系统触摸容差(系统ScaledTouchSlop*2)
esl_styleenum配置拉出的效果,默认MIUI效果
esl_specifiedstring配置自定义效果的实现类路径,仅当esl_stylecustom时生效
esl_resistancefloat配置移动阻尼(默认:3f
esl_durationOfCloseint配置收起效果的时长(默认:500
esl_directionenum配置支持划出方向(默认:左边缘往右划

java属性设置方法

名称参数描述
setSwipeListenerOnSwipeListener配置监听
setDirectionint配置支持划出方向
setStyleint,String配置拉出的效果
setDrawerDrawer配置指定自定义效果实现
setEdgeDiffint配置边缘点击容差
setResistancefloat配置移动阻尼
setDurationOfCloseint配置收起效果的时长

License

MIT LicenseCopyright (c) 2018 dkzwmPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap