Skip to content

Latest commit

 

History

History
64 lines (53 loc) · 1.88 KB

README.md

File metadata and controls

64 lines (53 loc) · 1.88 KB

Perspective Drawer

Checkout the video on youtube

How to use

Gradle:

dependencies {
    compile('ua.pl.mik:perspectivedrawer:0.3.2@aar') {
        transitive = true
    }
}

Layout:

<ua.pl.mik.perspectivedrawer.PerspectiveDrawer
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Menu -->
    <ua.pl.mik.perspectivedrawer.PageHolder
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <!-- Your views here -->
    </ua.pl.mik.perspectivedrawer.PageHolder>

    <!-- Main page -->
    <ua.pl.mik.perspectivedrawer.PageHolder
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/perspective_drawer_shadow">
        <!-- Your views here -->
    </ua.pl.mik.perspectivedrawer.PageHolder>

</ua.pl.mik.perspectivedrawer.PerspectiveDrawer>

Control:

// Get reference to Perspective Drawer from the layout
PerspectiveDrawer perspectiveDrawer = (PerspectiveDrawer) findViewById(R.id.drawer);

// To open on an event , call
perspectiveDrawer.open();

// To close on an event , call
perspectiveDrawer.close();

Google's DrawerLayout compatibility

As for v0.3 compatibility was taken into consideration

  • ua.pl.mik.perspectivedrawer.DrawerLayout class was added which provides same methods as Google's one.
  • ActionBarDrawerToggle was implemented so you can use it with default actionbar.

Migrating between this two drawers is easy and takes up to 20 min!