<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activityChat"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:elevation="@dimen/actionbar_elevation"
            app:layout_collapseMode="pin"
            app:layout_constraintTop_toTopOf="parent">
            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                >
                <ImageView
                    android:id="@+id/chatAvatar"
                    android:layout_width="?attr/actionBarSize"
                    android:layout_height="?attr/actionBarSize"
                    android:padding="8dp"
                    android:contentDescription="@string/action_view_profile"
                    android:importantForAccessibility="no"
                    android:scaleType="centerCrop"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:src="@drawable/avatar_default" />
                <androidx.emoji.widget.EmojiTextView
                    android:id="@+id/chatTitle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:importantForAccessibility="no"
                    android:maxLines="1"
                    android:paddingEnd="@dimen/status_display_name_padding_end"
                    android:textColor="?android:textColorPrimary"
                    android:textSize="?attr/status_text_large"
                    android:textStyle="normal|bold"
                    tools:text="Ente r the void you foooooo" />
                <TextView
                    android:id="@+id/chatUsername"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:importantForAccessibility="no"
                    android:maxLines="1"
                    android:textColor="?android:textColorSecondary"
                    android:textSize="?attr/status_text_large"
                    tools:text="\@Entenhausen@birbsarecooooooooooool.site" />
            </androidx.appcompat.widget.Toolbar>
        </com.google.android.material.appbar.AppBarLayout>
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recycler"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:layout_constraintBottom_toTopOf="@+id/composeLayout"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/appbar" />
        <ProgressBar
            android:id="@+id/progressBar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone"
            app:layout_constraintBottom_toTopOf="@+id/composeLayout"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:visibility="visible" />
        <com.keylesspalace.tusky.view.BackgroundMessageView
            android:id="@+id/messageView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone"
            app:layout_constraintBottom_toTopOf="@+id/composeLayout"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/appbar"
            tools:visibility="visible"
            app:layout_constrainedHeight="true" />
        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/composeLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:background="?attr/colorSurface"
            android:animateLayoutChanges="true"
            android:paddingTop="4dp"
            android:paddingBottom="4dp"
            app:layout_constraintTop_toBottomOf="@+id/recycler"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintBottom_toBottomOf="parent">
            <FrameLayout
                android:id="@+id/attachmentLayout"
                android:layout_width="@dimen/compose_media_preview_size"
                android:layout_height="@dimen/compose_media_preview_size"
                android:layout_margin="@dimen/compose_media_preview_margin_bottom"
                android:visibility="gone"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintLeft_toLeftOf="parent"
                tools:visibility="visible">
                <com.keylesspalace.tusky.components.compose.view.ProgressImageView
                    android:id="@+id/imageAttachment"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:visibility="gone"
                    tools:visibility="visible" />
                <com.keylesspalace.tusky.components.compose.view.ProgressTextView
                    android:id="@+id/textAttachment"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:visibility="gone"
                    android:ellipsize="marquee"
                    android:marqueeRepeatLimit="-1"
                    android:singleLine="true"
                    android:textSize="?attr/status_text_small"
                    tools:visibility="visible" />
            </FrameLayout>
            <ImageButton
                android:id="@+id/attachmentButton"
                style="@style/TuskyImageButton"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:layout_marginEnd="4dp"
                android:contentDescription="@string/action_add_media"
                android:tooltipText="@string/action_add_media"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@id/attachmentLayout"
                app:srcCompat="@drawable/ic_attach_file_24dp" />
            <com.keylesspalace.tusky.components.compose.view.EditTextTyped
                android:id="@+id/editText"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:textSize="?attr/status_text_large"
                android:singleLine="false"
                android:background="@null"
                android:completionThreshold="2"
                android:dropDownWidth="wrap_content"
                android:hint="@string/hint_compose"
                android:inputType="text|textMultiLine|textCapSentences"
                android:lineSpacingMultiplier="1.1"
                android:textColorHint="?android:attr/textColorTertiary"
                app:layout_constraintEnd_toStartOf="@+id/emojiButton"
                app:layout_constraintStart_toEndOf="@+id/attachmentButton"
                app:layout_constraintTop_toBottomOf="@id/attachmentLayout"
                app:layout_constraintBottom_toBottomOf="parent"
                tools:text="Just landed in L.A." />
            <ImageButton
                android:id="@+id/emojiButton"
                style="@style/TuskyImageButton"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:contentDescription="@string/action_emoji_keyboard"
                android:tooltipText="@string/action_emoji_keyboard"
                app:srcCompat="@drawable/ic_emoji_24dp"
                app:layout_constraintTop_toBottomOf="@id/attachmentLayout"
                app:layout_constraintRight_toLeftOf="@id/stickerButton"
                />
            <ImageButton
                android:id="@+id/stickerButton"
                style="@style/TuskyImageButton"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:contentDescription="@string/action_sticker"
                android:tooltipText="@string/action_sticker"
                app:srcCompat="@drawable/ic_sticker"
                app:layout_constraintTop_toBottomOf="@id/attachmentLayout"
                app:layout_constraintRight_toLeftOf="@id/sendButton"
                />
            <ImageButton
                android:id="@+id/sendButton"
                style="@style/TuskyImageButton"
                android:layout_width="48dp"
                android:layout_height="48dp"
                android:contentDescription="@string/action_send"
                android:tooltipText="@string/action_send"
                app:srcCompat="@drawable/ic_send_24dp"
                app:layout_constraintTop_toBottomOf="@id/attachmentLayout"
                app:layout_constraintRight_toRightOf="parent"
                />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/emojiView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorSurface"
        android:clipToPadding="false"
        android:elevation="12dp"
        android:orientation="vertical"
        android:paddingStart="16dp"
        android:paddingTop="8dp"
        android:paddingEnd="16dp"
        app:behavior_hideable="true"
        app:behavior_peekHeight="0dp"
        app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" />

    <com.keylesspalace.tusky.view.EmojiKeyboard
        android:id="@+id/stickerKeyboard"
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:background="?attr/colorSurface"
        android:elevation="12dp"
        app:behavior_hideable="true"
        app:behavior_peekHeight="0dp"
        app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" />

    <LinearLayout
        android:id="@+id/addMediaBottomSheet"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorSurface"
        android:elevation="12dp"
        android:orientation="vertical"
        android:paddingStart="16dp"
        android:paddingTop="8dp"
        android:paddingEnd="16dp"
        app:behavior_hideable="true"
        app:behavior_peekHeight="0dp"
        app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

        <TextView
            android:id="@+id/actionPhotoTake"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:drawablePadding="8dp"
            android:padding="8dp"
            android:text="@string/action_photo_take"
            android:textSize="?attr/status_text_medium" />

        <TextView
            android:id="@+id/actionPhotoPick"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:drawablePadding="8dp"
            android:padding="8dp"
            android:text="@string/action_add_media"
            android:textSize="?attr/status_text_medium" />

    </LinearLayout>

    <include layout="@layout/item_status_bottom_sheet" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>