<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ F7cloud Talk - Android Client
  ~
  ~ SPDX-FileCopyrightText: 2021, 2025 Andy Scherzinger <info@andy-scherzinger.de>
  ~ SPDX-FileCopyrightText: 2017-2018 Mario Danic <mario@lovelyhq.com>
  ~ SPDX-License-Identifier: GPL-3.0-or-later
-->
<RelativeLayout 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:layout_marginLeft="16dp"
    android:layout_marginTop="2dp"
    android:layout_marginRight="16dp"
    android:layout_marginBottom="2dp">

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_marginStart="@dimen/message_outcoming_bubble_margin_left"
        android:orientation="vertical">

        <com.google.android.flexbox.FlexboxLayout
            android:id="@id/bubble"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:alignContent="stretch"
            app:alignItems="stretch"
            app:flexWrap="wrap"
            app:justifyContent="flex_end">

            <include
                android:id="@+id/message_quote"
                layout="@layout/item_message_quote"
                android:visibility="gone" />

            <include
                android:id="@+id/threadTitleWrapper"
                layout="@layout/item_thread_title"
                android:visibility="gone"/>

            <androidx.emoji2.widget.EmojiTextView
                android:id="@id/messageText"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignWithParentIfMissing="true"
                android:lineSpacingMultiplier="1.2"
                android:textAlignment="viewStart"
                android:textColorHighlight="@color/nc_grey"
                android:textIsSelectable="false"
                app:layout_alignSelf="flex_start"
                app:layout_flexGrow="1"
                tools:text="Talk to you later!" />

            <LinearLayout
                android:id="@+id/checkboxContainer"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:visibility="gone"
                app:layout_alignSelf="flex_start"
                app:layout_flexGrow="1"
                app:layout_wrapBefore="true">
            </LinearLayout>

            <TextView
                android:id="@id/messageTime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/messageText"
                android:layout_marginStart="8dp"
                android:alpha="0.6"
                android:gravity="end"
                android:textColor="@color/no_emphasis_text"
                android:textIsSelectable="false"
                app:layout_alignSelf="flex_end"
                app:layout_flexGrow="1"
                app:layout_wrapBefore="false"
                tools:text="10:35" />

            <TextView
                android:id="@+id/messageEditIndicator"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/messageText"
                android:layout_marginStart="8dp"
                android:alpha="0.6"
                android:textColor="@color/no_emphasis_text"
                android:textIsSelectable="false"
                app:layout_alignSelf="flex_end"
                android:text = "@string/hint_edited_message"
                android:textSize="12sp">

            </TextView>

            <ImageView
                android:id="@+id/checkMark"
                android:layout_width="25dp"
                android:layout_height="@dimen/message_bubble_checkmark_height"
                android:layout_below="@id/messageTime"
                android:layout_marginStart="8dp"
                android:contentDescription="@null"
                app:layout_alignSelf="flex_end"
                app:tint="@color/high_emphasis_text"
                tools:src="@drawable/ic_check_all" />

            <ImageView
                android:id="@+id/sending_failed"
                android:layout_width="wrap_content"
                android:layout_height="@dimen/message_bubble_checkmark_height"
                android:layout_below="@id/messageTime"
                android:layout_marginStart="8dp"
                android:contentDescription="@null"
                app:layout_alignSelf="flex_end"
                app:tint="@color/high_emphasis_text"
                tools:src="@drawable/ic_warning_white"/>

            <ImageView
                android:id="@+id/sending_progress"
                android:layout_width="wrap_content"
                android:layout_height="@dimen/message_bubble_checkmark_height"
                android:layout_below="@id/messageTime"
                android:layout_marginStart="8dp"
                android:contentDescription="@null"
                app:layout_alignSelf="center"
                app:tint="@color/high_emphasis_text"
                tools:src="@drawable/baseline_schedule_24"/>

        </com.google.android.flexbox.FlexboxLayout>

        <include
            android:id="@+id/reactions"
            layout="@layout/reactions_inside_message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/bubble"
            android:layout_marginStart="@dimen/message_bubble_corners_horizontal_padding"
            android:layout_marginTop="-4dp" />
    </RelativeLayout>
</RelativeLayout>
