<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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/composerLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent">

    <View
        android:id="@+id/related_message_background"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="?riotx_bottom_nav_background_color"
        app:layout_constraintBottom_toBottomOf="@id/composer_preview_barrier"
        app:layout_constraintTop_toTopOf="parent" />

    <View
        android:id="@+id/related_message_background_top_separator"
        android:layout_width="0dp"
        android:layout_height="1dp"
        android:background="?riotx_bottom_nav_background_border_color"
        app:layout_constraintEnd_toEndOf="@id/related_message_background"
        app:layout_constraintStart_toStartOf="@+id/related_message_background"
        app:layout_constraintTop_toTopOf="@id/related_message_background" />

    <View
        android:id="@+id/related_message_background_bottom_separator"
        android:layout_width="0dp"
        android:layout_height="1dp"
        android:background="?riotx_bottom_nav_background_border_color"
        app:layout_constraintBottom_toBottomOf="@id/related_message_background"
        app:layout_constraintEnd_toEndOf="@id/related_message_background"
        app:layout_constraintStart_toStartOf="@+id/related_message_background" />

    <ImageView
        android:id="@+id/composerRelatedMessageAvatar"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:layout_marginBottom="8dp"
        app:layout_constraintBottom_toTopOf="@id/composerRelatedMessageActionIcon"
        app:layout_constraintEnd_toStartOf="@+id/composerRelatedMessageTitle"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@id/composerRelatedMessageTitle"
        tools:src="@tools:sample/avatars" />

    <TextView
        android:id="@+id/composerRelatedMessageTitle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_margin="8dp"
        android:textStyle="bold"
        app:layout_constraintEnd_toStartOf="@id/composerRelatedMessageCloseButton"
        app:layout_constraintStart_toEndOf="@id/composerRelatedMessageAvatar"
        app:layout_constraintTop_toTopOf="parent"
        tools:text="@tools:sample/first_names" />

    <TextView
        android:id="@+id/composerRelatedMessageContent"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:maxLines="2"
        android:textColor="?vctr_message_text_color"
        app:layout_constrainedHeight="true"
        app:layout_constraintEnd_toEndOf="@id/composerRelatedMessageTitle"
        app:layout_constraintStart_toStartOf="@id/composerRelatedMessageTitle"
        app:layout_constraintTop_toBottomOf="@id/composerRelatedMessageTitle"
        tools:text="@tools:sample/lorem/random" />

    <ImageView
        android:id="@+id/composerRelatedMessageActionIcon"
        android:layout_width="10dp"
        android:layout_height="10dp"
        android:layout_marginTop="6dp"
        android:layout_marginBottom="38dp"
        android:alpha="1"
        android:visibility="visible"
        app:layout_constraintEnd_toEndOf="@id/composerRelatedMessageAvatar"
        app:layout_constraintStart_toStartOf="@id/composerRelatedMessageAvatar"
        app:layout_constraintTop_toBottomOf="@id/composerRelatedMessageAvatar"
        app:tint="?riotx_text_primary"
        tools:ignore="MissingPrefix"
        tools:src="@drawable/ic_edit" />


    <ImageButton
        android:id="@+id/composerRelatedMessageCloseButton"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:background="?android:attr/selectableItemBackground"
        android:src="@drawable/ic_close_round"
        app:layout_constraintBottom_toBottomOf="@id/composerRelatedMessageContent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@id/composerRelatedMessageContent"
        app:tint="@color/riotx_notice"
        tools:ignore="MissingPrefix" />

    <androidx.constraintlayout.widget.Barrier
        android:id="@+id/composer_preview_barrier"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:barrierDirection="bottom"
        app:barrierMargin="8dp"
        app:constraint_referenced_ids="composerRelatedMessageContent,composerRelatedMessageActionIcon"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <ImageButton
        android:id="@+id/attachmentButton"
        android:layout_width="52dp"
        android:layout_height="52dp"
        android:layout_margin="1dp"
        android:background="?android:attr/selectableItemBackground"
        android:src="@drawable/ic_attachment"
        app:layout_constraintBottom_toBottomOf="@+id/sendButton"
        app:layout_constraintEnd_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@+id/sendButton"
        tools:ignore="MissingPrefix" />

    <ImageView
        android:id="@+id/composerShieldImageView"
        android:layout_width="16dp"
        android:layout_height="16dp"
        android:layout_marginStart="8dp"
        app:layout_constraintBottom_toBottomOf="@+id/sendButton"
        app:layout_constraintEnd_toStartOf="@+id/composerEditText"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@+id/sendButton"
        tools:src="@drawable/ic_shield_black" />

    <im.vector.app.features.home.room.detail.composer.ComposerEditText
        android:id="@+id/composerEditText"
        style="@style/ComposerEditTextStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:nextFocusLeft="@id/composerEditText"
        android:nextFocusUp="@id/composerEditText"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/composerEmojiButton"
        app:layout_constraintStart_toEndOf="@+id/composerShieldImageView"
        app:layout_constraintTop_toBottomOf="@id/composer_preview_barrier"
        tools:text="@tools:sample/lorem/random" />

    <ImageButton
        android:id="@+id/composerEmojiButton"
        android:layout_width="52dp"
        android:layout_height="52dp"
        android:layout_margin="1dp"
        android:background="?android:attr/selectableItemBackground"
        android:src="@drawable/ic_insert_emoji"
        app:layout_constraintBottom_toBottomOf="@id/sendButton"
        app:layout_constraintEnd_toStartOf="@+id/sendButton"
        app:layout_constraintStart_toEndOf="@id/composerEditText"
        app:layout_constraintTop_toTopOf="@id/sendButton"
        app:layout_goneMarginEnd="8dp" />

    <ImageButton
        android:id="@+id/sendButton"
        android:layout_width="56dp"
        android:layout_height="56dp"
        android:layout_marginEnd="2dp"
        android:background="@drawable/bg_send"
        android:scaleType="center"
        android:src="@drawable/ic_send"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/composer_preview_barrier"
        app:layout_constraintVertical_bias="1"
        tools:ignore="MissingPrefix" />

</androidx.constraintlayout.widget.ConstraintLayout>