<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/createDirectRoomToolbar"
            style="@style/VectorToolbarStyle"
            android:layout_width="0dp"
            android:layout_height="?actionBarSize"
            android:elevation="4dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <ImageView
                    android:id="@+id/createDirectRoomClose"
                    android:layout_width="@dimen/layout_touch_size"
                    android:layout_height="@dimen/layout_touch_size"
                    android:clickable="true"
                    android:focusable="true"
                    android:foreground="?attr/selectableItemBackground"
                    android:scaleType="center"
                    android:src="@drawable/ic_x_18dp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/createDirectRoomTitle"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:layout_marginEnd="8dp"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:text="@string/fab_menu_create_chat"
                    android:textColor="?riotx_text_primary"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintHorizontal_bias="0.0"
                    app:layout_constraintStart_toEndOf="@+id/createDirectRoomClose"
                    app:layout_constraintTop_toTopOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>

        </androidx.appcompat.widget.Toolbar>

        <im.vector.riotx.core.platform.MaxHeightScrollView
            android:id="@+id/chipGroupScrollView"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/layout_horizontal_margin"
            android:layout_marginTop="8dp"
            android:layout_marginEnd="@dimen/layout_horizontal_margin"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/createDirectRoomToolbar"
            app:maxHeight="64dp">

            <com.google.android.material.chip.ChipGroup
                android:id="@+id/chipGroup"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:lineSpacing="2dp" />

        </im.vector.riotx.core.platform.MaxHeightScrollView>

        <EditText
            android:id="@+id/createDirectRoomFilter"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/layout_horizontal_margin"
            android:layout_marginEnd="@dimen/layout_horizontal_margin"
            android:background="@null"
            android:drawablePadding="8dp"
            android:gravity="center_vertical"
            android:hint="@string/direct_room_filter_hint"
            android:importantForAutofill="no"
            android:maxHeight="80dp"
            android:paddingTop="16dp"
            android:paddingBottom="16dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/chipGroupScrollView" />

        <View
            android:id="@+id/createDirectRoomFilterDivider"
            android:layout_width="0dp"
            android:layout_height="1dp"
            android:background="?attr/vctr_list_divider_color"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/createDirectRoomFilter" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/addByMatrixId"
            style="@style/VectorButtonStyleFlat"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="8dp"
            android:minHeight="@dimen/layout_touch_size"
            android:text="@string/add_by_matrix_id"
            android:visibility="visible"
            app:icon="@drawable/ic_plus_circle"
            app:iconPadding="13dp"
            app:iconTint="@color/riotx_accent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/createDirectRoomFilterDivider" />

        <com.airbnb.epoxy.EpoxyRecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:fastScrollEnabled="true"
            android:scrollbars="vertical"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/addByMatrixId"
            tools:listitem="@layout/item_create_direct_room_user" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>

