<?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:id="@+id/itemRoomLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?android:colorBackground"
    android:clickable="true"
    android:focusable="true"
    android:foreground="?attr/selectableItemBackground">


    <FrameLayout
        android:id="@+id/roomAvatarContainer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ImageView
            android:id="@+id/roomAvatarImageView"
            android:layout_width="56dp"
            android:layout_height="56dp"
            android:importantForAccessibility="no"
            android:src="@drawable/placeholder_round_background" />

    </FrameLayout>

    <!-- Margin bottom does not work, so I use space -->
    <Space
        android:id="@+id/roomAvatarBottomSpace"
        android:layout_width="0dp"
        android:layout_height="12dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/roomAvatarContainer"
        tools:layout_marginStart="20dp" />


    <View
        android:id="@+id/roomNameView"
        android:layout_width="wrap_content"
        android:layout_height="15dp"
        android:layout_marginStart="@dimen/layout_horizontal_margin"
        android:layout_marginTop="12dp"
        android:layout_marginEnd="70dp"
        android:background="@drawable/placeholder_shape_8"
        app:layout_constrainedWidth="true"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintHorizontal_chainStyle="packed"
        app:layout_constraintStart_toEndOf="@id/roomAvatarContainer"
        app:layout_constraintTop_toTopOf="parent" />


    <View
        android:id="@+id/roomTypingView"
        android:layout_width="0dp"
        android:layout_height="30dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="20dp"
        android:background="@drawable/placeholder_shape_8"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="@+id/roomNameView"
        app:layout_constraintTop_toBottomOf="@+id/roomNameView" />

    <!-- We use vctr_list_separator_system here for a better rendering -->
    <View
        android:id="@+id/roomDividerView"
        android:layout_width="0dp"
        android:layout_height="1dp"
        android:background="?vctr_list_separator_system"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
