# KugouLayout **Repository Path**: baijuncheng-open-source/kugou-layout ## Basic Information - **Project Name**: KugouLayout - **Description**: 页面滑动控制 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-22 - **Last Updated**: 2021-07-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # KugouLayout an interesting layout 一个模仿酷狗播放器滑动返回的layout 可以让你的app有更丰富 便捷的手势操作 支持activity滑动返回和普通layout的滑动 显示/隐藏 两种模式,可以参考demo里面的Activity1和Acitivyt2 **有喜欢KugouLayout的朋友 Star一下哦** # 个人建议使用场景 用于activity的滑动返回 需要使用网络加载要长时间等待的activity,可以用KugouLayout加入摇屏功能,让用户可以在等待加载期间拽一拽屏幕 and... # ScreenShot 图片较大 加载会慢一些 耐心等待 Demo Activity1 ![image](https://images.gitee.com/uploads/images/2021/0622/105440_4d2aaf3d_8230582.gif "activity1.gif") Demo Activity2 ![image](https://images.gitee.com/uploads/images/2021/0622/105513_d85f4fc1_8230582.gif "activity2.gif") # Using KugouLayout Library in your application ### Step 1: Compile the project and copy the HAR package generated in the Build directory of the KugouLayout folder into the project lib folder ### Step 2: Add the following code inside Gradle of Entry (just Demo) ``` implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) ``` ### Step 3: remote maven repo integration 1.add mavenCentral dependency at repositories in your project build.gradle ``` allprojects { repositories { mavenCentral() } } ``` 2.add library dependency at your module build.gradle ```xml implementation 'com.gitee.baijuncheng-open-source:kugou-layout:1.0.0' ``` # Usage ###Activity滑动返回 "customizeData": [ { "name": "hwc-theme", "value": "androidhwext:style/Theme.Emui.Translucent.NoTitleBar", "extra": "" } ] kg1 = (KugouLayout) myLayout.findComponentById(ResourceTable.Id_kg1); kg1.setScrollListener(new KugouLayout.ScrollStatusListener() { @Override public void onClose() { terminateAbility(); } }); //需要保护kugoulayout内横向滑动事件的scrollView添加到这里需要设置touchevent scrollView.setTouchEventListener(new Component.TouchEventListener() { @Override public boolean onTouchEvent(Component component, TouchEvent touchEvent) { return true; } }); # License Copyright (c) 2015 zhaozhentao Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 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 THE SOFTWARE.