| 1 |
<!-- 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. --> |
| 2 |
<android.support.v4.widget.DrawerLayout |
| 3 |
xmlns:android="http://schemas.android.com/apk/res/android" |
| 4 |
xmlns:tools="http://schemas.android.com/tools" |
| 5 |
android:id="@+id/drawer_layout" |
| 6 |
android:layout_width="match_parent" |
| 7 |
android:layout_height="match_parent" |
| 8 |
tools:context="${relativePackage}.${activityClass}"> |
| 9 |
|
| 10 |
<!-- As the main content view, the view below consumes the entire |
| 11 |
space available using match_parent in both dimensions. --> |
| 12 |
<FrameLayout |
| 13 |
android:id="@+id/container" |
| 14 |
android:layout_width="match_parent" |
| 15 |
android:layout_height="match_parent" /> |
| 16 |
|
| 17 |
<!-- android:layout_gravity="start" tells DrawerLayout to treat |
| 18 |
this as a sliding drawer on the left side for left-to-right |
| 19 |
languages and on the right side for right-to-left languages. |
| 20 |
If you're not building against API 17 or higher, use |
| 21 |
android:layout_gravity="left" instead. --> |
| 22 |
<!-- The drawer is given a fixed width in dp and extends the full height of |
| 23 |
the container. --> |
| 24 |
<fragment android:id="@+id/navigation_drawer" |
| 25 |
android:layout_width="@dimen/navigation_drawer_width" |
| 26 |
android:layout_height="match_parent" |
| 27 |
android:layout_gravity="<#if buildApi gte 17>start<#else>left</#if>" |
| 28 |
android:name="${packageName}.NavigationDrawerFragment" |
| 29 |
tools:layout="@layout/${navigationDrawerLayout}" /> |
| 30 |
|
| 31 |
</android.support.v4.widget.DrawerLayout> |