[C++ or Other Android Development Languages] natezire71:
I've posted this over on StackOverflow but am still at an impass.

I have the following code. (Pastebin for those who prefer it)

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="52dp"
android:layout_gravity="center"
android:gravity="center"
android:orientation="horizontal">

<LinearLayout
android:id="@+id/holder"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/contactPicture"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="24dp"
android:layout_gravity="left"
android:gravity="center"
android:scaleType="centerCrop"
android:maxHeight="48dp"
android:maxWidth="48dp"
android:minHeight="48dp"
android:minWidth="48dp"
tools:ignore="Suspicious0dp"/>

<TextView
android:id="@+id/body"
android:textAlignment="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:textSize="14sp"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:textColor="@color/textColorReceived"/>

<ImageView
android:id="@+id/myPicture"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="24dp"
android:layout_gravity="right"
android:gravity="center"
android:scaleType="centerCrop"
android:maxHeight="48dp"
android:maxWidth="48dp"
android:minHeight="48dp"
android:minWidth="48dp"/>

<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_gravity="center_vertical"
android:paddingRight="5dp"
android:textSize="12sp"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:fontFamily="sans-serif-light"
android:textColor="@color/dateColorReceived"
android:layout_marginTop="-3dp"
android:paddingBottom="3dp"/>

<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:gravity="center"
android:layout_gravity="center"
android:id="@+id/media"
android:padding="10dp"
android:visibility="gone"
android:scaleType="centerInside"/>

<View android:id="@+id/gifView"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:padding="10dp"
android:visibility="gone"/>

<TextView
android:id="@+id/date"
android:layout_gravity="bottom"
android:gravity="center_horizontal"
android:textSize="12sp"
android:visibility="visible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:textColor="@color/dateColorReceived"/>

</LinearLayout>
</RelativeLayout>

Here is what it looks like

However, some messages look wrong. They just get really warped; as it seems, this only happens on longer messages; also, I lose the

@+id/date

Can't seem to figure out why. Plus,

@+id/myPicture

doesn't always stay to the right.

I've been working on this for a little over a week. Today alone I've spent 5 hours on it. Driving me crazy. :|

I really would appreciate any and all help. :)