<?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="0dp"
        android:layout_height="0dp"
        android:background="?colorSurface"
        app:layout_constraintBottom_toTopOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        tools:layout_height="40dp" />

    <View
        android:id="@+id/related_message_background_top_separator"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="?vctr_list_separator"
        app:layout_constraintBottom_toTopOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <ImageView
        android:id="@+id/composerRelatedMessageAvatar"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:importantForAccessibility="no"
        android:visibility="invisible"
        app:layout_constraintBottom_toTopOf="parent"
        app:layout_constraintEnd_toStartOf="parent" />

    <TextView
        android:id="@+id/composerRelatedMessageTitle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:textStyle="bold"
        android:visibility="invisible"
        app:layout_constraintBottom_toTopOf="@id/composerRelatedMessageContent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        tools:text="@tools:sample/first_names" />

    <TextView
        android:id="@+id/composerRelatedMessageContent"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:visibility="invisible"
        app:layout_constraintBottom_toTopOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        tools:text="@tools:sample/lorem/random" />

    <ImageView
        android:id="@+id/composerRelatedMessageActionIcon"
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:layout_marginTop="8dp"
        android:layout_marginBottom="38dp"
        android:alpha="0"
        android:importantForAccessibility="no"
        app:layout_constraintEnd_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="parent"
        app:tint="?vctr_content_primary"
        tools:ignore="MissingConstraints,MissingPrefix"
        tools:src="@drawable/ic_edit" />

    <ImageView
        android:id="@+id/composerRelatedMessageImage"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:importantForAccessibility="no"
        app:layout_constraintBottom_toTopOf="parent"
        app:layout_constraintStart_toEndOf="parent"
        tools:ignore="MissingPrefix"
        tools:src="@tools:sample/backgrounds/scenic" />

    <ImageButton
        android:id="@+id/composerRelatedMessageCloseButton"
        android:layout_width="22dp"
        android:layout_height="22dp"
        android:background="?android:attr/selectableItemBackground"
        android:contentDescription="@string/cancel"
        android:src="@drawable/ic_close_round"
        android:visibility="invisible"
        app:layout_constraintBottom_toTopOf="parent"
        app:layout_constraintStart_toEndOf="parent"
        app:tint="?colorError"
        tools:ignore="MissingPrefix"
        tools:visibility="visible" />

    <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:contentDescription="@string/option_send_files"
        android:src="@drawable/ic_attachment"
        app:layout_constraintBottom_toBottomOf="@id/sendButton"
        app:layout_constraintEnd_toStartOf="@+id/composerEditTextOuterBorder"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@id/sendButton"
        app:layout_goneMarginBottom="57dp"
        tools:ignore="MissingPrefix" />

    <FrameLayout
        android:id="@+id/composerEditTextOuterBorder"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="8dp"
        android:layout_marginBottom="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@id/sendButton"
        app:layout_constraintStart_toEndOf="@id/attachmentButton"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_goneMarginEnd="12dp" />

    <im.vector.app.features.home.room.detail.composer.ComposerEditText
        android:id="@+id/composerEditText"
        style="@style/Widget.Vector.EditText.Composer"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:hint="@string/room_message_placeholder_not_encrypted"
        android:nextFocusLeft="@id/composerEditText"
        android:nextFocusUp="@id/composerEditText"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/composerEmojiButton"
        app:layout_constraintStart_toStartOf="@+id/composerEditTextOuterBorder"
        app:layout_constraintTop_toTopOf="parent"
        tools:text="@tools:sample/lorem/random" />

    <ImageButton
        android:id="@+id/composerEmojiButton"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_margin="1dp"
        android:background="?android:attr/selectableItemBackground"
        android:contentDescription="@string/a11y_open_emoji_picker"
        android:src="@drawable/ic_insert_emoji"
        app:layout_constraintBottom_toBottomOf="@id/attachmentButton"
        app:layout_constraintEnd_toEndOf="@+id/composerEditTextOuterBorder"
        app:layout_constraintStart_toEndOf="@id/composerEditText"
        app:layout_constraintTop_toTopOf="@id/attachmentButton"
        app:layout_goneMarginEnd="8dp"
        app:tint="?vctr_content_quaternary"
        tools:ignore="MissingPrefix" />

    <ImageButton
        android:id="@+id/sendButton"
        android:layout_width="56dp"
        android:layout_height="56dp"
        android:layout_marginEnd="2dp"
        android:background="@drawable/bg_send"
        android:contentDescription="@string/send"
        android:scaleType="center"
        android:src="@drawable/ic_send"
        android:visibility="invisible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        tools:ignore="MissingPrefix"
        tools:visibility="visible" />

    <!--
    <ImageButton
        android:id="@+id/voiceMessageMicButton"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:layout_marginEnd="12dp"
        android:layout_marginBottom="12dp"
        android:background="?android:attr/selectableItemBackground"
        android:contentDescription="@string/a11y_start_voice_message"
        android:src="@drawable/ic_voice_mic"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />
    -->

</androidx.constraintlayout.widget.ConstraintLayout>
