Skip to content

jenly1314/SuperSlidingPaneLayout

Repository files navigation

SuperSlidingPaneLayout

JitPack Download API License

SuperSlidingPaneLayout是在SlidingPaneLayout的基础之上扩展修改,新增几种不同的侧滑效果,基本用法与SlidingPaneLayout一致。

效果展示

Image

你也可以直接下载 演示App 体验效果

引入

Gradle:

  1. 在Project的 build.gradlesetting.gradle 中添加远程仓库

    repositories {
        //...
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
  2. 在Module的 build.gradle 中添加依赖项

     implementation 'com.github.jenly1314:SuperSlidingPaneLayout:1.1.0'

使用

使用布局示例:

<?xml version="1.0" encoding="utf-8"?>
<com.king.view.superslidingpanelayout.SuperSlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/superSlidingPaneLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/menu_bg1"
    app:mode="default_"
    app:compat_sliding="false">
    <include layout="@layout/menu_layout"/>
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <include layout="@layout/top_title_bar"/>
        <TextView
            android:id="@+id/tvMode"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@android:color/white"
            android:gravity="center"
            android:text="Default"
            android:textSize="24sp"/>
    </LinearLayout>

</com.king.view.superslidingpanelayout.SuperSlidingPaneLayout>

代码设置侧滑模式效果:

        superSlidingPaneLayout.setMode(SuperSlidingPaneLayout.Mode.DEFAULT);
        
        superSlidingPaneLayout.setMode(SuperSlidingPaneLayout.Mode.TRANSLATION);
        
        superSlidingPaneLayout.setMode(SuperSlidingPaneLayout.Mode.SCALE_MENU);
        
        superSlidingPaneLayout.setMode(SuperSlidingPaneLayout.Mode.SCALE_PANEL);
        
        superSlidingPaneLayout.setMode(SuperSlidingPaneLayout.Mode.SCALE_BOTH);

更多使用详情,请查看app中的源码使用示例或直接查看API帮助文档

相关博文:传送门

相关推荐

  • SuperSwipeRefreshLayout 是在SwipeRefreshLayout的基础之上扩展修改,让其支持上拉刷新,基本用法与SwipeRefreshLayout一致。

footer

About

SuperSlidingPaneLayout 是基于SlidingPaneLayout扩展修改,新增几种不同的侧滑效果。

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages