<?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">

    <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_room_to_add_in_space" />

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

        <!-- 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:title="@string/space_add_existing_rooms"/>

        <androidx.appcompat.widget.SearchView
            android:id="@+id/publicRoomsFilter"
            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" />

        <Button
            android:id="@+id/createNewRoom"
            style="@style/Widget.Vector.Button.Text"
            android:layout_width="wrap_content"
            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/create_new_room"
            app:icon="@drawable/ic_plus_circle"
            app:iconPadding="13dp"
            app:iconTint="?colorPrimary"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/addRoomToSpaceToolbar"
            tools:ignore="MissingPrefix" />

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

</androidx.coordinatorlayout.widget.CoordinatorLayout>