<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/drawableItemBackground">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/clItem"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <View
            android:id="@+id/vwColor"
            android:layout_width="6dp"
            android:layout_height="0dp"
            android:background="@color/colorAccent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <ImageView
            android:id="@+id/ivFlagged"
            android:layout_width="21dp"
            android:layout_height="21dp"
            android:layout_marginStart="6dp"
            android:src="@drawable/baseline_star_24"
            android:visibility="visible"
            app:layout_constraintBottom_toBottomOf="@id/tvFrom"
            app:layout_constraintStart_toEndOf="@id/vwColor"
            app:layout_constraintTop_toTopOf="@+id/tvFrom" />

        <ImageView
            android:id="@+id/ivAvatar"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginStart="6dp"
            android:src="@drawable/baseline_person_24"
            app:layout_constraintBottom_toBottomOf="@+id/tvFrom"
            app:layout_constraintDimensionRatio="1:1"
            app:layout_constraintStart_toEndOf="@id/ivFlagged"
            app:layout_constraintTop_toTopOf="@+id/tvFrom" />

        <TextView
            android:id="@+id/tvFrom"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="6dp"
            android:layout_marginStart="6dp"
            android:ellipsize="end"
            android:maxLines="1"
            android:text="From"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            app:layout_constraintEnd_toStartOf="@+id/tvSize"
            app:layout_constraintStart_toEndOf="@id/ivAvatar"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/tvSize"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="6dp"
            android:maxLines="1"
            android:text="123 KB"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@id/tvFrom"
            app:layout_constraintEnd_toStartOf="@id/tvTime" />

        <TextView
            android:id="@+id/tvTime"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="12dp"
            android:maxLines="1"
            android:text="Time"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@id/tvFrom"
            app:layout_constraintEnd_toEndOf="parent" />

        <ImageView
            android:id="@+id/ivAttachments"
            android:layout_width="21dp"
            android:layout_height="21dp"
            android:layout_marginStart="6dp"
            android:src="@drawable/baseline_attachment_24"
            app:layout_constraintBottom_toBottomOf="@id/tvSubject"
            app:layout_constraintStart_toEndOf="@id/vwColor"
            app:layout_constraintTop_toTopOf="@+id/tvSubject" />

        <TextView
            android:id="@+id/tvSubject"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="6dp"
            android:layout_marginStart="6dp"
            android:ellipsize="end"
            android:maxLines="1"
            android:text="Subject"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintEnd_toStartOf="@+id/tvFolder"
            app:layout_constraintStart_toEndOf="@id/ivAttachments"
            app:layout_constraintTop_toBottomOf="@id/tvFrom" />

        <TextView
            android:id="@+id/tvFolder"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="6dp"
            android:maxLines="1"
            android:text="folder"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@id/tvSubject"
            app:layout_constraintEnd_toStartOf="@+id/tvCount" />

        <TextView
            android:id="@+id/tvCount"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="3dp"
            android:maxLines="1"
            android:text="3"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            app:layout_constraintBottom_toBottomOf="@id/tvSubject"
            app:layout_constraintEnd_toStartOf="@+id/ivThread" />

        <ImageView
            android:id="@+id/ivThread"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginEnd="12dp"
            android:src="@drawable/baseline_message_24"
            app:layout_constraintBottom_toBottomOf="@id/tvSubject"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@id/tvSubject" />

        <TextView
            android:id="@+id/tvError"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="12dp"
            android:layout_marginStart="6dp"
            android:text="error"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"
            android:textColor="?attr/colorWarning"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/vwColor"
            app:layout_constraintTop_toBottomOf="@id/tvSubject" />

        <ProgressBar
            android:id="@+id/pbLoading"
            style="@style/Base.Widget.AppCompat.ProgressBar"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginStart="12dp"
            android:indeterminate="true"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/marginBottom"
            android:layout_width="match_parent"
            android:layout_height="3dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/tvError" />

        <View
            android:id="@+id/vSeparator"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="?attr/colorSeparator"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/marginBottom" />

    </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>