<?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"
    android:id="@+id/categoryPage_drawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

        <!-- 左侧返回按钮和推荐标题 -->
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <ImageView
                android:id="@+id/categoryPage_back"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:padding="4dp"
                android:src="@drawable/return1" />

        </LinearLayout>

        <!-- 标题 -->
        <TextView
            android:id="@+id/categoryPage_title"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center"
            android:text="文学"
            android:textSize="25dp"
            android:textColor="@color/black"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toTopOf="@id/categoryPage_swipeRefresh"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent" />

    </LinearLayout>

    <!-- 主内容区域 -->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="50dp">

        <!-- SwipeRefreshLayout 包裹的 RecyclerView -->
        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
            android:id="@+id/categoryPage_swipeRefresh"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toTopOf="@id/layout_bottom_navigation"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/categoryPage_recyclerView"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

        <!-- 底部导航栏 -->
        <include
            layout="@layout/layout_bottom_navigation"
            android:id="@+id/layout_bottom_navigation"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <!-- 导航栏 -->
    <com.google.android.material.navigation.NavigationView
        android:id="@+id/categoryPage_navView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:headerLayout="@layout/nav_header"
        app:menu="@menu/nav_menu" />

</androidx.drawerlayout.widget.DrawerLayout>
