<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2019 bernd32
  ~
  ~ 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.
  -->

<ScrollView 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:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:fillViewport="false"
    android:orientation="vertical">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="24dp"
        app:layout_constraintEnd_toStartOf="@+id/artist_input"
        app:layout_constraintStart_toStartOf="@+id/artist_input"
        tools:context=".ui.LauncherActivity">

        <include
            android:id="@+id/toolbar"
            layout="@layout/toolbar_main"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button"
            style="@style/Widget.MaterialComponents.Button.OutlinedButton"
            android:layout_width="wrap_content"
            android:layout_height="48dp"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            android:layout_marginBottom="24dp"
            app:icon="@drawable/baseline_search_white_24"
            android:text="@string/search"
            android:textColor="?android:attr/textColorPrimary"
            android:onClick="onLoadLyrics"
            app:layout_constraintBottom_toTopOf="@+id/detailed_search_button"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_weight="1"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/spinner" />

        <EditText
            android:id="@+id/search_input"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            android:hint="@string/search"
            android:importantForAutofill="no"
            android:inputType="textNoSuggestions"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/toolbar" />

        <Spinner
            android:id="@+id/spinner"
            style="@style/Base.Widget.AppCompat.Spinner.Underlined"
            android:layout_width="0dp"
            android:layout_height="44dp"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            android:spinnerMode="dropdown"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_weight="4"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/search_input" />


        <com.google.android.material.button.MaterialButton
            android:id="@+id/detailed_search_button"
            style="@style/Widget.MaterialComponents.Button.OutlinedButton"
            android:layout_width="wrap_content"
            android:layout_height="48dp"
            android:layout_margin="8dp"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            android:layout_marginBottom="24dp"
            app:icon="@drawable/ic_filter_list_24dp"
            android:onClick="onDetailedSearch"
            android:text="@string/detailed_search_show"
            android:textColor="?android:attr/textColorPrimary"
            app:borderWidth="0dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/button" />

        <EditText
            android:id="@+id/artist_input"
            android:layout_width="0dp"
            android:layout_height="44dp"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            android:hint="@string/artist"
            android:importantForAutofill="no"
            android:inputType="textNoSuggestions"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_weight="3"
            app:layout_constraintStart_toEndOf="@+id/artist_spinner"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/detailed_search_button" />

        <Spinner
            android:id="@+id/artist_spinner"
            style="@style/Base.Widget.AppCompat.Spinner.Underlined"
            android:layout_width="0dp"
            android:layout_height="44dp"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            android:layout_marginBottom="24dp"
            app:layout_constraintBottom_toTopOf="@+id/song_input"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/artist_input" />

        <EditText
            android:id="@+id/song_input"
            android:layout_width="0dp"
            android:layout_height="44dp"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            android:hint="@string/song"
            android:importantForAutofill="no"
            android:inputType="textNoSuggestions"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.98"
            app:layout_constraintHorizontal_weight="3"
            app:layout_constraintStart_toEndOf="@+id/song_spinner"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/artist_spinner" />

        <Spinner
            android:id="@+id/song_spinner"
            style="@style/Base.Widget.AppCompat.Spinner.Underlined"
            android:layout_width="0dp"
            android:layout_height="44dp"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            android:layout_marginBottom="24dp"
            app:layout_constraintBottom_toTopOf="@+id/lyrics_input"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_weight="2"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/song_input" />

        <EditText
            android:id="@+id/lyrics_input"
            android:layout_width="0dp"
            android:layout_height="48dp"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            android:hint="@string/lyrics"
            android:importantForAutofill="no"
            android:inputType="textNoSuggestions"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="1.0"
            app:layout_constraintHorizontal_weight="3"
            app:layout_constraintStart_toEndOf="@+id/lyrics_spinner"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/song_spinner" />

        <Spinner
            android:id="@+id/lyrics_spinner"
            style="@style/Base.Widget.AppCompat.Spinner.Underlined"
            android:layout_width="0dp"
            android:layout_height="44dp"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_weight="2"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/lyrics_input" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button2"
            style="@style/Widget.MaterialComponents.Button.OutlinedButton"
            android:layout_width="wrap_content"
            android:layout_height="48dp"
            android:layout_marginStart="24dp"
            android:layout_marginTop="24dp"
            android:layout_marginEnd="24dp"
            android:layout_marginBottom="24dp"
            app:icon="@drawable/baseline_search_white_24"
            android:text="@string/search"
            android:textColor="?android:attr/textColorPrimary"
            android:onClick="onLoadLyrics"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_weight="1"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/lyrics_spinner" />

        <androidx.constraintlayout.widget.Group
            android:id="@+id/group"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone"
            tools:visibility="visible"
            app:constraint_referenced_ids="lyrics_input,song_spinner,song_input,artist_spinner,artist_input,lyrics_spinner,button2" />

    </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>