<?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/collection_constraint_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipToPadding="false">

    <Button
        android:id="@+id/back_button"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_margin="16dp"
        android:background="?android:attr/selectableItemBackgroundBorderless"
        android:drawableStart="@drawable/mozac_ic_back"
        android:drawablePadding="8dp"
        app:drawableTint="@color/neutral_text"
        android:gravity="start|center_vertical"
        android:text="@string/create_collection_select_tabs"
        android:textAppearance="@style/HeaderTextStyle"
        android:textColor="@color/neutral_text"
        android:textSize="20sp"
        app:layout_constraintEnd_toStartOf="@+id/guideline"
        app:layout_constraintHorizontal_bias="0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintWidth_default="wrap" />

    <Button
        android:id="@+id/select_all_button"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_margin="16dp"
        android:background="?android:attr/selectableItemBackgroundBorderless"
        android:gravity="start|center_vertical"
        android:text="@string/create_collection_select_all"
        android:textAllCaps="false"
        android:textColor="@color/neutral_text"
        android:textSize="16sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="1"
        app:layout_constraintStart_toEndOf="@+id/guideline"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintWidth_default="wrap" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.5"/>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/collections_list"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="@dimen/component_collection_creation_list_margin"
        android:layout_marginTop="@dimen/component_collection_creation_list_margin"
        android:layout_marginEnd="@dimen/component_collection_creation_list_margin"
        android:visibility="gone"
        app:layout_constraintBottom_toTopOf="@id/bottom_button_bar_layout"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/back_button"
        tools:listitem="@layout/collections_list_item" />

    <EditText
        android:id="@+id/name_collection_edittext"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|center"
        android:autofillHints="false"
        android:background="?foundation"
        android:focusedByDefault="true"
        android:imeOptions="actionDone"
        android:importantForAutofill="no"
        android:inputType="textCapSentences"
        android:paddingStart="20dp"
        android:paddingTop="12dp"
        android:paddingEnd="20dp"
        android:paddingBottom="12dp"
        android:text="@string/create_collection_default_name"
        android:textColor="?primaryText"
        android:textSize="16sp"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        tools:targetApi="o" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/tab_list"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="@dimen/component_collection_creation_list_margin"
        android:layout_marginTop="@dimen/component_collection_creation_list_margin"
        android:layout_marginEnd="@dimen/component_collection_creation_list_margin"
        app:layout_constraintBottom_toTopOf="@id/bottom_button_bar_layout"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/back_button"
        tools:listitem="@layout/collection_tab_list_row" />

    <View
        android:id="@+id/tab_list_dim"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:alpha="0"
        android:background="@drawable/scrim_background"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@id/tab_list"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <View
        android:id="@+id/bottom_gradient"
        android:layout_width="match_parent"
        android:layout_height="102dp"
        android:background="@drawable/simple_dark_grey_gradient"
        app:layout_constraintBottom_toBottomOf="parent"
        android:focusable="false"/>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/bottom_button_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="16dp"
        android:foreground="@drawable/rounded_ripple"
        android:background="@drawable/add_tabs_to_collection_background"
        android:clipToPadding="false"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <ImageButton
            android:id="@+id/bottom_bar_icon_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="16dp"
            android:background="?android:attr/selectableItemBackground"
            android:contentDescription="@string/create_collection_close"
            android:src="@drawable/mozac_ic_close"
            android:tint="?neutral"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/bottom_bar_text"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:gravity="center_vertical"
            android:text="@string/create_collection_save_to_collection_empty"
            android:textColor="?neutral"
            android:textSize="16sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/save_button"
            app:layout_constraintStart_toEndOf="@id/bottom_bar_icon_button"
            app:layout_constraintTop_toTopOf="parent" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/save_button"
            style="@style/Widget.MaterialComponents.Button.TextButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="?android:attr/selectableItemBackground"
            android:text="@string/create_collection_save"
            android:textColor="?neutral"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
