SlideMenuLayout

简介:一个支持左右滑动并带有视差滑动效果的安卓侧滑菜单控件(效果参考 QQ、探探侧滑)
更多:作者   提 Bug   
标签:
SlideMenu-侧滑-菜单-

Introduction

An android slide menu that supports left and right swipes and slides with parallax.
一个支持左右滑动并带有视差滑动效果的安卓滑动菜单控件。(中文版入口)
Platform

Demo

Encapsulate the sliding nesting of different scenarios.

Features

  • [x] support for sliding direction configuration
  • [x] it can be used as view
  • [x] Handle the sliding conflicts in each scenarios

Version

name SlideMenuLayout
latest Download

Configure

Maven

<dependency>
  <groupId>com.justkiddingbaby</groupId>
  <artifactId>slidemenu</artifactId>
  <version>the latest version</version>
  <type>pom</type>
</dependency>

JCenter

First. add to project build.gradle

repositories {
    jcenter()
}

Second. add to module build.gradle

compile 'com.justkiddingbaby:slidemenu:the latest version'

Attributes instruction

attribute instruction value
slideMode sliding mode left right both none
slidePadding the content view padding when slide menu is opened dimension
slideTime the time of slide menu open,the default value is 800ms integer

Function instruction

return function name instruction
void setSlideMode(int slideMode) set slide mode
void setSlidePadding(int slidePadding) set slide content padding when slide menu is open
void setSlideTime(int slideTime) set the time of opening slide menu
View getSlideLeftView() return left slide menu view
View getSlideRightView() return right slide menu view
View getSlideContentView() return content view
void toggleLeftSlide() open or close left slide menu
void openLeftSlide() open left slide menu
void closeLeftSlide() close left slide menu
boolean isLeftSlideOpen() return the result of left slide menu is open
void toggleRightSlide() open or close right slide menu
void openRightSlide() open right slide menu
void closeRightSlide() close right slide menu
boolean isRightSlideOpen() return the result of right slide menu is open

Usage

use in the layout

 <com.jkb.slidemenu.SlideMenuLayout
        android:id="@+id/mainSlideMenu"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        app:slideMode="both">
        <include layout="@layout/content_menu_left" />
        <include layout="@layout/content_menu_right" />
        <include layout="@layout/content_menu_content" />
 </com.jkb.slidemenu.SlideMenuLayout>

Mind

when you use SlideMenuLayout in layout,it can only host three child view,and the left slide menu view and the right slide menu view must add before the content view (for prevent the right slide menu from overlapping).
if slideMode is both then the SlideViewLayout must host three child views.

Release history

v1.0.1(2017/6/29)

1、alter minSdkVersion to SDK 12.

v1.0.0(2017/6/8)

1、release SlideMenuLayout,Handle the sliding conflicts in each scenarios.
2、Encapsulation demo.

Android 开发经验分享
用了一年多的理财推荐
Android 开发经验分享
用了一年多的理财推荐