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

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/matrixProfileAppBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/matrixProfileCollapsingToolbarLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:contentScrim="?android:colorBackground"
            app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
            app:scrimAnimationDuration="250"
            app:scrimVisibleHeightTrigger="80dp"
            app:titleEnabled="false"
            app:toolbarId="@+id/matrixProfileToolbar">

            <ViewStub
                android:id="@+id/matrixProfileHeaderView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?android:colorBackground"
                android:orientation="vertical"
                app:layout_collapseMode="parallax"
                app:layout_collapseParallaxMultiplier="0.9" />

            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/matrixProfileToolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="@android:color/transparent"
                app:layout_collapseMode="pin">

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

                    <ImageView
                        android:id="@+id/matrixProfileToolbarAvatarImageView"
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        android:layout_marginTop="8dp"
                        android:layout_marginBottom="8dp"
                        android:alpha="0"
                        android:contentDescription="@string/avatar"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent"
                        tools:alpha="1"
                        tools:src="@sample/room_round_avatars" />

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

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

                </androidx.constraintlayout.widget.ConstraintLayout>

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

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

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

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

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

</androidx.coordinatorlayout.widget.CoordinatorLayout>