<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:gravity="center_vertical"
    android:padding="12dp"
    android:background="?android:attr/selectableItemBackground">

    <!-- Contact avatar (circle with initial) -->
    <FrameLayout
        android:layout_width="44dp"
        android:layout_height="44dp"
        android:layout_marginEnd="12dp">

        <View
            android:id="@+id/avatar_bg"
            android:layout_width="44dp"
            android:layout_height="44dp" />

        <TextView
            android:id="@+id/avatar_text"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:textColor="#FFFFFF"
            android:textSize="18sp"
            android:textStyle="bold"
            android:fontFamily="monospace" />
    </FrameLayout>

    <!-- Name and snippet -->
    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical"
        android:layout_marginEnd="12dp">

        <TextView
            android:id="@+id/contact_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/text_primary"
            android:textSize="15sp"
            android:textStyle="bold"
            android:fontFamily="monospace"
            android:singleLine="true"
            android:ellipsize="end"
            android:layout_marginBottom="2dp" />

        <TextView
            android:id="@+id/message_snippet"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/text_secondary"
            android:textSize="13sp"
            android:fontFamily="monospace"
            android:singleLine="true"
            android:ellipsize="end" />
    </LinearLayout>

    <!-- Date and unread badge -->
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:gravity="end|center_vertical">

        <TextView
            android:id="@+id/conversation_date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/text_secondary"
            android:textSize="11sp"
            android:fontFamily="monospace"
            android:layout_marginBottom="4dp" />

        <TextView
            android:id="@+id/unread_badge"
            android:layout_width="22dp"
            android:layout_height="22dp"
            android:gravity="center"
            android:textColor="#FFFFFF"
            android:textSize="10sp"
            android:textStyle="bold"
            android:background="@color/danger"
            android:visibility="gone" />
    </LinearLayout>

</LinearLayout>
