<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Nextcloud Talk - Android Client
  ~
  ~ SPDX-FileCopyrightText: 2021 Andy Scherzinger <info@andy-scherzinger.de>
  ~ SPDX-FileCopyrightText: 2021 Marcel Hibbe <dev@mhibbe.de>
  ~ SPDX-License-Identifier: GPL-3.0-or-later
-->
<LinearLayout 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/parent_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/location_picker_appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <com.google.android.material.appbar.MaterialToolbar
            android:id="@+id/location_picker_toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@color/appbar"
            android:theme="?attr/actionBarPopupTheme"
            app:layout_scrollFlags="scroll|enterAlways"
            app:navigationIconTint="@color/fontAppbar"
            app:popupTheme="@style/appActionBarPopupMenu"
            app:titleTextColor="@color/fontAppbar"
            tools:title="@string/nc_app_product_name" />
    </com.google.android.material.appbar.AppBarLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <org.osmdroid.views.MapView
            android:id="@+id/map"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/centerMapButton"
            style="@style/Widget.AppTheme.Button.IconButton"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_alignParentTop="true"
            android:layout_alignParentEnd="true"
            android:layout_margin="8dp"
            android:insetLeft="0dp"
            android:insetTop="0dp"
            android:insetRight="0dp"
            android:insetBottom="0dp"
            android:padding="0dp"
            app:backgroundTint="@color/bg_default_semitransparent"
            app:cornerRadius="@dimen/button_corner_radius"
            app:elevation="0dp"
            app:icon="@drawable/ic_baseline_gps_fixed_24"
            app:iconGravity="textStart"
            app:iconPadding="0dp"
            app:iconSize="24dp"
            app:iconTint="@color/high_emphasis_text" />

        <View
            android:id="@+id/locationpicker_anchor"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_centerInParent="true" />

        <ImageView
            android:layout_width="30dp"
            android:layout_height="50dp"
            android:layout_above="@id/locationpicker_anchor"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="-10dp"
            android:contentDescription="@string/nc_location_current_position_description"
            android:src="@drawable/ic_baseline_location_on_red_24" />
    </RelativeLayout>

    <LinearLayout
        android:id="@+id/share_location"
        android:layout_width="match_parent"
        android:layout_height="72dp"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/roundedImageView"
            android:layout_width="@dimen/avatar_size"
            android:layout_height="@dimen/avatar_size"
            android:layout_gravity="top"
            android:layout_margin="@dimen/standard_margin"
            android:contentDescription="@null"
            android:src="@drawable/ic_circular_location" />

        <ProgressBar
            android:id="@+id/sending_location_progressbar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:visibility="gone">
        </ProgressBar>

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

            <TextView
                android:id="@+id/share_location_description"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:textAlignment="viewStart"
                android:textColor="@color/high_emphasis_text"
                android:textSize="16sp"
                tools:text="Share this location" />

            <TextView
                android:id="@+id/place_name"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:ellipsize="end"
                android:maxLines="1"
                android:textAlignment="viewStart"
                android:textColor="@color/medium_emphasis_text"
                android:textSize="14sp"
                tools:text="Brandenburg, Germany" />
        </LinearLayout>

    </LinearLayout>

</LinearLayout>
