<?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/rootConstraintLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?android:colorBackground">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.appbar.MaterialToolbar
            android:id="@+id/roomSettingsToolbar"
            android:layout_width="match_parent"
            android:layout_height="?actionBarSize">

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

                <ImageView
                    android:id="@+id/roomSettingsToolbarAvatarImageView"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="8dp"
                    android:importantForAccessibility="no"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:src="@sample/room_round_avatars" />

                <im.vector.app.core.ui.views.ShieldImageView
                    android:id="@+id/roomSettingsDecorationToolbarAvatarImageView"
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    app:layout_constraintCircle="@id/roomSettingsToolbarAvatarImageView"
                    app:layout_constraintCircleAngle="135"
                    app:layout_constraintCircleRadius="20dp"
                    tools:ignore="MissingConstraints" />

                <TextView
                    android:id="@+id/roomSettingsToolbarTitleView"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:layout_marginEnd="8dp"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:textAppearance="@style/TextAppearance.Vector.Widget.ActionBarTitle"
                    android:textColor="?vctr_content_primary"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@id/roomSettingsToolbarAvatarImageView"
                    app:layout_constraintTop_toTopOf="parent"
                    tools:text="@sample/rooms.json/data/name" />

            </androidx.constraintlayout.widget.ConstraintLayout>

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

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

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/coordinatorLayout"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/appBarLayout">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/roomSettingsRecyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:overScrollMode="always"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            tools:listitem="@layout/item_profile_action" />

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/searchViewAppBarLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:elevation="4dp"
            android:visibility="gone"
            tools:visibility="visible">

            <!-- Use an extra container for the margin to be taken into account by the layout_scrollFlags -->
            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_scrollFlags="scroll|enterAlways|snap">

                <androidx.appcompat.widget.SearchView
                    android:id="@+id/searchView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:layout_marginBottom="4dp"
                    android:background="@null"
                    android:minHeight="0dp"
                    tools:queryHint="@string/search_hint" />

            </FrameLayout>

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

        <!-- Trick to remove surrounding padding (clip from wrapping frame) -->
        <FrameLayout
            android:id="@+id/progressBar"
            android:layout_width="match_parent"
            android:layout_height="3dp"
            android:elevation="8dp"
            android:visibility="gone"
            app:layout_constraintTop_toBottomOf="@id/appBarLayout"
            tools:visibility="visible">

            <ProgressBar
                style="@style/Widget.Vector.ProgressBar.Horizontal"
                android:layout_width="match_parent"
                android:layout_height="14dp"
                android:layout_gravity="center"
                android:indeterminate="true" />

        </FrameLayout>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <include
        android:id="@+id/waiting_view"
        layout="@layout/merge_overlay_waiting_view" />

</androidx.constraintlayout.widget.ConstraintLayout>
