<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Nextcloud Talk - Android Client
  ~
  ~ SPDX-FileCopyrightText: 2021 Andy Scherzinger <info@andy-scherzinger.de>
  ~ SPDX-FileCopyrightText: 2020 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:id="@+id/quotedChatMessageView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="8dp">

    <View
        android:id="@+id/quoteColoredView"
        android:layout_width="2dp"
        android:layout_height="match_parent"
        android:layout_alignBottom="@id/flexboxQuoted"
        android:layout_alignParentStart="true"
        android:layout_marginEnd="8dp"
        android:background="@color/high_emphasis_text" />

    <androidx.emoji2.widget.EmojiTextView
        android:id="@+id/quotedMessageAuthor"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_marginEnd="8dp"
        android:layout_toEndOf="@id/quoteColoredView"
        android:alpha="0.6"
        android:ellipsize="end"
        android:textAlignment="viewStart"
        android:textColor="@color/no_emphasis_text"
        android:textIsSelectable="false"
        android:textSize="12sp"
        tools:text="Jane Doe" />

    <com.google.android.flexbox.FlexboxLayout
        android:id="@+id/flexboxQuoted"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/quotedMessageAuthor"
        android:layout_alignStart="@id/quotedMessageAuthor"
        android:layout_marginTop="4dp"
        android:layout_toStartOf="@id/cancelReplyButton"
        android:orientation="vertical"
        app:alignContent="stretch"
        app:alignItems="stretch"
        app:flexWrap="wrap"
        app:justifyContent="flex_start">

        <ImageView
            android:id="@+id/quotedMessageImage"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:adjustViewBounds="true"
            android:contentDescription="@null"
            android:scaleType="fitCenter"
            app:layout_alignSelf="flex_start"
            app:layout_flexGrow="1"
            app:layout_wrapBefore="true"
            tools:src="@tools:sample/backgrounds/scenic" />

        <androidx.emoji2.widget.EmojiTextView
            android:id="@+id/quotedMessage"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/quotedMessageImage"
            android:layout_alignStart="@id/quotedMessageAuthor"
            android:ellipsize="end"
            android:lineSpacingMultiplier="1.2"
            android:maxLines="4"
            android:textAlignment="viewStart"
            android:textColor="@color/high_emphasis_text"
            android:textIsSelectable="false"
            android:textSize="14sp"
            app:layout_alignSelf="flex_start"
            app:layout_flexGrow="1"
            app:layout_wrapBefore="true"
            tools:text="Hello, this is me!" />

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

    <ImageButton
        android:id="@+id/cancelReplyButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_centerVertical="true"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"
        android:background="@color/transparent"
        android:contentDescription="@string/nc_message_quote_cancel_reply"
        android:src="@drawable/ic_cancel_black_24dp"
        android:visibility="gone"
        tools:visibility="visible" />

</RelativeLayout>
