An easy way to create an alternative navigation drawer for android

Duo Navigation Drawer

This Android library provides an easy way to create an alternative navigation drawer for android. Instead of a drawer that slides over the main content of the Activity, this lets the content slide away and reveal a menu below it.

By default it applies a scaling effect on the content and menu.

The demo app is included in the app module in this project.

Getting Started

Prerequisites

You can download a jar from GitHub.

Or use Gradle:

repositories {
mavenCentral() // jcenter() works as well because it pulls from Maven Central
}
dependencies {
compile 'nl.psdcompany:duo-navigation-drawer:2.0.7'
}

4. Initialize the drawer view

The API of the DuoNavigationDrawer is mostly the same as the original DrawerLayout from the Android design library. Same for DuoDrawerToggle which is a modified version of the ActionBarDrawerToggle to support the DuoDrawerLayout.

Customization

Using the DuoMenuView

If you want your menu to look like the demo. you should consider using the DuoMenuView For more info using the DuoMenuView click [here][3].

Effects

All values are Float values. The default values are used in the example.

Content scaling effect

The scaling applied on the content when sliding it from left to right.

app:contentScaleClosed="1.0"
app:contentScaleOpen="0.7"

Menu scaling effect

The scaling applied on the menu when sliding the content from left to right.

app:menuScaleClosed="1.1"
app:menuScaleOpen="1.0"

Click to close surface scaling effect

The scaling applied on the click to close surface when the drawer is open.

app:clickToCloseScale="0.7"

Menu alpha effect

The alpha on the menu when sliding the content from left to right.

app:menuAlphaClosed="0.0"
app:menuAlphaOpen="1.0"

Content margin factor

This value is used to calculate how much of the content should be visible when the content is slided to the right. This is calculated with the width of the DuoDrawerLayout when: getWidth * marginFactor. So setting this to 1.0f will slide the content out of the activity. The default is 0.7f.