From 82e57df230ecb744af6c8865f80870ba03c86d89 Mon Sep 17 00:00:00 2001 From: Linjiajia <319408893@qq.com> Date: 星期二, 25 七月 2023 22:18:27 +0800 Subject: [PATCH] 基本功能完成 --- app/src/main/res/layout/item_daily_consume_record.xml | 125 ++++++++++++++++++++++++++++++++--------- 1 files changed, 97 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..b2b4925 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,18 @@ 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" + /> + </RelativeLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -80,20 +131,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