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

    <org.fossify.commons.views.MySearchMenu
        android:id="@+id/main_menu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <RelativeLayout
        android:id="@+id/main_nested_scrollview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fillViewport="true"
        android:scrollbars="none"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <androidx.coordinatorlayout.widget.CoordinatorLayout
            android:id="@+id/main_coordinator_wrapper"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <RelativeLayout
                android:id="@+id/main_holder"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <com.google.android.material.progressindicator.LinearProgressIndicator
                    android:id="@+id/conversations_progress_bar"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentTop="true"
                    android:indeterminate="true"
                    android:visibility="gone"
                    app:hideAnimationBehavior="outward"
                    app:showAnimationBehavior="inward"
                    app:showDelay="250"
                    tools:visibility="visible" />

                <org.fossify.commons.views.MyTextView
                    android:id="@+id/no_conversations_placeholder"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="@dimen/bigger_margin"
                    android:alpha="0.8"
                    android:gravity="center"
                    android:paddingLeft="@dimen/activity_margin"
                    android:paddingRight="@dimen/activity_margin"
                    android:text="@string/no_conversations_found"
                    android:textSize="@dimen/bigger_text_size"
                    android:textStyle="italic"
                    android:visibility="gone" />

                <org.fossify.commons.views.MyTextView
                    android:id="@+id/no_conversations_placeholder_2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/no_conversations_placeholder"
                    android:layout_centerHorizontal="true"
                    android:background="@drawable/ripple_all_corners"
                    android:gravity="center"
                    android:padding="@dimen/activity_margin"
                    android:text="@string/start_conversation"
                    android:textSize="@dimen/bigger_text_size"
                    android:visibility="gone" />

                <com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
                    android:id="@+id/conversations_fastscroller"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <org.fossify.commons.views.MyRecyclerView
                        android:id="@+id/conversations_list"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:clipToPadding="false"
                        android:layoutAnimation="@anim/layout_animation"
                        android:overScrollMode="ifContentScrolls"
                        android:scrollbars="none"
                        app:layoutManager="org.fossify.commons.views.MyLinearLayoutManager" />

                </com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
            </RelativeLayout>
        </androidx.coordinatorlayout.widget.CoordinatorLayout>

        <RelativeLayout
            android:id="@+id/search_holder"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:alpha="0"
            android:visibility="gone">

            <org.fossify.commons.views.MyTextView
                android:id="@+id/search_placeholder"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="@dimen/activity_margin"
                android:alpha="0.8"
                android:gravity="center"
                android:paddingStart="@dimen/activity_margin"
                android:paddingEnd="@dimen/activity_margin"
                android:text="@string/no_items_found"
                android:textSize="@dimen/bigger_text_size"
                android:textStyle="italic" />

            <org.fossify.commons.views.MyTextView
                android:id="@+id/search_placeholder_2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/search_placeholder"
                android:layout_centerHorizontal="true"
                android:alpha="0.8"
                android:gravity="center"
                android:paddingStart="@dimen/activity_margin"
                android:paddingTop="@dimen/medium_margin"
                android:paddingEnd="@dimen/activity_margin"
                android:paddingBottom="@dimen/medium_margin"
                android:text="@string/type_2_characters"
                android:textSize="@dimen/bigger_text_size"
                android:textStyle="italic" />

            <org.fossify.commons.views.MyRecyclerView
                android:id="@+id/search_results_list"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:clipToPadding="false"
                android:scrollbars="vertical"
                app:layoutManager="org.fossify.commons.views.MyLinearLayoutManager" />

        </RelativeLayout>
    </RelativeLayout>

    <org.fossify.commons.views.MyFloatingActionButton
        android:id="@+id/conversations_fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/activity_margin"
        android:src="@drawable/ic_plus_vector"
        app:applyWindowInsets="true" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
