<?xml version="1.0" encoding="utf-8"?>
<!--
 Copyright 2025 Google LLC

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/map_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.google.android.material.appbar.MaterialToolbar
        android:id="@+id/top_bar"
        style="@style/Widget.MaterialComponents.Toolbar.Primary"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:title="@string/polyline_demo_label" />

    <ScrollView
        android:id="@+id/scrollView"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@id/top_bar"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toTopOf="@id/map">

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


            <TableLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:stretchColumns="1">

                <TableRow>
                    <TextView android:text="@string/hue" />
                    <SeekBar android:id="@+id/hueSeekBar" />
                </TableRow>

                <TableRow>
                    <TextView android:text="@string/alpha" />
                    <SeekBar android:id="@+id/alphaSeekBar" />
                </TableRow>

                <TableRow>
                    <TextView android:text="@string/width" />
                    <SeekBar android:id="@+id/widthSeekBar" />
                </TableRow>
            </TableLayout>

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

                <TextView
                    android:text="@string/start_cap"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />
                <Spinner
                    android:id="@+id/startCapSpinner"
                    android:spinnerMode="dropdown"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>

                <TextView
                    android:text="@string/end_cap"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
                <Spinner
                    android:id="@+id/endCapSpinner"
                    android:spinnerMode="dropdown"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
            </LinearLayout>

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

                <TextView
                    android:text="@string/joint_type"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
                <Spinner
                    android:id="@+id/jointTypeSpinner"
                    android:spinnerMode="dropdown"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>

                <TextView
                    android:text="@string/pattern"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
                <Spinner
                    android:id="@+id/patternSpinner"
                    android:spinnerMode="dropdown"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
            </LinearLayout>

            <CheckBox
                android:id="@+id/toggleClickability"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:checked="true"
                android:onClick="toggleClickability"
                android:text="@string/clickable" />
        </LinearLayout>
    </ScrollView>

    <androidx.fragment.app.FragmentContainerView
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintTop_toBottomOf="@id/scrollView"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toBottomOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
