1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- Copyright (C) 2016 The Android Open Source Project 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 --> 16 17 <android.support.v4.widget.DrawerLayout 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 xmlns:app="http://schemas.android.com/apk/res-auto" 20 android:id="@+id/drawer_layout" 21 android:layout_width="match_parent" 22 android:layout_height="match_parent" 23 android:fitsSystemWindows="true"> 24 <!-- As the main content view, the view below consumes the entire 25 space available using match_parent in both dimensions. Note that 26 this child does not specify android:layout_gravity attribute. --> 27 <FrameLayout 28 android:id="@+id/content" 29 android:layout_width="match_parent" 30 android:layout_height="match_parent" /> 31 32 <!-- android:layout_gravity="start" tells DrawerLayout to treat 33 this as a sliding drawer on the starting side, which is 34 left for left-to-right locales. The navigation view extends 35 the full height of the container. A 36 solid background is used for contrast with the content view. 37 android:fitsSystemWindows="true" tells the system to have 38 DrawerLayout span the full height of the screen, including the 39 system status bar on Lollipop+ versions of the plaform. --> 40 <android.support.design.widget.NavigationView 41 android:id="@+id/start_drawer" 42 android:layout_width="wrap_content" 43 android:layout_height="match_parent" 44 android:layout_gravity="start" 45 android:background="#333" 46 android:fitsSystemWindows="true" 47 app:menu="@menu/navigation_view_content" 48 app:itemIconTint="@color/emerald_translucent" 49 app:itemTextColor="@color/emerald_text" 50 app:itemBackground="@color/sand_default" 51 app:itemTextAppearance="@style/TextMediumStyle" /> 52 53 </android.support.v4.widget.DrawerLayout> 54 55