From 27bbd0435881e408f267c99e6a253d2e17873bcc Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期五, 11 四月 2025 17:44:11 +0800
Subject: [PATCH] 1.2
---
app/src/main/res/layout/fragment_home.xml | 89 ++++++++++++++++++++++++++------------------
1 files changed, 53 insertions(+), 36 deletions(-)
diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml
index 5305951..bcfa7d8 100644
--- a/app/src/main/res/layout/fragment_home.xml
+++ b/app/src/main/res/layout/fragment_home.xml
@@ -7,9 +7,8 @@
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_marginTop="40dp"> <!-- 留出顶部广告位的高度 -->
+ android:layout_marginTop="0dp"> <!-- 留出顶部广告位的高度 -->
>
-
<!-- LinearLayout的作用是按照垂直或者水平方向排列其子视图-->
<!-- CardView组件是用于实现卡片式布局-->
<!-- RecyclerView 回收商视图 它使用适配器(Adapter)来管理数据的显示,-->
@@ -22,24 +21,26 @@
android:orientation="vertical">
- <!-- 快递/财务切换区域 -->
- <FrameLayout
+ <!-- 优化后的快递/财务切换区域 -->
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="8dp"
+ android:orientation="horizontal"
android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
android:layout_marginHorizontal="8dp">
+ <!-- 分类标签区域 -->
<LinearLayout
- android:layout_width="match_parent"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_marginEnd="30dp"
+ android:layout_weight="1"
android:orientation="horizontal">
<com.example.firstapp.view.UnderlineTextView
android:id="@+id/tabExpress"
android:layout_width="0dp"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:padding="6dp"
@@ -50,7 +51,7 @@
<com.example.firstapp.view.UnderlineTextView
android:id="@+id/tabFinance"
android:layout_width="0dp"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:padding="6dp"
@@ -60,7 +61,7 @@
<com.example.firstapp.view.UnderlineTextView
android:id="@+id/tabIncome"
android:layout_width="0dp"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:padding="6dp"
@@ -70,7 +71,7 @@
<com.example.firstapp.view.UnderlineTextView
android:id="@+id/tabFlight"
android:layout_width="0dp"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:padding="6dp"
@@ -80,27 +81,43 @@
<com.example.firstapp.view.UnderlineTextView
android:id="@+id/tabTrain"
android:layout_width="0dp"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:padding="6dp"
android:text="火车票"
- android:textSize="14sp" />
-
+ android:textSize="13sp" />
</LinearLayout>
- <ImageButton
- android:id="@+id/categoryButton"
- android:layout_width="28dp"
- android:layout_height="28dp"
- android:layout_gravity="center_vertical|end"
- android:background="?attr/selectableItemBackgroundBorderless"
- android:contentDescription="分类设置"
- android:padding="4dp"
- android:scaleType="fitCenter"
- android:src="@drawable/home_add" />
+ <!-- 右侧图标区域 -->
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:gravity="center_vertical">
- </FrameLayout>
+ <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
@@ -159,18 +176,18 @@
</LinearLayout>
</ScrollView>
- <!-- 顶部广告位 -->
- <androidx.cardview.widget.CardView
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
+<!-- <!– 顶部广告位 –>-->
+<!-- <androidx.cardview.widget.CardView-->
+<!-- android:layout_width="match_parent"-->
+<!-- android:layout_height="wrap_content">-->
- <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>
+<!-- <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>-->
<!-- 在适当的位置添加 -->
--
Gitblit v1.9.3