Newer
Older
mountainnavigation / app / src / main / res / layout / activity_main.xml
<!-- 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. -->
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <!-- As the main content view, the view below consumes the entire
         space available using match_parent in both dimensions. -->
    <RelativeLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
        <android.support.design.widget.FloatingActionButton
            android:id="@+id/fab"
            android:src="@drawable/ic_plus"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:clickable="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="@dimen/fab_button_margin_bottom"
            android:layout_marginRight="@dimen/fab_button_margin_right"
            app:fabSize="normal"
            app:elevation="@dimen/fab_elevation"
            app:pressedTranslationZ="@dimen/fab_translation_z_pressed"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/osm_contrib"
            android:textSize="10dp"
            android:autoLink="all"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="2dp"
            android:layout_marginLeft="6dp"
            android:elevation="6dp"/>
    </RelativeLayout>

    <!-- The drawer is given a fixed width in dp and extends the full height of
         the container. -->
    <ScrollView
        android:layout_width="@dimen/navigation_drawer_width"
        android:layout_height="match_parent"
        android:background="#eee"
        android:layout_gravity="start"
        app:elevation="16dp"
        android:fillViewport="true"
        >
        <LinearLayout
            android:id="@+id/navigation_drawer"
            android:orientation="vertical"
            android:layout_height="match_parent"
            android:layout_width="match_parent">
                <ListView
                    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
                    android:name="de.apps4ics.mountainnavigation.NavigationDrawerFragment"
                    android:layout_height="wrap_content" android:choiceMode="singleChoice"
                    android:divider="@android:color/transparent" android:dividerHeight="0dp"
                    android:background="#cccc" tools:context=".NavigationDrawerFragment"
                    android:id="@+id/poiList"/>
                <ListView android:layout_width="match_parent"
                    android:layout_height="wrap_content" android:choiceMode="singleChoice"
                    android:divider="@android:color/transparent" android:dividerHeight="0dp"
                    android:background="#cccc" tools:context=".NavigationDrawerFragment"
                    android:id="@+id/menuList" />
        </LinearLayout>
    </ScrollView>
</android.support.v4.widget.DrawerLayout>