<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Nextcloud Talk - Android Client
  ~
  ~ SPDX-FileCopyrightText: 2021 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">

    <com.google.android.flexbox.FlexboxLayout
        android:id="@id/bubble"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_marginStart="@dimen/message_outcoming_bubble_margin_left"
        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" />

        <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"
            tools:text="Talk to you later!" />

        <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="center"
            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="center"
            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="center"
            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="center"
            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"/>

        <include
            android:id="@+id/reactions"
            layout="@layout/reactions_inside_message" />

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