Skip to content

Instantly share code, notes, and snippets.

@AKiniyalocts
Last active August 29, 2015 14:08
Show Gist options
  • Save AKiniyalocts/ce82ea5e9a843058000b to your computer and use it in GitHub Desktop.
Save AKiniyalocts/ce82ea5e9a843058000b to your computer and use it in GitHub Desktop.
Incorporating the new appcompat-v7 ToolBar with the Navigation Drawer
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/background_material_dark"
android:layout_marginTop="@dimen/status_bar_padding"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<android.support.v7.widget.Toolbar
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="top"
android:background="?attr/colorPrimary"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/main_toolbar"
android:id="@+id/fragment_container"
/>
</RelativeLayout>
<FrameLayout
android:layout_width="300dp"
android:layout_height="match_parent"
android:id="@+id/drawer_container"
android:layout_gravity="start"
android:background="@color/dark_primary"
/>
</android.support.v4.widget.DrawerLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment