From b653b90d4598ee2a65bceffa793bb75353b6d186 Mon Sep 17 00:00:00 2001 From: cloudroam <cloudroam> Date: 星期三, 26 二月 2025 17:21:53 +0800 Subject: [PATCH] add: 快递列表展示 --- app/src/main/res/layout/fragment_home.xml | 130 +++++++++++++++++++++++++++++++++++-------- 1 files changed, 106 insertions(+), 24 deletions(-) diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 0a6dc93..87907ab 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -1,30 +1,112 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" +<ScrollView 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.home.HomeFragment"> + android:layout_height="match_parent"> -<!-- <TextView--> -<!-- android:id="@+id/text_home"--> -<!-- android:layout_width="match_parent"--> -<!-- android:layout_height="wrap_content"--> -<!-- android:layout_marginStart="8dp"--> -<!-- android:layout_marginTop="8dp"--> -<!-- android:layout_marginEnd="8dp"--> -<!-- android:textAlignment="center"--> -<!-- android:textSize="20sp"--> -<!-- app:layout_constraintBottom_toBottomOf="parent"--> -<!-- app:layout_constraintEnd_toEndOf="parent"--> -<!-- app:layout_constraintStart_toStartOf="parent"--> -<!-- app:layout_constraintTop_toTopOf="parent" />--> - - <androidx.recyclerview.widget.RecyclerView - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/recyclerView" +<!-- LinearLayout的作用是按照垂直或者水平方向排列其子视图--> +<!-- CardView组件是用于实现卡片式布局--> +<!-- RecyclerView 回收商视图 它使用适配器(Adapter)来管理数据的显示,--> +<!-- 开发者可以根据自己的需求实现适配器的方法,将数据与视图进行绑定。--> +<!-- 这使得 RecyclerView 能够轻松地处理各种类型的数据,并按照自定义的布局方式展示。--> +<!-- 支持局部刷新 通知数据集变化--> + <LinearLayout android:layout_width="match_parent" - android:layout_height="match_parent" - android:padding="8dp"/> + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="16dp"> -</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file + <!-- 我的快递板块 --> + <androidx.cardview.widget.CardView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="16dp" + app:cardCornerRadius="8dp" + app:cardElevation="2dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="我的快递" + android:textColor="#333333" + android:textSize="16sp" + android:textStyle="bold"/> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/express_recycler" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" /> + + + </LinearLayout> + </androidx.cardview.widget.CardView> + + <!-- 我的财务板块 --> + <androidx.cardview.widget.CardView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="16dp" + app:cardCornerRadius="8dp" + app:cardElevation="2dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="16dp" + android:background="#E8F5E9"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/finance_recycler" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="我的财务" + android:textColor="#333333" + android:textSize="16sp" + android:textStyle="bold"/> + </LinearLayout> + </androidx.cardview.widget.CardView> + + <!-- 纪念日板块 --> + <androidx.cardview.widget.CardView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="16dp" + app:cardCornerRadius="8dp" + app:cardElevation="2dp"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="16dp" + android:background="#FFF3E0"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/memorial_recycler" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="纪念日" + android:textColor="#333333" + android:textSize="16sp" + android:textStyle="bold"/> + </LinearLayout> + </androidx.cardview.widget.CardView> + + </LinearLayout> +</ScrollView> \ No newline at end of file -- Gitblit v1.9.3