Erdnuss
Erdnuss

Reputation: 317

Android Material Design Navigation Drawer for Lower Api

Is it possible to make a Navigation Drawer in Material Design like the Gmail app on lower API? If it's possible have anyone a Tutorial or a guide to do this? Thanks

Upvotes: 1

Views: 1156

Answers (1)

Psypher
Psypher

Reputation: 10829

Use Appcompat library for it, here's a link how to set it up: http://android-developers.blogspot.in/2014/10/appcompat-v21-material-design-for-pre.html

You need to use the Toolbar to show the arrowToggle:

<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>

And in your mainView you need to add this:

setContentView(R.layout.guidelib_activity_main);
mToolbar = (Toolbar)findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);

Also refer this question: Appcompat Toolbar Not Showing With Navigation Drawer

Upvotes: 1

Related Questions