Easy to use Custom DrawerLayout, that slides and resizes the whole screen content when navigation view is pulled out.
Following are the steps to use this library
-
Add this "maven{url 'https://jitpack.io'}" to the repositories section of allprojects section in project level build.gradle.
-
Add dependency "com.github.saxenautkarsh:SlidingContentNavView-android:0.1.0" to dependencies in app level build.gradle
(Or just follow the instructions given here for step 1 and step 2) -
Now instead of using DrawerLayout use ContentSlidingDrawerLayout in the xml.
-
After inflating this layout in onCreate method, call method contentSlidingDrawerLayout.init(activity,navigationView,actionBar). If action bar is not used then you can use method contentSlidingDrawerLayout.init(activity,navigationView) .
-
Add onOptionsItemSelected listner for opening Navigation View by clicking on Hamburger icon.
-
That's all you are done.