Drawer-Behavior

Additional

Language
Java
Version
N/A
Created
Sep 22, 2017
Updated
Jul 3, 2019
Owner
Muhammad Norzariman Razari (shiburagi)
Contributors
searchy2
Muhammad Norzariman Razari (shiburagi)
2
Activity
Badge
Generate
Download
Source code
APK file

Promotion

Drawer-Behavior

Drawer behavior is a library use Android DrawerLayout Support library as Parent Class [Easy to migrate], that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.

If current project use Android DrawerLayout Support library and kinda boring with the effect. Then, just change the layout code and calling necessary method for animation/effect.

New update

  • Fix preview issue
  • Migrate to AndroidX
  • Transparent status bar for scale effect
  • Support RTL

Features

  • New drawer class with 3D effect
  • Card Effect
  • Zoom in & Zoom out effect
  • X-Translation effect

Android 9.0+ support


Gradle

dependencies {
   implementation 'com.infideap.drawerbehavior:drawer-behavior:0.2.2'
}

if the gradle unable to sync, you may include this line in project level gradle,

repositories {
 maven{
   url "https://dl.bintray.com/infideap2/Drawer-Behavior"
 }
}

or, you can include it by download this project and import /drawerbehavior as module.

How to use

Creating the layout

Advance Drawer Layout

<com.infideap.drawerbehavior.AdvanceDrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:id="@+id/drawer_layout"android:layout_width="match_parent"android:layout_height="match_parent"android:fitsSystemWindows="true"android:background="@color/colorWhite"tools:openDrawer="start"> <includelayout="@layout/app_bar_default"android:layout_width="match_parent"android:layout_height="match_parent" /> <android.support.design.widget.NavigationView android:id="@+id/nav_view"android:layout_width="wrap_content"android:layout_height="match_parent"android:layout_gravity="start"android:fitsSystemWindows="true"android:background="@color/colorWhite"app:headerLayout="@layout/nav_header_main"app:menu="@menu/activity_main_drawer" /> <android.support.design.widget.NavigationView android:id="@+id/nav_view_notification"android:background="@color/colorPrimary"android:layout_width="wrap_content"android:layout_height="match_parent"android:layout_gravity="end"android:fitsSystemWindows="false"> <includelayout="@layout/content_notification"/> </android.support.design.widget.NavigationView> </com.infideap.drawerbehavior.AdvanceDrawerLayout>

Initializedrawer = (AdvanceDrawerLayout) findViewById(R.id.drawer_layout);

Use custom behaviordrawer.useCustomBehavior(Gravity.START); //assign custom behavior for "Left" drawer drawer.useCustomBehavior(Gravity.END); //assign custom behavior for "Right" drawer