<?xml version="1.0" encoding="utf-8"?>
<org.thoughtcrime.securesms.conversation.v2.messages.VisibleMessageContentView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/mainContainerConstraint"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <org.thoughtcrime.securesms.util.MessageBubbleView
        android:id="@+id/contentParent"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintHorizontal_bias="0"
        app:layout_constraintEnd_toEndOf="parent"
        >
        <!-- Content that will only show on its own -->
        <include layout="@layout/view_deleted_message"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            android:visibility="gone"
            android:id="@+id/deletedMessageView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            />

        <include layout="@layout/view_untrusted_attachment"
            tools:visibility="gone"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            android:visibility="gone"
            android:id="@+id/untrustedView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

        <include layout="@layout/view_open_group_invitation"
            tools:visibility="gone"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            android:visibility="gone"
            android:id="@+id/openGroupInvitationView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

        <include layout="@layout/view_document"
            tools:visibility="gone"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            android:visibility="gone"
            android:id="@+id/documentView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

        <!-- Content that will show with other elements -->

        <include layout="@layout/view_quote"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            tools:visibility="visible"
            android:visibility="gone"
            android:id="@+id/quoteView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

        <include layout="@layout/view_voice_message"
            app:layout_constraintTop_toBottomOf="@id/quoteView"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            android:visibility="gone"
            android:id="@+id/voiceMessageView"
            android:layout_width="160dp"
            android:layout_height="36dp"/>

        <include layout="@layout/view_link_preview"
            app:layout_constraintTop_toBottomOf="@+id/quoteView"
            app:layout_constraintStart_toStartOf="parent"
            android:visibility="gone"
            android:id="@+id/linkPreviewView"
            android:layout_width="300dp"
            android:layout_height="wrap_content"/>

        <androidx.constraintlayout.widget.Barrier
            app:barrierAllowsGoneWidgets="true"
            android:id="@+id/bodyBarrier"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:barrierDirection="end"
            app:constraint_referenced_ids="linkPreviewView,quoteView,voiceMessageView"/>

        <androidx.constraintlayout.widget.Barrier
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/bodyTopBarrier"
            app:constraint_referenced_ids="linkPreviewView,quoteView"
            app:barrierDirection="bottom"/>

        <org.thoughtcrime.securesms.components.emoji.EmojiTextView
            android:contentDescription="@string/AccessibilityId_message_body"
            app:layout_constraintHorizontal_bias="0"
            tools:visibility="visible"
            android:visibility="gone"
            app:layout_constraintTop_toBottomOf="@+id/bodyTopBarrier"
            app:layout_constraintStart_toStartOf="parent"
            android:maxWidth="@dimen/max_text_width"
            android:paddingHorizontal="12dp"
            android:paddingVertical="@dimen/small_spacing"
            android:id="@+id/bodyTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
    </org.thoughtcrime.securesms.util.MessageBubbleView>

    <include layout="@layout/album_thumbnail_view"
        android:visibility="gone"
        android:id="@+id/albumThumbnailView"
        android:layout_marginTop="4dp"
        app:layout_constraintTop_toBottomOf="@+id/contentParent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

</org.thoughtcrime.securesms.conversation.v2.messages.VisibleMessageContentView>