<?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/. -->
<androidx.constraintlayout.widget.ConstraintLayout 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/search_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?foundation"
    tools:context=".search.SearchFragment">


    <ViewStub
        android:id="@+id/search_suggestions_onboarding"
        android:inflatedId="@+id/search_suggestions_onboarding"
        android:layout="@layout/search_suggestions_onboarding"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintBottom_toTopOf="@id/awesomeBar_barrier"
        app:layout_constraintTop_toBottomOf="@id/toolbar_wrapper"/>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/toolbar_wrapper"
        android:layout_width="0dp"
        android:layout_height="@dimen/browser_toolbar_height"
        android:layout_margin="0dp"
        android:outlineProvider="paddedBounds"
        android:transitionName="toolbar_wrapper_transition"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <FrameLayout
            android:id="@+id/toolbar_component_wrapper"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/fill_link_from_clipboard"
        android:layout_width="0dp"
        android:layout_height="@dimen/search_fragment_clipboard_item_height"
        android:layout_marginTop="@dimen/search_fragment_clipboard_item_vertical_margin"
        android:layout_marginStart="@dimen/search_fragment_clipboard_item_horizontal_margin"
        android:layout_marginEnd="@dimen/search_fragment_clipboard_item_horizontal_margin"
        android:focusable="true"
        android:clickable="true"
        android:background="?selectableItemBackground"
        android:visibility="gone"
        app:layout_constraintEnd_toEndOf="@id/toolbar_wrapper"
        app:layout_constraintTop_toBottomOf="@id/toolbar_wrapper"
        app:layout_constraintStart_toStartOf="@id/toolbar_wrapper">

        <ImageView
            android:id="@+id/link_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:tint="?primaryText"
            android:src="@drawable/ic_link"
            android:importantForAccessibility="no"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"/>

        <TextView
            android:id="@+id/clipboard_title"
            style="@style/SearchClipboardTitleStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/search_fragment_clipboard_item_title_margin_start"
            android:text="@string/awesomebar_clipboard_title"
            app:layout_constraintBottom_toTopOf="@id/clipboard_url"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/link_icon"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_chainStyle="packed" />

        <TextView
            android:id="@+id/clipboard_url"
            style="@style/SearchClipboardUrlStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="@id/clipboard_title"
            app:layout_constraintTop_toBottomOf="@id/clipboard_title"
            app:layout_constraintVertical_chainStyle="packed" />
    </androidx.constraintlayout.widget.ConstraintLayout>

    <View
        android:id="@+id/divider_line"
        android:layout_width="match_parent"
        android:layout_height="1.5dp"
        android:background="?neutralFaded"
        android:layout_marginStart="8dp"
        app:layout_constraintStart_toStartOf="@id/fill_link_from_clipboard"
        app:layout_constraintEnd_toEndOf="@id/fill_link_from_clipboard"
        app:layout_constraintTop_toBottomOf="@id/fill_link_from_clipboard" />

    <TextView
        android:id="@+id/search_with_shortcuts"
        style="@style/SearchShortcutsLabelStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/search_fragment_shortcuts_label_margin_horizontal"
        android:layout_marginTop="@dimen/search_fragment_shortcuts_label_margin_vertical"
        android:layout_marginEnd="@dimen/search_fragment_shortcuts_label_margin_horizontal"
        android:text="@string/search_shortcuts_search_with"
        app:layout_constraintStart_toStartOf="@id/toolbar_wrapper"
        app:layout_constraintTop_toBottomOf="@id/fill_link_from_clipboard"
        app:layout_constraintBottom_toTopOf="@id/awesomeBar_barrier"
        tools:text="Search with" />

    <androidx.constraintlayout.widget.Barrier
        android:id="@+id/awesomeBar_barrier"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:barrierDirection="bottom"
        app:constraint_referenced_ids="search_with_shortcuts,search_suggestions_onboarding"/>

    <View
        android:id="@+id/search_divider"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="?neutralFaded"
        app:layout_constraintBottom_toTopOf="@id/pillWrapper"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <LinearLayout
        android:id="@+id/pillWrapper"
        android:layout_width="0dp"
        android:layout_height="@dimen/search_fragment_pill_height"
        android:background="?foundation"
        android:orientation="horizontal"
        android:paddingStart="@dimen/search_fragment_pill_padding_start"
        android:paddingTop="@dimen/search_fragment_pill_padding_vertical"
        android:paddingEnd="@dimen/search_fragment_pill_padding_end"
        android:paddingBottom="@dimen/search_fragment_pill_padding_vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <ToggleButton
            android:id="@+id/searchScanButton"
            style="@style/search_pill"
            android:layout_marginEnd="@dimen/search_fragment_scan_button_margin_end"
            android:drawableStart="@drawable/ic_qr"
            android:textOff="@string/search_scan_button"
            android:textOn="@string/search_scan_button" />

        <ToggleButton
            android:id="@+id/searchShortcutsButton"
            style="@style/search_pill"
            android:drawableStart="@drawable/ic_search"
            android:textOff="@string/search_shortcuts_button"
            android:textOn="@string/search_shortcuts_button" />
    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>