1<!-- 2 Copyright 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 intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. --> 19<android.support.v4.widget.DrawerLayout 20 xmlns:android="http://schemas.android.com/apk/res/android" 21 android:id="@+id/drawer_layout" 22 android:layout_width="match_parent" 23 android:layout_height="match_parent"> 24 25 <!-- As the main content view, the view below consumes the entire 26 space available using match_parent in both dimensions. --> 27 <FrameLayout 28 android:id="@+id/content_frame" 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 left side for left-to-right 34 languages and on the right side for right-to-left languages. 35 The drawer is given a fixed width in dp and extends the full height of 36 the container. A solid background is used for contrast 37 with the content view. --> 38 <ListView 39 android:id="@+id/left_drawer" 40 android:layout_width="240dp" 41 android:layout_height="match_parent" 42 android:layout_gravity="start" 43 android:choiceMode="singleChoice" 44 android:divider="@android:color/transparent" 45 android:dividerHeight="0dp" 46 android:background="#111"/> 47</android.support.v4.widget.DrawerLayout> 48