<?xml version="1.0" encoding="utf-8"?>
|
<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:layout_width="match_parent"
|
android:layout_height="match_parent"
|
tools:context=".ui.dashboard.DashboardFragment">
|
|
<!-- 时间范围选择器 -->
|
<com.google.android.material.tabs.TabLayout
|
android:id="@+id/tab_date_range"
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
app:layout_constraintTop_toTopOf="parent">
|
|
<com.google.android.material.tabs.TabItem
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="天" />
|
|
<com.google.android.material.tabs.TabItem
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="周" />
|
|
<com.google.android.material.tabs.TabItem
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="月" />
|
|
<com.google.android.material.tabs.TabItem
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="年" />
|
</com.google.android.material.tabs.TabLayout>
|
|
<!-- 日期选择器 -->
|
<LinearLayout
|
android:id="@+id/layout_date_picker"
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
android:padding="16dp"
|
app:layout_constraintTop_toBottomOf="@id/tab_date_range">
|
|
<ImageButton
|
android:id="@+id/btn_previous_date"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:background="?attr/selectableItemBackground"
|
android:src="@android:drawable/ic_media_previous" />
|
|
<TextView
|
android:id="@+id/text_current_date"
|
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
android:layout_weight="1"
|
android:gravity="center"
|
android:textSize="16sp"
|
tools:text="2025年1月14日" />
|
|
<ImageButton
|
android:id="@+id/btn_next_date"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:background="?attr/selectableItemBackground"
|
android:src="@android:drawable/ic_media_next" />
|
</LinearLayout>
|
|
<!-- 包裹统计卡片 -->
|
<LinearLayout
|
android:id="@+id/card_package_stats_title"
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
app:layout_constraintTop_toBottomOf="@id/layout_date_picker"
|
>
|
<TextView
|
android:id="@+id/card_package_stats_title_text"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="本日收到包裹总数 ->"
|
android:layout_marginLeft="16dp"
|
>
|
|
</TextView>
|
</LinearLayout>
|
<androidx.cardview.widget.CardView
|
android:id="@+id/card_package_stats"
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:layout_margin="16dp"
|
app:cardCornerRadius="8dp"
|
app:cardElevation="4dp"
|
app:layout_constraintTop_toBottomOf="@id/card_package_stats_title">
|
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
android:padding="16dp"
|
android:weightSum="3">
|
|
<LinearLayout
|
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
android:layout_weight="1"
|
android:gravity="center">
|
|
<ImageView
|
android:layout_width="48dp"
|
android:layout_height="48dp"
|
android:src="@drawable/resource_package" />
|
</LinearLayout>
|
|
<Space
|
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
android:layout_weight="1" />
|
|
<LinearLayout
|
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
android:layout_weight="1"
|
android:gravity="center">
|
|
<TextView
|
android:id="@+id/text_package_count"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:textSize="24sp"
|
android:textStyle="bold"
|
tools:text="4个" />
|
</LinearLayout>
|
|
</LinearLayout>
|
</androidx.cardview.widget.CardView>
|
|
|
<!-- 年度统计布局 -->
|
<include
|
android:id="@+id/layout_year_stats"
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:visibility="gone"
|
app:layout_constraintTop_toBottomOf="@id/card_package_stats"
|
layout="@layout/layout_year_stats" />
|
|
<!-- 包裹列表和统计图表 -->
|
<androidx.core.widget.NestedScrollView
|
android:layout_width="match_parent"
|
android:layout_height="0dp"
|
android:fillViewport="true"
|
app:layout_constraintTop_toBottomOf="@id/layout_year_stats"
|
app:layout_constraintBottom_toBottomOf="parent">
|
|
<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">
|
<ViewFlipper
|
android:id="@+id/view_flipper_stats"
|
android:layout_width="match_parent"
|
android:layout_height="match_parent">
|
|
<!-- 日视图 -->
|
<LinearLayout
|
android:id="@+id/recycler_packages_11"
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:orientation="vertical"
|
>
|
<LinearLayout
|
android:id="@+id/layout_year_stats_title"
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
app:layout_constraintTop_toBottomOf="@id/card_package_stats"
|
>
|
<TextView
|
android:id="@+id/layout_year_stats_title_text"
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="包裹取件码记录 ->"
|
android:layout_margin="16dp"
|
>
|
|
</TextView>
|
</LinearLayout>
|
|
<androidx.recyclerview.widget.RecyclerView
|
android:id="@+id/recycler_packages"
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
android:clipToPadding="false"
|
android:paddingBottom="16dp" />
|
|
</LinearLayout>
|
|
|
|
<!-- 周视图 -->
|
<include
|
android:id="@+id/layout_week_stats"
|
layout="@layout/layout_week_stats"
|
android:layout_width="match_parent"
|
android:layout_height="wrap_content" />
|
|
</ViewFlipper>
|
</LinearLayout>
|
<LinearLayout
|
android:layout_width="match_parent"
|
android:layout_height="80dp" />
|
|
</LinearLayout>
|
|
</androidx.core.widget.NestedScrollView>
|
|
<!-- 🔹 遮罩层 -->
|
<View
|
android:id="@+id/view_overlay"
|
android:layout_width="match_parent"
|
android:layout_height="match_parent"
|
android:background="@mipmap/overlay2"
|
android:elevation="10dp"
|
android:visibility="gone"
|
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent" />
|
|
<!-- 🔹 遮罩层上的按钮 -->
|
<!-- 🔹 遮罩层上的内容容器(LinearLayout) -->
|
<LinearLayout
|
android:id="@+id/overlay_content"
|
android:layout_width="300dp"
|
android:layout_height="wrap_content"
|
android:gravity="center"
|
android:orientation="horizontal"
|
android:padding="10dp"
|
android:background="@drawable/overlay_black_background"
|
android:elevation="20dp"
|
android:translationZ="20dp"
|
android:visibility="gone"
|
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintEnd_toEndOf="parent">
|
|
|
<ImageView
|
android:id="@+id/overlay_content_vip_image"
|
android:layout_width="40dp"
|
android:layout_height="40dp"
|
android:layout_marginLeft="10dp"
|
android:layout_marginRight="10dp"
|
android:scaleType="centerCrop"
|
android:src="@mipmap/vip_crown"
|
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
|
<!-- 🔹 示例内容:标题 -->
|
<TextView
|
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
android:text="免费查看统计数据"
|
android:textSize="18sp"
|
android:textColor="#EEBC93" />
|
|
</LinearLayout>
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|