<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 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/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/coordinatorLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".ui.main.MainActivity">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appBarLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?android:windowBackground"
            android:fitsSystemWindows="true">

            <com.google.android.material.search.SearchBar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:menu="@menu/main_menu"
                app:navigationIcon="@drawable/ic_arrow_back_24dp" />

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

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">

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

                <com.google.android.material.tabs.TabLayout
                    android:id="@+id/stackTitles"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:background="@null"
                    app:tabGravity="center"
                    app:tabMode="fixed" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/list_menu_button"
                    style="@style/Widget.Material3.Button.IconButton"
                    android:layout_width="48dp"
                    android:layout_height="match_parent"
                    android:contentDescription="@string/add_list"
                    android:foreground="?attr/selectableItemBackgroundBorderless"
                    android:tooltipText="@string/manage_list"
                    app:icon="@drawable/ic_menu"
                    app:iconTint="?attr/colorOnSurface"
                    tools:ignore="UnusedAttribute" />
            </LinearLayout>

            <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
                android:id="@+id/swipe_refresh_layout"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

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

                    <LinearLayout
                        android:id="@+id/info_box"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal|bottom"
                        android:background="?attr/colorSurfaceVariant"
                        android:gravity="center"
                        android:padding="@dimen/spacer_1hx"
                        android:visibility="gone"
                        tools:visibility="visible">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:drawablePadding="@dimen/spacer_1hx"
                            android:gravity="center"
                            android:paddingHorizontal="@dimen/spacer_1hx"
                            android:text="@string/info_box_maintenance_mode"
                            android:textColor="?attr/colorOnSurfaceVariant"
                            app:drawableStartCompat="@drawable/ic_info_outline_24dp" />

                    </LinearLayout>

                    <TextView
                        android:id="@+id/info_box_version_not_supported"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="?attr/colorError"
                        android:drawablePadding="@dimen/spacer_1hx"
                        android:gravity="center"
                        android:paddingHorizontal="@dimen/spacer_2x"
                        android:paddingVertical="@dimen/spacer_1x"
                        android:text="@string/info_box_version_not_supported"
                        android:textColor="?attr/colorOnError"
                        android:textSize="14sp"
                        android:visibility="gone"
                        app:drawableStartCompat="@drawable/ic_warning_24dp"
                        app:drawableTint="?attr/colorOnError"
                        tools:visibility="visible" />

                    <it.niedermann.nextcloud.deck.ui.view.EmptyContentView
                        android:id="@+id/empty_content_view_boards"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:visibility="gone"
                        app:description="@string/add_a_new_board_using_the_button"
                        app:title="@string/no_boards" />

                    <it.niedermann.nextcloud.deck.ui.view.EmptyContentView
                        android:id="@+id/empty_content_view_stacks"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:visibility="gone"
                        app:description="@string/add_a_new_list_using_the_button"
                        app:title="@string/no_lists_yet"
                        tools:visibility="visible" />

                    <androidx.viewpager2.widget.ViewPager2
                        android:id="@+id/viewPager"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />
                </LinearLayout>
            </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
        </LinearLayout>

        <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
            android:id="@+id/fab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_margin="@dimen/fab_margin"
            android:text="@string/add_card"
            android:visibility="gone"
            app:icon="@drawable/ic_add_24dp"
            tools:visibility="visible" />

        <com.google.android.material.search.SearchView
            android:id="@+id/search_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:hint="@string/simple_search"
            app:layout_anchor="@id/toolbar"
            app:useDrawerArrowDrawable="true">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/search_results"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                tools:itemCount="10"
                tools:listitem="@layout/item_search_card" />

            <it.niedermann.nextcloud.deck.ui.view.EmptyContentView
                android:id="@+id/empty_content_view_search_no_term"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:visibility="gone"
                app:description="@string/enter_search_term_description"
                app:image="@drawable/ic_search_24"
                app:title="@string/enter_search_term_title" />

            <it.niedermann.nextcloud.deck.ui.view.EmptyContentView
                android:id="@+id/empty_content_view_search_no_results"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:visibility="gone"
                app:description="@string/no_search_results_description"
                app:image="@drawable/ic_search_24"
                app:title="@string/no_search_results_title" />
        </com.google.android.material.search.SearchView>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <com.google.android.material.navigation.NavigationView
        android:id="@+id/navigationView"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        android:theme="@style/NavigationView"
        app:headerLayout="@layout/nav_header_main"
        app:itemRippleColor="?attr/colorControlHighlight"
        app:itemShapeFillColor="@drawable/bg_navdrawer_item"
        app:itemTextColor="?attr/colorOnSurface" />

</androidx.drawerlayout.widget.DrawerLayout>
