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

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

        <im.vector.app.core.ui.views.CurrentCallsView
            android:id="@+id/currentCallsView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="48dp"
            android:visibility="gone"
            app:layout_constraintTop_toBottomOf="@id/homeKeysBackupBanner"
            tools:visibility="visible" />

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

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:baselineAligned="false"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <RelativeLayout
                    android:id="@+id/groupToolbarAvatarImageView"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="8dp"
                    android:contentDescription="@string/a11y_open_drawer"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent">

                    <ImageView
                        android:layout_width="28dp"
                        android:layout_height="28dp"
                        android:layout_centerVertical="true"
                        android:layout_marginStart="4dp"
                        android:importantForAccessibility="no"
                        android:src="@drawable/ic_space_icons"
                        app:tint="?vctr_content_secondary"
                        tools:ignore="MissingPrefix" />

                    <im.vector.app.features.home.room.list.UnreadCounterBadgeView
                        android:id="@+id/drawerUnreadCounterBadgeView"
                        style="@style/Widget.Vector.TextView.Micro"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentTop="true"
                        android:layout_alignParentEnd="true"
                        android:layout_marginEnd="0dp"
                        android:gravity="center"
                        android:minWidth="16dp"
                        android:minHeight="16dp"
                        android:paddingStart="4dp"
                        android:paddingEnd="4dp"
                        android:textColor="?colorOnError"
                        android:visibility="gone"
                        tools:background="@drawable/bg_unread_highlight"
                        tools:text="4"
                        tools:visibility="visible" />

                </RelativeLayout>

                <LinearLayout
                    android:id="@+id/homeToolbarContent"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="start"
                    android:orientation="vertical"
                    android:paddingStart="8dp"
                    android:paddingEnd="8dp">

                    <TextView
                        android:id="@+id/groupToolbarTitleView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:ellipsize="end"
                        android:gravity="start"
                        android:maxLines="1"
                        android:textAppearance="@style/TextAppearance.Vector.Widget.ActionBarTitle"
                        android:textColor="?vctr_content_primary"
                        android:textStyle="bold"
                        tools:text="@tools:sample/lorem/random" />

                    <TextView
                        android:id="@+id/groupToolbarSpaceTitleView"
                        style="@style/TextAppearance.Vector.Widget.ActionBarSubTitle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:ellipsize="end"
                        android:gravity="start"
                        android:maxLines="1"
                        android:textColor="?vctr_content_primary"
                        android:visibility="gone"
                        tools:text="@tools:sample/lorem/random"
                        tools:visibility="visible" />

                </LinearLayout>

            </LinearLayout>

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

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

    <im.vector.app.features.sync.widget.SyncStateView
        android:id="@+id/syncStateView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/appBarLayout" />

    <im.vector.app.core.ui.views.KeysBackupBanner
        android:id="@+id/homeKeysBackupBanner"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:background="?vctr_keys_backup_banner_accent_color"
        android:minHeight="67dp"
        android:visibility="gone"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/syncStateView"
        tools:visibility="visible" />

    <androidx.fragment.app.FragmentContainerView
        android:id="@+id/roomListContainer"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@id/bottomNavigationView"
        app:layout_constraintTop_toBottomOf="@id/homeKeysBackupBanner" />

    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottomNavigationView"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:menu="@menu/home_bottom_navigation" />

</androidx.constraintlayout.widget.ConstraintLayout>
