<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Nextcloud Maps Geofavorites for Android
  ~
  ~ This program 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.
  ~
  ~ This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<androidx.drawerlayout.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:openDrawer="start"
    tools:context=".activity.main.MainActivity">

    <include layout="@layout/activity_list_view"
        android:id="@+id/activity_list_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <!-- TODO: Is use another layout for that is fill screen. -->
    <com.google.android.material.navigation.NavigationView
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true">

        <androidx.core.widget.NestedScrollView
            android:id="@+id/scrollView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="?attr/colorPrimary">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <RelativeLayout
                    android:id="@+id/header_view"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/drawer_header_height"
                    android:background="@color/defaultBrand">

                    <androidx.appcompat.widget.AppCompatImageView
                        android:id="@+id/logo"
                        android:layout_width="@dimen/drawer_header_logo_size"
                        android:layout_height="@dimen/drawer_header_logo_size"
                        android:layout_centerVertical="true"
                        android:layout_margin="@dimen/spacer_2x"
                        android:gravity="center"
                        android:src="@drawable/ic_app" />

                    <TextView
                        android:id="@+id/app_name"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:layout_toEndOf="@id/logo"
                        android:ellipsize="end"
                        android:fontFamily="sans-serif-light"
                        android:gravity="center_vertical"
                        android:text="@string/app_name"
                        android:textColor="@android:color/white"
                        android:textSize="24sp"
                        android:layout_toRightOf="@id/logo" />
                </RelativeLayout>

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/navigationCommon"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingTop="@dimen/spacer_1x"
                    android:paddingBottom="@dimen/spacer_1x"
                    app:layoutManager="LinearLayoutManager"
                    tools:itemCount="3"
                    tools:listitem="@layout/item_navigation" />
            </LinearLayout>
        </androidx.core.widget.NestedScrollView>
    </com.google.android.material.navigation.NavigationView>

</androidx.drawerlayout.widget.DrawerLayout>