<?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="wrap_content"
    android:paddingStart="8dp"
    android:paddingTop="4dp"
    android:paddingEnd="60dp"
    android:paddingBottom="4dp">

    <de.hdodenhof.circleimageview.CircleImageView
        android:id="@+id/imgAvatar"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:src="@drawable/ic_person"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@+id/layoutMessage" />

    <LinearLayout
        android:id="@+id/layoutMessage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:background="@drawable/bg_message_received"
        android:orientation="vertical"
        app:layout_constraintStart_toEndOf="@+id/imgAvatar"
        app:layout_constraintTop_toTopOf="parent">

        <TextView
            android:id="@+id/tvMessage"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxWidth="270dp"
            android:textColor="@android:color/black"
            android:textSize="14sp"
            tools:text="Boleh banget teh. Teteh mau nawar berapa?" />

        <ImageView
            android:id="@+id/imgAttachment"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:adjustViewBounds="true"
            android:maxWidth="220dp"
            android:scaleType="fitCenter"
            android:visibility="gone"
            tools:src="@drawable/placeholder_image"
            tools:visibility="visible" />

    </LinearLayout>

    <TextView
        android:id="@+id/tvTimestamp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="2dp"
        android:textColor="#888888"
        android:textSize="10sp"
        app:layout_constraintStart_toStartOf="@+id/layoutMessage"
        app:layout_constraintTop_toBottomOf="@+id/layoutMessage"
        tools:text="12:30" />

</androidx.constraintlayout.widget.ConstraintLayout>