<?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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:layout_marginEnd="8dp" android:layout_alignParentEnd="true" app:layout_constraintEnd_toEndOf="parent" android:layout_gravity="end" android:layout_marginTop="16dp"> <TextView android:id="@+id/text_gchat_date_me" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="32dp" android:paddingStart="8dp" android:layout_centerHorizontal="true" android:paddingTop="4dp" android:paddingEnd="8dp" android:paddingBottom="4dp" android:text="June 10" android:textColor="#C0C0C0" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintHorizontal_bias="0.018" /> <androidx.constraintlayout.widget.ConstraintLayout android:layout_toEndOf="@id/text_gchat_date_me" android:layout_width="280dp" android:layout_height="wrap_content" android:layout_below="@id/text_gchat_date_me" android:foregroundGravity="right"> <androidx.cardview.widget.CardView android:id="@+id/card_gchat_message_me" android:layout_width="wrap_content" android:layout_height="wrap_content" app:cardBackgroundColor="#774df2" app:cardCornerRadius="12dp" app:cardElevation="0dp" app:contentPadding="12dp" app:contentPaddingBottom="7dp" app:cardPreventCornerOverlap="false" app:cardUseCompatPadding="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/text_gchat_date_me"> <LinearLayout android:id="@+id/layout_gchat_container_me" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <com.demarridosunmu.gptutor3.ui.MathView2 android:id="@+id/text_gchat_message_me" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:maxWidth="260dp" android:paddingLeft="12dp" android:paddingTop="8dp" android:paddingRight="12dp" android:text="This is a Message" android:textColor="#ffffff" android:textSize="16sp" /> </LinearLayout> </androidx.cardview.widget.CardView> <TextView android:id="@+id/text_gchat_timestamp_me" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="10:00" android:textColor="#C0C0C0" android:textSize="10sp" app:layout_constraintBottom_toBottomOf="@+id/card_gchat_message_me" app:layout_constraintEnd_toStartOf="@+id/card_gchat_message_me" /> </androidx.constraintlayout.widget.ConstraintLayout> </RelativeLayout>