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

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_scrollFlags="scroll|enterAlways"
            app:titleEnabled="false">

            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="?attr/colorPrimary"
                android:elevation="4dp"
                android:theme="?actionBarTheme"
                android:touchscreenBlocksFocus="false"
                app:layout_collapseMode="pin"
                app:popupTheme="@style/ThemeOverlay.AppCompat.DayNight"
                app:title="@string/app_name" />

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

                <LinearLayout
                    android:id="@+id/search_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <com.google.android.material.card.MaterialCardView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="4dp"
                        app:cardElevation="2dp">

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

                            <com.google.android.material.chip.Chip
                                android:id="@+id/show_system_apps"
                                style="@style/Widget.MaterialComponents.Chip.Filter"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginBottom="4dp"
                                android:text="@string/show_system_apps" />

                            <com.google.android.material.textfield.TextInputLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:hint="@string/search_apps">

                                <com.google.android.material.textfield.TextInputEditText
                                    android:id="@+id/search"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content" />

                            </com.google.android.material.textfield.TextInputLayout>


                        </LinearLayout>

                    </com.google.android.material.card.MaterialCardView>

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/hint_neko_plugin"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical">

                    <com.google.android.material.card.MaterialCardView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="8dp"
                        android:clickable="true"
                        android:focusable="true"
                        app:cardElevation="2dp">

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

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

                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginTop="16dp"
                                    android:text="@string/neko_plugin_summary"
                                    android:textAppearance="?attr/textAppearanceBody2"
                                    android:textColor="?android:attr/textColorSecondary" />

                            </LinearLayout>

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

                                <Button
                                    android:id="@+id/action_learn_more"
                                    style="@style/Widget.AppCompat.Button.Borderless"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginEnd="8dp"
                                    android:text="@string/action_learn_more"
                                    android:textColor="?primaryOrTextPrimary" />
                            </LinearLayout>

                        </LinearLayout>
                    </com.google.android.material.card.MaterialCardView>
                </LinearLayout>

            </LinearLayout>

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

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

    <LinearLayout
        android:id="@+id/loading"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:orientation="vertical">

        <com.google.android.material.progressindicator.CircularProgressIndicator
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:indeterminate="true" />

    </LinearLayout>

    <com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
        android:id="@+id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipToPadding="false"
        android:scrollbarSize="0dp"
        android:visibility="gone"
        app:fastScrollAutoHide="true"
        app:fastScrollPopupTextColor="?colorPrimary"
        app:fastScrollThumbColor="?colorPrimary"
        app:fastScrollThumbInactiveColor="?colorPrimary"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:listitem="@layout/layout_apps_item" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
