<?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:mozac="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/tab_wrapper"
    style="@style/BottomSheetModal"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:backgroundTint="@color/foundation_normal_theme"
    app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

    <View
        android:id="@+id/handle"
        android:layout_width="0dp"
        android:layout_height="3dp"
        android:layout_marginTop="8dp"
        android:background="@color/secondary_text_normal_theme"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintWidth_percent="0.1" />

    <TextView
        android:id="@+id/tab_tray_empty_view"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:gravity="center_horizontal"
        android:paddingTop="80dp"
        android:text="@string/no_open_tabs_description"
        android:textColor="?secondaryText"
        android:textSize="16sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/topBar" />

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/topBar"
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:background="@color/foundation_normal_theme"
        app:layout_constraintTop_toBottomOf="@+id/handle">

        <ImageButton
            android:id="@+id/exit_multi_select"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_marginStart="0dp"
            android:background="?android:attr/selectableItemBackgroundBorderless"
            android:contentDescription="@string/tab_tray_close_multiselect_content_description"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="@+id/multiselect_title"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/multiselect_title"
            app:srcCompat="@drawable/ic_close"
            app:tint="@color/contrast_text_normal_theme" />

        <TextView
            android:id="@+id/multiselect_title"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="12dp"
            android:textColor="@color/contrast_text_normal_theme"
            android:textSize="18sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/collect_multi_select"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintHorizontal_chainStyle="packed"
            app:layout_constraintStart_toEndOf="@+id/exit_multi_select"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="3 selected" />

        <TextView
            android:id="@+id/collect_multi_select"
            android:layout_width="wrap_content"
            android:layout_height="48dp"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="16dp"
            android:background="?android:attr/selectableItemBackgroundBorderless"
            android:contentDescription="@string/tab_tray_collection_button_multiselect_content_description"
            android:drawablePadding="8dp"
            android:gravity="center_vertical"
            android:text="@string/tab_tray_save_to_collection"
            android:textAllCaps="true"
            android:textColor="@color/contrast_text_normal_theme"
            android:textSize="14sp"
            android:textStyle="bold"
            android:visibility="gone"
            app:drawableStartCompat="@drawable/ic_tab_collection"
            app:drawableTint="@color/contrast_text_normal_theme"
            app:fontFamily="@font/metropolis_medium"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <com.google.android.material.tabs.TabLayout
            android:id="@+id/tab_layout"
            android:layout_width="0dp"
            android:layout_height="80dp"
            android:background="@color/foundation_normal_theme"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintWidth_percent="0.5"
            app:tabGravity="fill"
            app:tabIconTint="@color/tab_icon"
            app:tabIndicatorColor="@color/accent_normal_theme"
            app:tabRippleColor="@android:color/transparent">

            <com.google.android.material.tabs.TabItem
                android:id="@+id/default_tab_item"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:contentDescription="@string/tab_header_label"
                android:layout="@layout/tabs_tray_tab_counter"
                app:tabIconTint="@color/tab_icon" />

            <com.google.android.material.tabs.TabItem
                android:id="@+id/private_tab_item"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:contentDescription="@string/tabs_header_private_tabs_title"
                android:icon="@drawable/ic_private_browsing" />

        </com.google.android.material.tabs.TabLayout>

        <ImageButton
            android:id="@+id/tab_tray_new_tab"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:background="?android:attr/selectableItemBackgroundBorderless"
            android:contentDescription="@string/add_tab"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="@id/tab_layout"
            app:layout_constraintEnd_toStartOf="@id/tab_tray_overflow"
            app:layout_constraintTop_toTopOf="@id/tab_layout"
            app:tint="@color/primary_text_normal_theme"
            app:srcCompat="@drawable/ic_new" />

        <ImageButton
            android:id="@+id/tab_tray_overflow"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_marginEnd="0dp"
            android:background="?android:attr/selectableItemBackgroundBorderless"
            android:contentDescription="@string/open_tabs_menu"
            android:visibility="visible"
            app:tint="@color/accent_normal_theme"
            app:layout_constraintBottom_toBottomOf="@id/tab_layout"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@id/tab_layout"
            app:srcCompat="@drawable/ic_menu" />
    </androidx.constraintlayout.widget.ConstraintLayout>

    <View
        android:id="@+id/divider"
        android:layout_width="0dp"
        android:layout_height="1dp"
        android:background="@color/tab_tray_item_divider_normal_theme"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/topBar" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/tabsTray"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:clipToPadding="false"
        android:paddingBottom="140dp"
        android:scrollbars="vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/divider" />

</androidx.constraintlayout.widget.ConstraintLayout>
