Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shiburagi/drawer-behavior

Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.
https://github.com/shiburagi/drawer-behavior

android android-application android-development android-library android-ui card drawer drawer-android drawer-layout drawer-navigation drawerlayout drawernavigator gradle navigation-drawer scale slide ui ui-components

Last synced: about 4 hours ago
JSON representation

Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.

Awesome Lists containing this project

README

        

# Drawer-Behavior
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Drawer--Behavior-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/6239)
![fdsfd](https://github.com/shiburagi/Drawer-Behavior/workflows/CI/badge.svg)

Drawer behavior is a library use **[Android DrawerLayout Support library](https://developer.android.com/training/implementing-navigation/nav-drawer)** 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
* Change **Card barkground** color ([Jazcorra-Zero](https://github.com/jazcorra-zero))
* **Support for get color from MaterialShapeDrawable** ([CamiloDelReal](https://github.com/CamiloDelReal))
* 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

![Alt Text](https://raw.githubusercontent.com/shiburagi/Drawer-Behavior/preview/gif/preview1.gif)

**Android 9.0+ support**

---

### For **Flutter** : [Drawer-Behavior-Flutter](https://github.com/shiburagi/Drawer-Behavior-Flutter)

---

Buy Me a Coffee at ko-fi.com
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=D9JKYQL8452AL)

## Including In Your Project

If you are a Maven user you can easily include the library by specifying it as
a dependency:

#### Maven
#### Gradle

```groovy
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/shiburagi/Drawer-Behavior") // Github Package
credentials {
username = "shiburagi"
password = "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"
}
}
```
```groovy
dependencies {
implementation 'com.shiburagi.drawerbehavior:drawerbehavior:1.0.13'
}
```

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

## How to use
**Creating the layout**

### Advance Drawer Layout
---
```xml



```

**Initialize**
```java
drawer = (AdvanceDrawerLayout) findViewById(R.id.drawer_layout);
```

**Use custom behavior**
```java
drawer.useCustomBehavior(GravityCompat.START); //assign custom behavior for "Left" drawer
drawer.useCustomBehavior(GravityCompat.END); //assign custom behavior for "Right" drawer
```
---

#### Card Effect

![Alt Text](https://raw.githubusercontent.com/shiburagi/Drawer-Behavior/preview/gif/preview-card-1.gif)

```java
drawer.setRadius(GravityCompat.START, 25);//set end container's corner radius (dimension)
```

---

### Advance 3D Drawer Layout
---
![Alt Text](https://raw.githubusercontent.com/shiburagi/Drawer-Behavior/preview/gif/preview-3d-2.gif)

```xml



```

**Initialize**
```java
drawer = (Advance3DDrawerLayout) findViewById(R.id.drawer_layout);
```

**Use custom behavior**
```java
drawer.setViewRotation(GravityCompat.START, 15); // set degree of Y-rotation ( value : 0 -> 45)
```
---

**Customize**
```java
drawer.setViewScale(GravityCompat.START, 0.9f); //set height scale for main view (0f to 1f)
drawer.setViewElevation(GravityCompat.START, 20); //set main view elevation when drawer open (dimension)
drawer.setViewScrimColor(GravityCompat.START, Color.TRANSPARENT); //set drawer overlay coloe (color)
drawer.setDrawerElevation(GravityCompat.START, 20); //set drawer elevation (dimension)
drawer.setContrastThreshold(3); //set maximum of contrast ratio between white text and background color.
drawer.setRadius(GravityCompat.START, 25); //set end container's corner radius (dimension)
```

## Contact
For any enquiries, please send an email to [email protected].