1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- Copyright (C) 2013 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 <!-- 18 A DrawerLayout is indended to be used as the top-level content view 19 using match_parent for both width and height to consume the full space available. 20 --> 21 <android.support.v4.widget.DrawerLayout 22 xmlns:android="http://schemas.android.com/apk/res/android" 23 android:id="@+id/drawer_layout" 24 android:layout_width="match_parent" 25 android:layout_height="match_parent"> 26 <!-- As the main content view, the view below consumes the entire 27 space available using match_parent in both dimensions. --> 28 <ScrollView 29 android:layout_width="match_parent" 30 android:layout_height="match_parent" 31 android:paddingLeft="16dp" 32 android:paddingRight="16dp" 33 android:scrollbarStyle="outsideOverlay"> 34 <TextView android:id="@+id/content_text" 35 android:layout_width="match_parent" 36 android:layout_height="match_parent" 37 android:text="@string/drawer_layout_summary" 38 android:textAppearance="?android:attr/textAppearanceMedium"/> 39 </ScrollView> 40 <!-- android:layout_gravity="left" tells DrawerLayout to treat 41 this as a sliding drawer on the left side. The drawer is 42 given a fixed width in dp and extends the full height of 43 the container. A solid background is used for contrast 44 with the content view. --> 45 <ListView android:id="@+id/left_drawer" 46 android:layout_width="300dp" 47 android:layout_height="match_parent" 48 android:layout_gravity="left" 49 android:background="#ff333333"/> 50 </android.support.v4.widget.DrawerLayout> 51 52