在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:EasySwipeLayout开源软件地址:https://gitee.com/dkzwm/EasySwipeLayout开源软件介绍:EasySwipeLayoutEnglish | 中文A simple sliding layout view, 一款简单高效的滑动库,模仿MIUI滑动返回功能。 特性:
引入添加如下依赖到你的 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属性
java属性设置方法
LicenseMIT 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. |
请发表评论