<?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/sendMessageContainer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.google.android.material.appbar.MaterialToolbar
        android:id="@+id/sendMessageToolbar"
        style="@style/Widget.MaterialComponents.Toolbar.Surface"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="4dp"
        app:layout_constraintBottom_toTopOf="@id/sendMessageScroll"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <io.github.wulkanowy.materialchipsinput.ConsumedNestedScrollView
        android:id="@+id/sendMessageScroll"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:fillViewport="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/sendMessageToolbar">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/sendMessageContent"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <TextView
                    android:id="@+id/sendMessageFromHint"
                    android:layout_width="wrap_content"
                    android:layout_height="58dp"
                    android:layout_marginStart="16dp"
                    android:layout_marginLeft="16dp"
                    android:gravity="center_vertical"
                    android:text="@string/message_from"
                    android:textColor="?android:textColorHint"
                    android:textSize="18sp"
                    app:layout_constraintEnd_toStartOf="@id/sendMessageFrom"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/sendMessageFrom"
                    android:layout_width="0dp"
                    android:layout_height="58dp"
                    android:layout_marginStart="8dp"
                    android:background="?selectableItemBackground"
                    android:gravity="center_vertical"
                    android:paddingStart="8dp"
                    android:paddingEnd="32dp"
                    android:textSize="18sp"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@id/sendMessageFromHint"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:text="Jan Kowalski" />

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="16dp"
                    android:rotation="270"
                    android:src="@drawable/ic_chevron_left"
                    app:layout_constraintBottom_toBottomOf="@id/sendMessageFrom"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toTopOf="@id/sendMessageFrom"
                    app:tint="?android:textColorSecondary"
                    tools:ignore="ContentDescription" />

                <View
                    android:id="@+id/sendMessageFromDivider"
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="?colorDivider"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/sendMessageFrom" />

                <TextView
                    android:id="@+id/sendMessageToHint"
                    android:layout_width="wrap_content"
                    android:layout_height="58dp"
                    android:layout_marginStart="16dp"
                    android:layout_marginLeft="16dp"
                    android:gravity="center_vertical"
                    android:text="@string/message_to"
                    android:textColor="?android:textColorHint"
                    android:textSize="18sp"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/sendMessageFromDivider" />

                <io.github.wulkanowy.materialchipsinput.MaterialChipInput
                    android:id="@+id/sendMessageTo"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="16dp"
                    android:layout_marginLeft="16dp"
                    android:layout_marginEnd="16dp"
                    android:layout_marginRight="16dp"
                    android:paddingTop="13dp"
                    android:paddingBottom="13dp"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@id/sendMessageToHint"
                    app:layout_constraintTop_toBottomOf="@id/sendMessageFromDivider" />

                <View
                    android:id="@+id/sendMessageToDivider"
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="?colorDivider"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/sendMessageTo" />

                <EditText
                    android:id="@+id/sendMessageSubject"
                    android:layout_width="match_parent"
                    android:layout_height="58dp"
                    android:layout_marginLeft="16dp"
                    android:layout_marginRight="16dp"
                    android:background="@android:color/transparent"
                    android:gravity="center_vertical"
                    android:hint="@string/message_subject"
                    android:imeOptions="flagNoExtractUi"
                    android:importantForAutofill="no"
                    android:inputType="text"
                    android:maxLines="1"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/sendMessageToDivider"
                    tools:targetApi="o" />

                <View
                    android:id="@+id/sendMessageSubjectDivider"
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="?colorDivider"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/sendMessageSubject" />

                <EditText
                    android:id="@+id/sendMessageMessageContent"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@android:color/transparent"
                    android:gravity="start"
                    android:hint="@string/message_content"
                    android:imeOptions="flagNoExtractUi"
                    android:importantForAutofill="no"
                    android:inputType="textMultiLine|textCapSentences"
                    android:minHeight="58dp"
                    android:paddingStart="16dp"
                    android:paddingLeft="16dp"
                    android:paddingTop="16dp"
                    android:paddingEnd="16dp"
                    android:paddingRight="16dp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/sendMessageSubjectDivider"
                    app:layout_constraintVertical_bias="0.0"
                    tools:targetApi="o" />
            </androidx.constraintlayout.widget.ConstraintLayout>
        </FrameLayout>
    </io.github.wulkanowy.materialchipsinput.ConsumedNestedScrollView>

    <LinearLayout
        android:id="@+id/sendMessageEmpty"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/sendMessageToolbar"
        tools:ignore="UseCompoundDrawables">

        <ImageView
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_gravity="center_horizontal"
            app:srcCompat="@drawable/ic_more_messages"
            app:tint="?colorOnBackground"
            tools:ignore="ContentDescription" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="@string/error_unknown"
            android:textSize="20sp"
            tools:text="No messages" />
    </LinearLayout>

    <com.google.android.material.progressindicator.CircularProgressIndicator
        android:id="@+id/sendMessageProgress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/sendMessageToolbar" />
</androidx.constraintlayout.widget.ConstraintLayout>
