From 63608b5dca9eebb6fa2cb1a8652b395f1d910c3e Mon Sep 17 00:00:00 2001
From: 张钢 <floatgang@163.com>
Date: 星期一, 02 九月 2024 13:52:17 +0800
Subject: [PATCH] 对新接口进行了适配
---
app/src/main/res/layout/item_daily_consume_record.xml | 126 ++++++++++++++++++++++++++++++++---------
1 files changed, 98 insertions(+), 28 deletions(-)
diff --git a/app/src/main/res/layout/item_daily_consume_record.xml b/app/src/main/res/layout/item_daily_consume_record.xml
index ec8ac0d..fbb9df4 100644
--- a/app/src/main/res/layout/item_daily_consume_record.xml
+++ b/app/src/main/res/layout/item_daily_consume_record.xml
@@ -11,12 +11,13 @@
type="com.application.zhangshi_app_android.bean.DailyConsumeRecordBean"
/>
<variable
- name="isFold"
- type="boolean"
+ name="viewModel"
+ type="com.application.zhangshi_app_android.ui.function.TourismDetailActivityViewModel"
/>
</data>
<androidx.cardview.widget.CardView
+ android:id="@+id/cardView"
android:layout_width="match_parent"
android:layout_height="50dp"
app:cardBackgroundColor="@color/white"
@@ -30,7 +31,6 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="5dp"
- android:paddingBottom="15dp"
>
<LinearLayout
android:id="@+id/layout_title"
@@ -38,25 +38,70 @@
android:layout_height="50dp"
android:gravity="center_vertical"
>
- <TextView
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ >
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/tv_date"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="#FF000000"
+ android:textSize="20sp"
+ android:text="@={bean.date}"
+ android:background="@null"
+ android:clickable="@{viewModel.typeLiveData}"
+ tools:text="5鏈�1鏃�"
+ android:textColorHint="#6b000000"
+ android:ellipsize="end"
+ android:maxLines="1"
+ app:autoSizeTextType="uniform"
+ app:autoSizeMaxTextSize="20sp"
+ app:autoSizeMinTextSize="16sp"
+ />
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="#6B000000"
+ android:visibility="@{viewModel.typeLiveData}"
+ />
+ </LinearLayout>
+ <View
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
- android:textColor="#FF000000"
- android:textSize="20sp"
- android:text="@{bean.date}"
- tools:text="5鏈�1鏃�"
+ android:layout_marginStart="10dp"
/>
- <ImageView
+ <LinearLayout
+ android:id="@+id/layout_add_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:background="@drawable/ic_tourism_add"
- />
+ android:layout_gravity="center"
+ android:gravity="center"
+ android:layout_marginStart="10dp"
+ android:visibility="@{viewModel.typeLiveData}"
+ >
+ <ImageView
+ android:id="@+id/iv_delete"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ic_delete_tourism"
+ />
+ <ImageView
+ android:id="@+id/iv_add"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="10dp"
+ android:background="@drawable/ic_tourism_add"
+ />
+ </LinearLayout>
<ImageView
android:id="@+id/iv_fold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:background="@{isFold?@drawable/ic_fold:@drawable/ic_unfold}"
+ android:background="@drawable/ic_fold"
android:layout_marginStart="10dp"
/>
</LinearLayout>
@@ -65,12 +110,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
+ android:paddingBottom="15dp"
>
- <androidx.recyclerview.widget.RecyclerView
- android:id="@+id/rv_consume_record"
+ <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- />
+ >
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/rv_consume_record"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ tools:listitem="@layout/item_consume_record"
+ />
+ </RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -80,20 +132,38 @@
android:alpha="0.54"
android:layout_marginTop="10dp"
/>
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@{bean.dailyMoney}"
- android:textColor="#DE000000"
- android:textSize="14sp"
- android:layout_marginTop="5dp"
- />
- <View
+ <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="#6B000000"
- android:layout_marginTop="8dp"
- />
+ android:layout_height="wrap_content"
+ >
+
+ <EditText
+ android:id="@+id/et_daily_money"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:inputType="number"
+ android:text="@={bean.dailyMoney}"
+ android:textColor="#DE000000"
+ android:textColorHint="#6b000000"
+ android:textSize="14sp"
+ android:enabled="false"
+ android:backgroundTint="#6B000000"
+ tools:text="1490"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ />
+ <View
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:background="@color/color_non_editable"
+ app:layout_constraintTop_toTopOf="@id/et_daily_money"
+ app:layout_constraintStart_toStartOf="@id/et_daily_money"
+ app:layout_constraintBottom_toBottomOf="@id/et_daily_money"
+ app:layout_constraintEnd_toEndOf="@id/et_daily_money"
+ android:visibility="@{viewModel.typeLiveData}"
+ />
+ </androidx.constraintlayout.widget.ConstraintLayout>
+
</LinearLayout>
</LinearLayout>
--
Gitblit v1.9.1