<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (c) 2023 to present Androidacy and contributors. Names, logos, icons, and the Androidacy name are all trademarks of Androidacy and may not be used without license. See LICENSE for more information.
  -->

<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:id="@+id/root_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_constraintTop_toTopOf="parent"
    tools:context=".MainActivity">

    <!-- FrameLayout is the best way to fix blurring -->
    <!-- search layout using textinputlayout and textinputedittext from material design in a linearlayout -->

    <com.google.android.material.progressindicator.LinearProgressIndicator
        android:id="@+id/progress_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        android:visibility="visible"
        app:hideAnimationBehavior="inward"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintBottom_toTopOf="parent"
        app:layout_constraintTop_toTopOf="@+id/search_input_layout"
        app:showAnimationBehavior="outward" />

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/search_input_layout"
        style="@style/ThemeOverlay.Material3.Search"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingHorizontal="16dp"
        android:paddingBottom="6dp"
        android:hint="@string/search"
        app:layout_constraintBottom_toTopOf="@id/swipe_refresh"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/search_input"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:enabled="true"
            android:inputType="text"
            android:maxLength="100"
            android:maxLines="1" />

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

    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
        android:id="@+id/swipe_refresh"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@id/bottom_navigation"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/search_input_layout">

        <FrameLayout
            android:id="@+id/blur_frame"
            android:layout_width="match_parent"
            android:paddingHorizontal="6dp"
            android:layout_height="0dp">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/module_list"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
            <!-- online modules -->
            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/module_list_online"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:visibility="gone" />
        </FrameLayout>

    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>



    <!-- reboot fab, floating to the left of the search bar -->
    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/reboot_fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="12dp"
        android:clickable="true"
        android:contentDescription="@string/reboot"
        android:focusable="true"
        android:src="@drawable/baseline_restart_alt_24"
        android:visibility="visible"
        app:layout_constraintBottom_toTopOf="@id/bottom_navigation"
        app:layout_constraintEnd_toEndOf="parent" />
    <!-- bottom md3 navigation bar -->
    <!-- used for local and remote module list -->
    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:visibility="visible"
        app:compatShadowEnabled="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:menu="@menu/bottom_nav_menu" />

</androidx.constraintlayout.widget.ConstraintLayout>