Navigation Drawer Activity with material design style and simplified methods
It requires 11+ API and android support v7 (Toolbar)
In your Activity...
public class MyActivity extends MaterialNavigationDrawer {
@Override
public void init(Bundle savedInstanceState) {
// set cover background
this.setDrawerBackground(this.getResources().getDrawable(R.drawable.mat1));
// set user photo and data
this.setUserPhoto(this.getResources().getDrawable(R.drawable.photo));
this.setUsername("NeoKree");
this.setUserEmail("[email protected]");
// add your sections
this.addSection(this.newSection("Section 1",new FragmentIndex()));
this.addSection(this.newSection("Section 2",new FragmentIndex()));
this.addDivisor();
this.addSection(this.newSection("Section 2",this.getResources().getDrawable(R.drawable.section2),new FragmentIndex()));
this.addBottomSection(this.newBottomSection("Settings",this.getResources().getDrawable(R.drawable.settings),new FragmentSettings()));
}
}
In your styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/light_blue_500</item>
<item name="colorPrimaryDark">@color/light_blue_800</item>
<item name="colorAccent">@color/grey_1000</item>
<item name="windowActionBar">false</item>
</style>
</resources>
N.B. Not override OnCreate
method! Use init
method instead.
dependencies { compile 'it.neokree:MaterialNavigationDrawer:1.1.3' }
You don't know how to do something? Visit the [wiki](https://github.com/neokree/MaterialNavigationDrawer/wiki)!
<img src="https://raw.github.com/neokree/MaterialNavigationDrawer/master/screen1.png" alt="screenshot" width="300px" height="auto" />
<img src="https://raw.github.com/neokree/MaterialNavigationDrawer/master/screen2.png" alt="screenshot" width="300px" height="auto" />
<img src="https://raw.github.com/neokree/MaterialNavigationDrawer/master/screen3.png" alt="screenshot" width="300px" height="auto" />
<img src="https://raw.github.com/neokree/MaterialNavigationDrawer/master/screen4.png" alt="screenshot" width="300px" height="auto" />