<?xml version="1.0" encoding="utf-8"?>
<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="72dp"
    android:background="?android:selectableItemBackground"
    android:clickable="true"
    android:focusable="true"
    android:orientation="horizontal"
    android:paddingStart="16dp"
    android:paddingEnd="16dp">

    <com.facebook.drawee.view.SimpleDraweeView
        android:id="@+id/profile_pic"
        android:layout_width="@dimen/dm_inbox_avatar_size"
        android:layout_height="@dimen/dm_inbox_avatar_size"
        app:actualImageScaleType="centerCrop"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@id/username"
        app:layout_constraintHorizontal_chainStyle="spread_inside"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:roundAsCircle="true"
        tools:background="@mipmap/ic_launcher" />

    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/username"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:ellipsize="end"
        android:gravity="bottom"
        android:singleLine="true"
        android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
        app:layout_constraintBottom_toTopOf="@id/requester"
        app:layout_constraintEnd_toStartOf="@id/controls_barrier"
        app:layout_constraintStart_toEndOf="@id/profile_pic"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_chainStyle="packed"
        tools:text="username......................." />

    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/requester"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:maxLines="1"
        android:textAppearance="@style/TextAppearance.AppCompat.Caption"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="@id/username"
        app:layout_constraintStart_toStartOf="@id/username"
        app:layout_constraintTop_toBottomOf="@id/username"
        tools:text="Added by someone" />

    <androidx.constraintlayout.widget.Barrier
        android:id="@+id/controls_barrier"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:barrierAllowsGoneWidgets="true"
        app:barrierDirection="start"
        app:constraint_referenced_ids="progress,approve,deny" />

    <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/approve"
        android:layout_width="42dp"
        android:layout_height="42dp"
        android:layout_marginStart="4dp"
        android:background="?selectableItemBackgroundBorderless"
        android:scaleType="centerInside"
        android:visibility="visible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@id/deny"
        app:layout_constraintStart_toEndOf="@id/controls_barrier"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/ic_check_24"
        app:tint="@color/green_500"
        tools:visibility="visible" />

    <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/deny"
        android:layout_width="42dp"
        android:layout_height="42dp"
        android:layout_marginStart="8dp"
        android:background="?selectableItemBackgroundBorderless"
        android:scaleType="centerInside"
        android:visibility="visible"
        app:layout_constraintBottom_toBottomOf="@id/profile_pic"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/approve"
        app:layout_constraintTop_toTopOf="@id/profile_pic"
        app:srcCompat="@drawable/ic_close_24"
        app:tint="@color/red_500"
        tools:visibility="visible" />

    <com.google.android.material.progressindicator.CircularProgressIndicator
        android:id="@+id/progress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        android:visibility="gone"
        app:indicatorColor="?colorSurface"
        app:indicatorSize="30dp"
        app:layout_constraintBottom_toBottomOf="@id/profile_pic"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/controls_barrier"
        app:layout_constraintTop_toTopOf="@id/profile_pic"
        app:trackColor="@color/blue_900"
        tools:visibility="gone" />

    <include
        layout="@layout/item_pref_divider"
        android:layout_width="0dp"
        android:layout_height="1dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="@id/thread_title" />
</androidx.constraintlayout.widget.ConstraintLayout>