<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:vmsdk="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipChildren="false"
    tools:context="com.aegir.demo.MapActivity">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <FrameLayout
            android:id="@+id/fl_map_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentStart="true"
            android:layout_alignParentTop="true"
            android:layout_alignParentBottom="true">

            <fragment xmlns:android="http://schemas.android.com/apk/res/android"
                    xmlns:tools="http://schemas.android.com/tools"
                    android:id="@+id/map"
                    android:name="com.google.android.gms.maps.SupportMapFragment"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    tools:context="com.aegir.demo.MapActivity" />

            <RelativeLayout
                android:id="@+id/indoorFloorDropdown"
                android:layout_width="fill_parent"
                android:layout_height="30dp"
                android:layout_gravity="top|start"
                android:layout_marginStart="10dp"
                android:layout_marginTop="10dp"
                android:layout_marginEnd="10dp"
                android:background="@drawable/rounded_corner"
                android:padding="0dp"
                android:visibility="gone"
                >

                <TextView
                    android:id="@+id/tv_indoor_floors"
                    android:layout_width="129dp"
                    android:layout_height="match_parent"
                    android:layout_alignParentStart="true"
                    android:layout_toStartOf="@id/rl_line1"
                    android:gravity="center_vertical|center_horizontal"
                    android:text="Select Indoor Floor:"
                    android:textSize="14sp"
                    tools:ignore="RtlCompat" />

                <RelativeLayout
                    android:id="@+id/rl_line1"
                    android:layout_width="1dp"
                    android:layout_height="match_parent"
                    android:layout_alignStart="@id/indoorDropdownArrow"
                    android:background="@color/color_light_gray" />

                <ImageView
                    android:id="@+id/indoorDropdownArrow"
                    android:layout_width="50dp"
                    android:layout_height="50dp"
                    android:layout_alignParentRight="true"
                    android:scaleX=".3"
                    android:scaleY=".3"
                    android:src="@drawable/arrow_down_red" />

                <Button
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@android:color/transparent"
                    android:onClick="showIndoorFloorSelector" />
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/outdoorFloorDropdown"
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:layout_marginStart="10dp"
                android:layout_marginTop="50dp"
                android:layout_marginEnd="10dp"
                android:background="@drawable/rounded_corner"
                android:visibility="gone">

                <TextView
                    android:id="@+id/tv_outdoor_floors"
                    android:layout_width="129dp"
                    android:layout_height="match_parent"
                    android:layout_alignRight="@id/rl_line2"
                    android:layout_alignParentStart="true"
                    android:gravity="center_vertical|center_horizontal"
                    android:text="Select Outdoor Floor:"
                    android:textSize="14sp" />

                <RelativeLayout
                    android:id="@+id/rl_line2"
                    android:layout_width="1dp"
                    android:layout_height="match_parent"
                    android:layout_toStartOf="@id/outdoorDropdownArrow"
                    android:background="@color/color_light_gray" />

                <ImageView
                    android:id="@+id/outdoorDropdownArrow"
                    android:layout_width="50dp"
                    android:layout_height="50dp"
                    android:layout_alignParentEnd="true"
                    android:scaleX=".3"
                    android:scaleY=".3"
                    android:src="@drawable/arrow_down_red" />

                <Button
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@android:color/transparent"
                    android:onClick="showOutdoorFloorSelector" />
            </RelativeLayout>


        </FrameLayout>

        <FrameLayout
            android:id="@+id/fl_directions_action_container"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_alignParentStart="true"
            android:background="@color/color_lokion_gray"
            android:clipChildren="false"
            android:elevation="5dp"
            android:padding="0dp"
            android:visibility="gone">

            <!--Contains textviews to select start/end points -->
            <FrameLayout
                android:id="@+id/fl_directions_container"
                android:layout_width="fill_parent"
                android:layout_height="match_parent"
                android:clipChildren="false"
                android:padding="0dp" />

            <FrameLayout
                android:id="@+id/fl_action_bar"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:background="@color/color_lokion_dark_gray">

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

                    <Button
                        android:id="@+id/btn_back"
                        android:layout_width="50dp"
                        android:layout_height="50dp"
                        android:background="@drawable/btn_back_arrow"
                        android:onClick="goBack"
                        android:scaleX=".3"
                        android:scaleY=".3" />

                    <TextView
                        android:id="@+id/tv_header"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="10dp"
                        android:text="@string/lokion"
                        android:textColor="@color/color_white"
                        android:textSize="18sp"
                        android:textStyle="bold" />


                </LinearLayout>

            </FrameLayout>
            <!--</LinearLayout>-->

        </FrameLayout>


        <FrameLayout
            android:id="@+id/fl_show_directions"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_alignParentBottom="true"
            android:background="@color/color_white"
            android:elevation="10dp"
            android:visibility="gone">


            <ImageView
                android:id="@+id/iv_expand"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:scaleX=".4"
                android:scaleY=".4"
                android:src="@drawable/btn_expand_red" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginStart="50dp"
                android:text="@string/view_directions"
                android:textColor="@color/color_lokion_red"
                android:textSize="18sp"
                android:textStyle="bold" />

            <Button
                android:id="@+id/btn_show_directions"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center_horizontal"
                android:background="@android:color/transparent"
                android:clickable="true"
                android:enabled="true"
                android:onClick="showDirections"
                android:focusable="true" />

        </FrameLayout>


        <Button
            android:id="@+id/btn_directions_action"
            android:layout_width="60dp"
            android:layout_height="60dp"
            android:layout_alignBottom="@+id/fl_directions_action_container"
            android:layout_alignEnd="@+id/fl_directions_action_container"
            android:layout_marginBottom="-30dp"
            android:layout_marginEnd="20dp"
            android:background="@drawable/btn_directions_red"
            android:elevation="8dp"
            android:onClick="handleDirectionsAction"
            android:padding="10dp"
            android:text=""
            android:textColor="#ffffff"
            android:visibility="gone" />
    </RelativeLayout>

    <FrameLayout
        android:id="@+id/fl_text_directions_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="0dp"
        android:background="@color/color_lokion_gray"
        android:visibility="visible">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="visible">

            <FrameLayout
                android:id="@+id/fl_top_bar_text_directions"
                android:layout_width="match_parent"
                android:layout_height="50dp">

                <ImageView
                    android:id="@+id/iv_close_directions"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:scaleX=".4"
                    android:scaleY=".4"
                    android:src="@drawable/btn_collapse" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_marginStart="50dp"
                    android:text="@string/directions"
                    android:textColor="@color/color_white"
                    android:textSize="18sp"
                    android:textStyle="bold" />

                <Button
                    android:id="@+id/btn_close_directions"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="center_horizontal"
                    android:background="@android:color/transparent"
                    android:clickable="true"
                    android:enabled="true"
                    android:onClick="hideDirections"
                    android:focusable="true" />
            </FrameLayout>

            <fragment
                android:id="@+id/frag_text_directions"
                android:name="com.aegir.demo.fragments.TextDirectionsFragment"
                android:layout_width="match_parent"
                android:layout_height="fill_parent"
                android:layout_below="@+id/fl_top_bar_text_directions" />
        </RelativeLayout>

    </FrameLayout>

    <FrameLayout
        android:id="@+id/fl_floor_selector_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/color_lokion_gray"
        android:visibility="visible">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="visible">

            <FrameLayout
                android:id="@+id/fl_top_bar_floor_selector"
                android:layout_width="match_parent"
                android:layout_height="50dp">

                <ImageView
                    android:id="@+id/if_close_floor_selector"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:scaleX=".6"
                    android:scaleY=".6"
                    android:src="@drawable/btn_back_arrow" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_marginStart="50dp"
                    android:text="@string/select_floor"
                    android:textColor="@color/color_white"
                    android:textSize="18sp"
                    android:textStyle="bold" />

                <Button
                    android:id="@+id/btn_close_floor_selector"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="center_horizontal"
                    android:background="@android:color/transparent"
                    android:clickable="true"
                    android:enabled="true"
                    android:onClick="hideFloorSelector"
                    android:focusable="true" />
            </FrameLayout>

            <fragment
                android:id="@+id/frag_floor_selector"
                android:name="com.aegir.demo.fragments.FloorSelectorFragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_below="@+id/fl_top_bar_floor_selector"
                android:layout_gravity="center_vertical|end" />

            <androidx.fragment.app.FragmentContainerView
                android:id="@+id/frag_floor_units"
                android:name="com.aegir.demo.fragments.FloorMapUnitsInfoFragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_below="@+id/fl_top_bar_floor_selector"
                android:layout_gravity="center_vertical|end"
                android:visibility="gone"/>
        </RelativeLayout>
    </FrameLayout>

    <androidx.compose.ui.platform.ComposeView
        android:id="@+id/compose_overlay"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</RelativeLayout>
