<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/root">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="250dp"
            android:fitsSystemWindows="true">

            <com.google.android.material.appbar.CollapsingToolbarLayout
                android:id="@+id/collapsing_toolbar"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fitsSystemWindows="true"
                app:contentScrim="@color/defaultBrand"
                app:layout_scrollFlags="scroll|snap|exitUntilCollapsed"
                app:title="@string/new_geobookmark"
                app:expandedTitleTextAppearance="@style/TextAppearance.GeofavoriteDetail.Header.Expanded"
                app:collapsedTitleTextAppearance="@style/TextAppearance.GeofavoriteDetail.Header.Collapsed">

                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    app:layout_collapseMode="parallax">
                    <org.osmdroid.views.MapView
                        android:id="@+id/map"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:focusable="false"
                        android:clickable="false"/>
                    <View
                        android:id="@+id/map_bt"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"/>
                </FrameLayout>

                <androidx.appcompat.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    app:contentInsetStart="0dp"
                    app:layout_collapseMode="pin"
                    android:background="@android:color/transparent">

                    <!-- Back button -->
                    <ImageView
                        android:id="@+id/back_bt"
                        android:layout_width="?attr/actionBarSize"
                        android:layout_height="?attr/actionBarSize"
                        android:layout_gravity="start"
                        android:padding="16dp"
                        android:src="@drawable/ic_back_grey"
                        app:tint="@color/white"
                        android:background="@drawable/floating_semitransparent_button_background"/>

                    <!-- Manual position button -->
                    <ImageView
                        android:id="@+id/manual_pos_bt"
                        android:layout_width="?attr/actionBarSize"
                        android:layout_height="?attr/actionBarSize"
                        android:layout_gravity="end"
                        android:padding="16dp"
                        android:src="@drawable/ic_manual_pos"
                        app:tint="@color/white"
                        android:background="@drawable/floating_semitransparent_button_background"/>

                </androidx.appcompat.widget.Toolbar>
                    


            </com.google.android.material.appbar.CollapsingToolbarLayout>

        </com.google.android.material.appbar.AppBarLayout>

        <androidx.core.widget.NestedScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:padding="20dp">

                <TextView
                    android:id="@+id/accuracy_tv"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:textAlignment="center"
                    android:text="@string/accuracy"
                    android:textColor="@android:color/white"
                    android:background="@android:color/darker_gray"/>

                <LinearLayout
                    android:id="@+id/action_icons"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <ImageView
                        android:id="@+id/action_icon_share"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:padding="10dp"
                        android:src="@drawable/ic_share"
                        android:tint="@color/defaultBrand"/>

                    <ImageView
                        android:id="@+id/action_icon_nav"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:padding="10dp"
                        android:src="@drawable/ic_nav"
                        android:tint="@color/defaultBrand"/>

                    <ImageView
                        android:id="@+id/action_icon_delete"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:padding="10dp"
                        android:src="@drawable/ic_delete_grey"
                        android:tint="@color/defaultBrand"
                        android:visibility="gone"/> <!-- TODO Implement delete -->


                </LinearLayout>

                <EditText
                    android:id="@+id/name_et"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="40dp"
                    android:ems="10"
                    android:hint="@string/name"
                    android:lines="1"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textColor="@color/defaultBrand"
                    android:textAppearance="@style/TextAppearance.AppCompat.Title"
                    android:background="@android:color/transparent"
                    android:drawableLeft="@drawable/ic_edit"
                    android:drawablePadding="5dp"
                    android:drawableTint="@color/defaultBrand"/>

                <EditText
                    android:id="@+id/description_et"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:ems="10"
                    android:gravity="start|top"
                    android:inputType="textMultiLine"
                    android:maxLines="10"
                    android:background="@android:color/transparent"
                    android:drawableLeft="@drawable/ic_edit"
                    android:drawablePadding="5dp"
                    android:drawableTint="@color/defaultBrand"
                    android:hint="@string/description"/>

                <AutoCompleteTextView
                    android:id="@+id/category_at"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:ems="10"
                    android:gravity="start|top"
                    android:inputType="textMultiLine"
                    android:maxLines="10"
                    android:background="@android:color/transparent"
                    android:drawableLeft="@drawable/ic_category_asc"
                    android:drawablePadding="5dp"
                    android:drawableTint="@color/defaultBrand"
                    android:hint="@string/category"/>

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="40dp"
                    android:textStyle="bold"
                    android:text="@string/created" />

                <TextView
                    android:id="@+id/created_tv"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textAlignment="textEnd" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:textStyle="bold"
                    android:text="@string/modified" />

                <TextView
                    android:id="@+id/modified_tv"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textAlignment="textEnd" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:text="@string/coords"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/coords_tv"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textAlignment="textEnd" />

                <ProgressBar
                    android:id="@+id/progress"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:indeterminate="true"
                    android:visibility="gone"/>

                <Button
                    android:id="@+id/submit_bt"
                    style="@style/Widget.AppCompat.Button.Colored"
                    android:layout_width="match_parent"
                    android:layout_height="60dp"
                    android:layout_margin="50dp"
                    android:text="@string/confirm"
                    app:backgroundTint="@color/defaultBrand"
                    android:onClick="onSubmit"/>

            </LinearLayout>

        </androidx.core.widget.NestedScrollView>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>