# SideSlipLayout **Repository Path**: viifo/SideSlipLayout ## Basic Information - **Project Name**: SideSlipLayout - **Description**: 一个整体滑动的侧滑菜单。 - **Primary Language**: Android - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: https://viifo.host/android/2021-10-16-SideSlipLayout%E6%95%B4%E4%BD%93%E4%BE%A7%E6%BB%91%E8%8F%9C%E5%8D%95.html - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-09-11 - **Last Updated**: 2022-11-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SideSlipLayout [![](https://jitpack.io/v/viifo/SideSlipLayout.svg)](https://jitpack.io/#viifo/SideSlipLayout) [![](https://maven-badges.herokuapp.com/maven-central/io.github.viifo/sidesliplayout/badge.svg)](https://search.maven.org/artifact/io.github.viifo/sidesliplayout) [中文](https://gitee.com/viifo/SideSlipLayout/blob/master/README.md) | [English](https://gitee.com/viifo/SideSlipLayout/blob/master/README_en.md) An overall sliding side-slip layout. ## Preview ![](./screenshots/p1.gif) ![](./screenshots/p2.gif) ## Gradle 1. Add it in your root build.gradle at the end of repositories: ```groovy allprojects { repositories { ... mavenCentral() // or // maven { url 'https://jitpack.io' } } } ``` 2. Add the dependency: ```groovy dependencies { implementation 'io.github.viifo:sidesliplayout:1.0.1' // or // implementation 'com.github.viifo:SideSlipLayout:1.0.1' } ``` ## Usage 1. Add in XML: ```xml ``` 2. Add status callback: ```java sideSlipLayout.setStatusCallBack(new SideSlipLayoutCallback() { @Override public void opened(@NotNull SideSlipLayout layout) { // opened } @Override public void closed(@NotNull SideSlipLayout layout) { // closed } @Override public void dragging(@NotNull SideSlipLayout layout, int left) { // dragging } }); ``` 3. Expand the sidebar ```java if (!sideSlipLayout.isOpening()) { sideSlipLayout.open(); } ``` 4. Collapse the sidebar ```java if (sideSlipLayout.isOpening()) { sideSlipLayout.close(); } ``` ## Tips If there is a sliding conflict with the child view, the child view needs to control whether the SideSlipLayout intercepts the Touch event according to the business logic. ``` getParent().requestDisallowInterceptTouchEvent(Boolean) // or SideSlipLayout.requestDisallowInterceptTouch(Boolean) ``` ## License ``` Copyright 2021 viifo Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```