<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<ScrollView android:id="@+id/search_engine_scrollview"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="org.mozilla.fenix.settings.search.AddSearchEngineFragment"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <LinearLayout
        android:id="@+id/search_engine_wrapper"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingStart="12dp"
        android:paddingEnd="12dp"
        android:paddingTop="16dp"
        android:paddingBottom="16dp"
        android:contentDescription="@string/search_add_custom_engine_form_description"
        android:importantForAutofill="noExcludeDescendants">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="4dp"
            android:text="@string/search_add_custom_engine_name_label"
            android:textColor="?attr/textSecondary"
            android:textFontWeight="@integer/font_weight_light"
            android:textSize="12sp"
            tools:targetApi="p" />
        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/custom_search_engine_name_field"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="8dp"
            app:hintEnabled="false"
            app:errorEnabled="true">
            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/edit_engine_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="@dimen/accessibility_min_height"
                android:hint="@string/search_add_custom_engine_name_hint_2"
                android:inputType="text" />
        </com.google.android.material.textfield.TextInputLayout>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="4dp"
            android:text="@string/search_add_custom_engine_url_label"
            android:textColor="?attr/textSecondary"
            android:textFontWeight="@integer/font_weight_light"
            android:textSize="12sp"
            tools:targetApi="p" />
        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/custom_search_engine_search_string_field"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:hintTextColor="?attr/textSecondary"
            android:textColorHint="?attr/textSecondary"
            app:hintTextAppearance="@style/EngineTextField"
            app:hintEnabled="false"
            android:paddingBottom="8dp"
            app:errorEnabled="true">
            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/edit_search_string"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="@dimen/accessibility_min_height"
                android:hint="@string/search_add_custom_engine_search_string_hint_2"
                android:inputType="text"/>
        </com.google.android.material.textfield.TextInputLayout>

        <LinearLayout
            android:id="@+id/custom_search_engines_learn_more_wrapper"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:minHeight="@dimen/accessibility_min_height"
            android:paddingBottom="16dp">
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/search_add_custom_engine_search_string_example"
                app:lineHeight="18sp"
                android:labelFor="@id/edit_search_string"
                android:textColor="@android:color/tertiary_text_dark" />

            <org.mozilla.fenix.utils.LinkTextView
                android:id="@+id/custom_search_engines_learn_more"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/exceptions_empty_message_learn_more_link"
                android:textColor="?accent"
                android:visibility="visible"
                app:layout_constraintTop_toBottomOf="@id/exceptions_empty_message" />
        </LinearLayout>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="4dp"
            android:text="@string/search_add_custom_engine_suggest_url_label"
            android:textColor="?attr/textSecondary"
            android:textFontWeight="@integer/font_weight_light"
            android:textSize="12sp"
            tools:targetApi="p" />
        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/custom_search_engine_suggest_string_field"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:hintTextColor="?attr/textSecondary"
            android:textColorHint="?attr/textSecondary"
            app:hintTextAppearance="@style/EngineTextField"
            app:hintEnabled="false"
            app:errorEnabled="true">
            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/edit_suggest_string"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="@dimen/accessibility_min_height"
                android:hint="@string/search_add_custom_engine_suggest_string_hint"
                android:inputType="text"/>
        </com.google.android.material.textfield.TextInputLayout>

        <LinearLayout
            android:id="@+id/custom_search_suggestions_learn_more_wrapper"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:minHeight="@dimen/accessibility_min_height"
            android:paddingBottom="16dp">
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/search_add_custom_engine_suggest_string_example_2"
                app:lineHeight="18sp"
                android:labelFor="@id/edit_search_string"
                android:textColor="@android:color/tertiary_text_dark"/>

            <org.mozilla.fenix.utils.LinkTextView
                android:id="@+id/custom_search_suggestions_learn_more"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/exceptions_empty_message_learn_more_link"
                android:textColor="?accent"
                android:visibility="visible"
                app:layout_constraintTop_toBottomOf="@id/exceptions_empty_message"
                android:paddingBottom="16dp"/>
        </LinearLayout>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/save_button"
            style="@style/PositiveButton"
            android:backgroundTint="@color/button_state_list"
            android:text="@string/search_custom_engine_save_button"
            android:textColor="@color/text_on_color_state_list_text_color"/>

        <ProgressBar
            android:id="@+id/progress"
            style="@style/Widget.AppCompat.ProgressBar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:visibility="gone"/>
    </LinearLayout>
</ScrollView>
