Newer
Older
mountainnavigation / app / src / main / res / layout / activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<!--
	* This file is part of MountainNavigation.
	*
	* MountainNavigation is free software: you can redistribute it and/or modify
	* it under the terms of the GNU General Public License as published by
	* the Free Software Foundation, either version 3 of the License, or
	* (at your option) any later version.
	*
	* MountainNavigation is distributed in the hope that it will be useful,
	* but WITHOUT ANY WARRANTY; without even the implied warranty of
	* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	* GNU General Public License for more details.
	*
	* You should have received a copy of the GNU General Public License
	* along with MountainNavigation. If not, see <http://www.gnu.org/licenses/>.
	*
	* Copyright (c) 2016 Vinzenz Rosenkanz <vinzenz.rosenkranz@gmail.com>
	*
	* Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
-->
<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"
            android:layout_marginEnd="@dimen/fab_button_margin_right"
            app:fabSize="normal"
            app:elevation="8dp"
            app:pressedTranslationZ="6dp"
            tools:ignore="RelativeOverlap" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/osm_contrib"
            android:textSize="12sp"
            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="wrap_content"
            android:layout_width="match_parent"
            android:background="#ffff">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_margin="12dp">
                <ImageView
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_marginTop="21dp"
                    android:id="@+id/weather_symbol"/>
                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="72dp"
                    android:orientation="vertical"
                    android:layout_marginLeft="12dp"
                    android:layout_marginStart="12dp">
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:id="@+id/weather_city"
                        android:gravity="center_vertical"
                        android:textSize="16sp"
                        android:textColor="@color/text_color"
                        android:fontFamily="sans-serif-medium"
                        android:text="@string/no_weather_data_available"/>
                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="6dp"
                        android:layout_marginStart="6dp"
                        android:id="@+id/weather_desc"
                        android:textSize="12sp"
                        android:textColor="@color/text_color"
                        android:fontFamily="sans-serif-medium" />
                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="6dp"
                        android:layout_marginStart="6dp"
                        android:id="@+id/weather_min_temp"
                        android:textSize="12sp"
                        android:textColor="@color/text_color"
                        android:fontFamily="sans-serif-medium"
                        android:textStyle="italic"/>
                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="6dp"
                        android:layout_marginStart="6dp"
                        android:id="@+id/weather_max_temp"
                        android:textSize="12sp"
                        android:textColor="@color/text_color"
                        android:fontFamily="sans-serif-medium"
                        android:textStyle="italic"/>
                </LinearLayout>
            </LinearLayout>
            <LinearLayout
                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="#ffff" tools:context=".NavigationDrawerFragment"
                android:id="@+id/poiList"
                android:orientation="vertical" />
            <View
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="@android:drawable/divider_horizontal_bright"
                android:paddingBottom="2dp"
                android:paddingTop="2dp" />
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content" android:choiceMode="singleChoice"
                android:divider="@android:color/transparent" android:dividerHeight="0dp"
                android:background="#ffff" tools:context=".NavigationDrawerFragment"
                android:id="@+id/hikeList"
                android:orientation="vertical" />
            <View
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="@android:drawable/divider_horizontal_bright"
                android:paddingBottom="2dp"
                android:paddingTop="2dp" />
            <LinearLayout android:layout_width="match_parent"
                android:layout_height="wrap_content" android:choiceMode="singleChoice"
                android:divider="@android:color/transparent" android:dividerHeight="0dp"
                android:background="#ffff" tools:context=".NavigationDrawerFragment"
                android:id="@+id/menuList"
                android:orientation="vertical" />
        </LinearLayout>
    </ScrollView>
</android.support.v4.widget.DrawerLayout>