<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/contentView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="org.thoughtcrime.securesms.home.HomeActivity">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?colorPrimary"
        app:contentInsetStart="0dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <RelativeLayout
                android:id="@+id/session_toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:layout_marginLeft="20dp"
                android:layout_marginRight="20dp">

                <org.thoughtcrime.securesms.components.ProfilePictureView
                    android:id="@+id/profileButton"
                    android:layout_width="@dimen/small_profile_picture_size"
                    android:layout_height="@dimen/small_profile_picture_size"
                    android:layout_alignParentLeft="true"
                    android:layout_centerVertical="true"
                    android:layout_marginLeft="9dp"
                    android:contentDescription="@string/AccessibilityId_user_settings" />

                <org.thoughtcrime.securesms.home.PathStatusView
                    android:id="@+id/pathStatusView"
                    android:layout_width="@dimen/path_status_view_size"
                    android:layout_height="@dimen/path_status_view_size"
                    android:layout_alignEnd="@+id/profileButton"
                    android:layout_alignBottom="@+id/profileButton" />

                <ImageView
                    android:id="@+id/sessionHeaderImage"
                    android:layout_width="0dp"
                    android:layout_height="16dp"
                    android:layout_centerInParent="true"
                    android:layout_toLeftOf="@+id/searchViewContainer"
                    android:layout_toRightOf="@+id/profileButton"
                    android:scaleType="centerInside"
                    android:src="@drawable/ic_session"
                    app:tint="?sessionLogoTint" />

                <RelativeLayout
                    android:id="@+id/searchViewContainer"
                    android:background="?selectableItemBackgroundBorderless"
                    android:contentDescription="@string/AccessibilityId_search_icon"
                    android:layout_width="@dimen/small_profile_picture_size"
                    android:layout_height="@dimen/small_profile_picture_size"
                    android:layout_alignParentRight="true"
                    android:layout_centerVertical="true">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerInParent="true"
                        android:src="@drawable/ic_baseline_search_24"
                        app:tint="?sessionLogoTint" />

                </RelativeLayout>

            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/search_toolbar"
                android:layout_width="match_parent"
                android:layout_height="?actionBarSize"
                android:layout_marginHorizontal="@dimen/medium_spacing"
                android:visibility="gone">

                <org.thoughtcrime.securesms.home.search.GlobalSearchInputLayout
                    android:id="@+id/globalSearchInputLayout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true" />
            </RelativeLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="1px"
                android:background="?android:dividerHorizontal"
                android:elevation="1dp" />

            <androidx.compose.ui.platform.ComposeView
                tools:visibility="gone"
                android:id="@+id/seedReminderView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <FrameLayout
                tools:visibility="visible"
                android:visibility="gone"
                android:id="@+id/configOutdatedView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <TextView
                    android:layout_gravity="center"
                    android:textColor="?message_sent_text_color"
                    android:background="?colorAccent"
                    android:textSize="11sp"
                    android:paddingVertical="4dp"
                    android:paddingHorizontal="64dp"
                    android:gravity="center"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/activity_home_outdated_client_config"
                    />
                <ImageView
                    android:layout_margin="@dimen/small_spacing"
                    android:layout_gravity="center_vertical|right"
                    android:layout_width="12dp"
                    android:layout_height="12dp"
                    android:scaleType="centerInside"
                    android:src="@drawable/ic_x"
                    app:tint="@color/black" />
            </FrameLayout>

        </LinearLayout>

    </androidx.appcompat.widget.Toolbar>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipChildren="false"
        android:focusable="false">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clipToPadding="false"
            android:paddingBottom="172dp"
            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            tools:itemCount="6"
            tools:listitem="@layout/view_conversation" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/globalSearchRecycler"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="vertical"
            android:visibility="gone"
            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            tools:itemCount="6"
            tools:listitem="@layout/view_global_search_result" />

        <androidx.compose.ui.platform.ComposeView
            android:id="@+id/emptyStateContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone"/>

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/newConversationButton"
            android:contentDescription="@string/AccessibilityId_new_conversation_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:background="@drawable/new_conversation_button_background"
            android:layout_marginBottom="@dimen/new_conversation_button_bottom_offset"
            android:src="@drawable/ic_plus"
            app:tint="@color/white" />

    </RelativeLayout>

</LinearLayout>