From cb99bd7dad1b305a434c5c6c99ca65e782eb0f34 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期五, 11 四月 2025 17:32:12 +0800
Subject: [PATCH] add: 消息提醒

---
 app/src/main/res/layout/fragment_home.xml |  310 ++++++++++++++++++++++++++-------------------------
 1 files changed, 159 insertions(+), 151 deletions(-)

diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml
index 5df2603..bcfa7d8 100644
--- a/app/src/main/res/layout/fragment_home.xml
+++ b/app/src/main/res/layout/fragment_home.xml
@@ -1,186 +1,194 @@
 <?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
-<!--    LinearLayout的作用是按照垂直或者水平方向排列其子视图-->
-<!--    CardView组件是用于实现卡片式布局-->
-<!--    RecyclerView 回收商视图 它使用适配器(Adapter)来管理数据的显示,-->
-<!--    开发者可以根据自己的需求实现适配器的方法,将数据与视图进行绑定。-->
-<!--    这使得 RecyclerView 能够轻松地处理各种类型的数据,并按照自定义的布局方式展示。-->
-<!--    支持局部刷新 通知数据集变化-->
-    <LinearLayout
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical">
-
-        <!-- 顶部广告位 -->
-        <androidx.cardview.widget.CardView
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            app:cardCornerRadius="8dp"
-            app:cardElevation="2dp">
-            
-            <ImageView
-                android:id="@+id/adBanner"
-                android:layout_width="match_parent"
-                android:layout_height="80dp"
-                android:scaleType="centerCrop"/>
-        </androidx.cardview.widget.CardView>
-
-        <!-- 快递/财务切换区域 -->
+        android:layout_height="match_parent"
+        android:layout_marginTop="0dp"> <!-- 留出顶部广告位的高度 -->
+        >
+        <!--    LinearLayout的作用是按照垂直或者水平方向排列其子视图-->
+        <!--    CardView组件是用于实现卡片式布局-->
+        <!--    RecyclerView 回收商视图 它使用适配器(Adapter)来管理数据的显示,-->
+        <!--    开发者可以根据自己的需求实现适配器的方法,将数据与视图进行绑定。-->
+        <!--    这使得 RecyclerView 能够轻松地处理各种类型的数据,并按照自定义的布局方式展示。-->
+        <!--    支持局部刷新 通知数据集变化-->
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            android:layout_marginBottom="8dp">
+            android:orientation="vertical">
 
-            <TextView
-                android:id="@+id/tabExpress"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:text="快递"
-                android:gravity="center"
-                android:padding="8dp"
-                android:textSize="16sp"
-                android:textStyle="bold"/>
 
-            <TextView
-                android:id="@+id/tabFinance"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:text="财务"
-                android:gravity="center"
-                android:padding="8dp"
-                android:textSize="16sp"/>
-
-            <TextView
-                android:id="@+id/others"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:text="其他"
-                android:gravity="center"
-                android:padding="8dp"
-                android:textSize="16sp"/>
-        </LinearLayout>
-
-        <!-- 内容区域 -->
-        <FrameLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_margin="16dp">
-
-            <!-- 快递内容 -->
-            <androidx.cardview.widget.CardView
-                android:id="@+id/expressContent"
+            <!-- 优化后的快递/财务切换区域 -->
+            <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                app:cardBackgroundColor="@color/light_blue_50"
-                app:cardCornerRadius="8dp"
-                app:cardElevation="0dp">
+                android:orientation="horizontal"
+                android:layout_marginTop="8dp"
+                android:layout_marginBottom="8dp"
+                android:layout_marginHorizontal="8dp">
+
+                <!-- 分类标签区域 -->
+                <LinearLayout
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:orientation="horizontal">
+
+                    <com.example.firstapp.view.UnderlineTextView
+                        android:id="@+id/tabExpress"
+                        android:layout_width="0dp"
+                        android:layout_height="match_parent"
+                        android:layout_weight="1"
+                        android:gravity="center"
+                        android:padding="6dp"
+                        android:text="快递"
+                        android:textSize="14sp"
+                        android:textStyle="bold" />
+
+                    <com.example.firstapp.view.UnderlineTextView
+                        android:id="@+id/tabFinance"
+                        android:layout_width="0dp"
+                        android:layout_height="match_parent"
+                        android:layout_weight="1"
+                        android:gravity="center"
+                        android:padding="6dp"
+                        android:text="还款"
+                        android:textSize="14sp" />
+
+                    <com.example.firstapp.view.UnderlineTextView
+                        android:id="@+id/tabIncome"
+                        android:layout_width="0dp"
+                        android:layout_height="match_parent"
+                        android:layout_weight="1"
+                        android:gravity="center"
+                        android:padding="6dp"
+                        android:text="收入"
+                        android:textSize="14sp" />
+
+                    <com.example.firstapp.view.UnderlineTextView
+                        android:id="@+id/tabFlight"
+                        android:layout_width="0dp"
+                        android:layout_height="match_parent"
+                        android:layout_weight="1"
+                        android:gravity="center"
+                        android:padding="6dp"
+                        android:text="航班"
+                        android:textSize="14sp" />
+
+                    <com.example.firstapp.view.UnderlineTextView
+                        android:id="@+id/tabTrain"
+                        android:layout_width="0dp"
+                        android:layout_height="match_parent"
+                        android:layout_weight="1"
+                        android:gravity="center"
+                        android:padding="6dp"
+                        android:text="火车票"
+                        android:textSize="13sp" />
+                </LinearLayout>
+
+                <!-- 右侧图标区域 -->
+                <LinearLayout
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:orientation="horizontal"
+                    android:gravity="center_vertical">
+
+                    <ImageButton
+                        android:id="@+id/categoryButton"
+                        android:layout_width="28dp"
+                        android:layout_height="28dp"
+                        android:layout_marginEnd="8dp"
+                        android:background="?attr/selectableItemBackgroundBorderless"
+                        android:contentDescription="分类设置"
+                        android:padding="4dp"
+                        android:scaleType="fitCenter"
+                        android:src="@drawable/home_add" />
+
+                    <ImageButton
+                        android:id="@+id/reminderButton"
+                        android:layout_width="28dp"
+                        android:layout_height="28dp"
+                        android:background="?attr/selectableItemBackgroundBorderless"
+                        android:contentDescription="提醒设置"
+                        android:padding="4dp"
+                        android:scaleType="fitCenter"
+                        android:src="@drawable/reminder" />
+                </LinearLayout>
+            </LinearLayout>
+
+            <!-- 内容区域 -->
+            <FrameLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_margin="16dp">
 
                 <androidx.recyclerview.widget.RecyclerView
                     android:id="@+id/express_recycler"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:padding="8dp"/>
-
-            </androidx.cardview.widget.CardView>
-
-            <!-- 财务内容 -->
-            <androidx.cardview.widget.CardView
-                android:id="@+id/financeContent"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                app:cardBackgroundColor="@color/light_blue_50"
-                app:cardCornerRadius="8dp"
-                app:cardElevation="0dp">
+                    android:padding="8dp" />
 
                 <androidx.recyclerview.widget.RecyclerView
                     android:id="@+id/finance_recycler"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:padding="8dp"/>
+                    android:padding="8dp" />
 
-                <LinearLayout
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/income_recycler"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:orientation="vertical"
-                    android:padding="16dp">
+                    android:padding="8dp" />
 
-                    <!-- 花呗还款 -->
-                    <TextView
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:text="花呗"
-                        android:textSize="16sp"
-                        android:textStyle="bold"
-                        android:layout_marginBottom="8dp"/>
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/flight_recycler"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:padding="8dp"
+                    android:visibility="gone" />
 
-                    <TextView
-                        android:id="@+id/huabeiAmount"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:text="230,721 元"
-                        android:textSize="24sp"
-                        android:textColor="#FF5722"
-                        android:layout_marginBottom="4dp"/>
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/train_recycler"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:padding="8dp"
+                    android:visibility="gone" />
 
-                    <TextView
-                        android:id="@+id/huabeiDueDate"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:text="提醒您2025.01.14 还款"
-                        android:textSize="14sp"
-                        android:layout_marginBottom="16dp"/>
+            </FrameLayout>
 
-                    <!-- 信用卡还款 -->
-                    <TextView
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:text="中国银行信用卡"
-                        android:textSize="16sp"
-                        android:textStyle="bold"
-                        android:layout_marginBottom="8dp"/>
+            <!-- 底部广告位 -->
+            <androidx.cardview.widget.CardView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                app:cardCornerRadius="8dp"
+                app:cardElevation="2dp">
 
-                    <TextView
-                        android:id="@+id/creditCardAmount"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:text="310,621 元"
-                        android:textSize="24sp"
-                        android:textColor="#FF5722"
-                        android:layout_marginBottom="4dp"/>
-
-                    <TextView
-                        android:id="@+id/creditCardDueDate"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:text="提醒您2025.02.10 还款"
-                        android:textSize="14sp"/>
-
-                </LinearLayout>
+                <ImageView
+                    android:id="@+id/bottomAdBanner"
+                    android:layout_width="match_parent"
+                    android:layout_height="80dp"
+                    android:scaleType="centerCrop" />
             </androidx.cardview.widget.CardView>
 
-        </FrameLayout>
+        </LinearLayout>
+    </ScrollView>
 
-        <!-- 底部广告位 -->
-        <androidx.cardview.widget.CardView
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            app:cardCornerRadius="8dp"
-            app:cardElevation="2dp">
-            
-            <ImageView
-                android:id="@+id/bottomAdBanner"
-                android:layout_width="match_parent"
-                android:layout_height="80dp"
-                android:scaleType="centerCrop"/>
-        </androidx.cardview.widget.CardView>
+<!--    &lt;!&ndash; 顶部广告位 &ndash;&gt;-->
+<!--    <androidx.cardview.widget.CardView-->
+<!--        android:layout_width="match_parent"-->
+<!--        android:layout_height="wrap_content">-->
 
-    </LinearLayout>
-</ScrollView>
\ No newline at end of file
+<!--        <ImageView-->
+<!--            android:id="@+id/adBanner"-->
+<!--            android:layout_width="match_parent"-->
+<!--            android:layout_height="40dp"-->
+<!--            android:scaleType="centerCrop"-->
+<!--            android:src="@drawable/up_back" />-->
+<!--    </androidx.cardview.widget.CardView>-->
+
+    <!-- 在适当的位置添加 -->
+
+</FrameLayout>

--
Gitblit v1.9.3