<?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:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="@dimen/library_item_height"
        android:background="?android:attr/selectableItemBackground">

    <ImageSwitcher
            android:id="@+id/icon"
            android:layout_width="@dimen/history_favicon_width_height"
            android:layout_height="@dimen/history_favicon_width_height"
            android:layout_marginStart="8dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent">
        <com.google.android.material.imageview.ShapeableImageView
                android:id="@+id/favicon"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:padding="8dp"
                android:scaleType="centerCrop"
                android:importantForAccessibility="no"
                tools:src="@drawable/ic_folder_icon" />
        <ImageView
                android:id="@+id/checkmark"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:layout_marginStart="4dp"
                android:layout_marginTop="4dp"
                android:padding="10dp"
                android:background="@drawable/favicon_background"
                android:backgroundTint="?accent"
                app:srcCompat="@drawable/mozac_ic_checkmark_24" />
    </ImageSwitcher>

    <TextView
            android:id="@+id/title"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginEnd="4dp"
            android:ellipsize="end"
            android:singleLine="true"
            android:textAlignment="viewStart"
            android:textSize="16sp"
            android:textColor="?attr/textPrimary"
            tools:text="Example site"
            app:layout_constraintEnd_toStartOf="@id/overflow_menu"
            app:layout_constraintStart_toEndOf="@id/icon"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toTopOf="@+id/url"
            app:layout_constraintVertical_chainStyle="packed"
            app:layout_goneMarginEnd="@dimen/library_item_icon_margin_horizontal" />

    <TextView
            android:id="@+id/url"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:layout_marginEnd="4dp"
            android:ellipsize="end"
            android:singleLine="true"
            android:textAlignment="viewStart"
            android:textColor="?attr/textSecondary"
            android:textSize="14sp"
            tools:text="https://example.com/"
            app:layout_constraintEnd_toStartOf="@id/overflow_menu"
            app:layout_constraintStart_toEndOf="@id/icon"
            app:layout_constraintTop_toBottomOf="@+id/title"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_goneMarginEnd="@dimen/library_item_icon_margin_horizontal" />

    <ImageButton
            android:id="@+id/overflow_menu"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:minWidth="48dp"
            android:minHeight="48dp"
            android:background="?android:attr/selectableItemBackgroundBorderless"
            android:contentDescription="@string/content_description_menu"
            android:padding="12dp"
            app:srcCompat="@drawable/ic_menu"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:layout_marginEnd="4dp"/>

</androidx.constraintlayout.widget.ConstraintLayout>
