<?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:id="@+id/coordinatorLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?android:colorBackground">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/roomList"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="?android:colorBackground"
        android:overScrollMode="always"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:listitem="@layout/item_profile_matrix_item" />

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="4dp">

        <!-- minHeight="0dp" is important to collapse on scroll -->
        <com.google.android.material.appbar.MaterialToolbar
            android:id="@+id/addRoomToSpaceToolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:minHeight="0dp"
            app:layout_scrollFlags="scroll|exitUntilCollapsed|snap|enterAlways">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|start"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/appBarTitle"
                    style="@style/Widget.Vector.TextView.HeadlineMedium"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="8dp"
                    android:ellipsize="end"
                    android:gravity="start|center"
                    android:maxLines="1"
                    android:textColor="?vctr_content_primary"
                    android:textStyle="bold"
                    tools:text="@tools:sample/lorem/random" />

                <TextView
                    android:id="@+id/appBarSpaceInfo"
                    style="@style/Widget.Vector.TextView.Subtitle"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="8dp"
                    android:ellipsize="end"
                    android:gravity="start|center"
                    android:maxLines="1"
                    android:textColor="?vctr_content_secondary"
                    tools:text="@tools:sample/lorem/random" />

            </LinearLayout>

        </com.google.android.material.appbar.MaterialToolbar>


        <androidx.appcompat.widget.SearchView
            android:id="@+id/memberNameFilter"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="8dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/addRoomToSpaceToolbar"
            app:queryHint="@string/search_hint_room_name" />

    </com.google.android.material.appbar.AppBarLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>