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/activity_marriage.xml | 383 ++++++++++++++++-------------------------------------- 1 files changed, 113 insertions(+), 270 deletions(-) diff --git a/app/src/main/res/layout/activity_marriage.xml b/app/src/main/res/layout/activity_marriage.xml index 91fcba1..36d17b8 100644 --- a/app/src/main/res/layout/activity_marriage.xml +++ b/app/src/main/res/layout/activity_marriage.xml @@ -17,7 +17,7 @@ > <com.android.app_base.widget.ExtendTitleBar - android:id="@+id/extendTitleBar" + android:id="@+id/titleBar" android:layout_width="match_parent" android:layout_height="wrap_content" android:elevation="10dp" @@ -26,11 +26,12 @@ app:titleGravity="left" /> - <ScrollView + <androidx.core.widget.NestedScrollView + android:id="@+id/nestedScrollView" android:layout_width="match_parent" android:layout_height="0dp" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintTop_toBottomOf="@+id/extendTitleBar" + app:layout_constraintTop_toBottomOf="@id/titleBar" > <LinearLayout android:layout_width="match_parent" @@ -75,7 +76,7 @@ <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="寮犱笁" + android:text="@{viewModel.infoLiveData.name}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -105,7 +106,7 @@ <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="鐢�" + android:text="@{viewModel.infoLiveData.sex}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -140,7 +141,7 @@ <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="2010-01-01" + android:text="@{viewModel.infoLiveData.birthday}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -170,7 +171,7 @@ <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="姹夋棌" + android:text="@{viewModel.infoLiveData.nation}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -202,14 +203,18 @@ android:textSize="12sp" android:alpha="0.54" /> - <TextView + <androidx.appcompat.widget.AppCompatTextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="445222200110233318" + android:text="@{viewModel.infoLiveData.idNo}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" android:ellipsize="marquee" + android:maxLines="1" + app:autoSizeTextType="uniform" + app:autoSizeMaxTextSize="14sp" + app:autoSizeMinTextSize="12sp" /> <View android:layout_width="match_parent" @@ -233,13 +238,18 @@ android:textSize="12sp" android:alpha="0.54" /> - <TextView + <androidx.appcompat.widget.AppCompatTextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="17818824255" + android:text="@{viewModel.infoLiveData.phone}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" + android:ellipsize="marquee" + android:maxLines="1" + app:autoSizeTextType="uniform" + app:autoSizeMaxTextSize="14sp" + app:autoSizeMinTextSize="12sp" /> <View android:layout_width="match_parent" @@ -271,7 +281,7 @@ <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="宸插" + android:text="@{viewModel.infoLiveData.marryStatus}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -303,7 +313,7 @@ <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="2020-10" + android:text="@{viewModel.infoLiveData.marryTime}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -335,10 +345,10 @@ android:textSize="12sp" android:alpha="0.54" /> - <TextView + <androidx.appcompat.widget.AppCompatTextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="骞夸笢鐪佸箍宸炲競" + android:text="@{viewModel.infoLiveData.address}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -375,7 +385,7 @@ android:orientation="vertical" android:layout_marginHorizontal="6dp" > - <LinearLayout + <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/layout_title_spouse" android:layout_width="match_parent" android:layout_height="50dp" @@ -388,14 +398,20 @@ android:text="閰嶅伓鎯呭喌" android:textColor="@color/black" android:textSize="20sp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> <ImageView android:id="@+id/iv_spouse_fold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@{viewModel.isSpouseExpendedLiveData?@drawable/ic_unfold:@drawable/ic_fold}" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> - </LinearLayout> + </androidx.constraintlayout.widget.ConstraintLayout> <LinearLayout android:id="@+id/layout_content_spouse" android:layout_width="match_parent" @@ -426,7 +442,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxLines="1" - android:text="寮犱笁" + android:text="@{viewModel.infoLiveData.spouseName}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -458,7 +474,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxLines="1" - android:text="宸插" + android:text="@{viewModel.infoLiveData.spouseMarryStatus}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -497,7 +513,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxLines="1" - android:text="2010-01-01" + android:text="@{viewModel.infoLiveData.spouseBirthday}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -529,7 +545,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxLines="1" - android:text="骞夸笢鐪佸箍宸炲競" + android:text="@{viewModel.infoLiveData.spouseAddress}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -542,60 +558,13 @@ /> </LinearLayout> </LinearLayout> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="20dp" - android:layout_marginBottom="10dp" - > - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="vertical" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="宸ヤ綔鍗曚綅" - android:textColor="@color/black" - android:textSize="12sp" - android:alpha="0.54" - /> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="寮犳皬鍏徃" - android:textColor="#DE000000" - android:textSize="14sp" - android:layout_marginTop="5dp" - android:ellipsize="marquee" - /> - <View - android:layout_width="match_parent" - android:layout_height="1dp" - android:background="#6B000000" - android:layout_marginTop="8dp" - /> - </LinearLayout> - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="vertical" - android:layout_marginStart="40dp" - > - </LinearLayout> - </LinearLayout> - </LinearLayout> </LinearLayout> </androidx.cardview.widget.CardView> + <androidx.cardview.widget.CardView android:id="@+id/card_predecessor" android:layout_width="match_parent" @@ -604,6 +573,7 @@ android:layout_marginTop="10dp" app:cardCornerRadius="10dp" app:cardElevation="2dp" + tools:layout_height="wrap_content" > <LinearLayout android:layout_width="match_parent" @@ -611,7 +581,7 @@ android:orientation="vertical" android:layout_marginHorizontal="6dp" > - <LinearLayout + <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/layout_title_predecessor" android:layout_width="match_parent" android:layout_height="50dp" @@ -624,207 +594,33 @@ android:text="鍓嶄换" android:textColor="#CC000000" android:textSize="18sp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> <ImageView android:id="@+id/iv_predecessor_fold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@{viewModel.isPredecessorExpendedLiveData?@drawable/ic_unfold:@drawable/ic_fold}" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> - </LinearLayout> - <LinearLayout + </androidx.constraintlayout.widget.ConstraintLayout> + <RelativeLayout android:id="@+id/layout_content_predecessor" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical" > - <LinearLayout + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/rv_predecessor" android:layout_width="match_parent" android:layout_height="wrap_content" - > - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="vertical" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="濮撳悕" - android:textColor="@color/black" - android:textSize="12sp" - android:alpha="0.54" - /> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="寮犱笁" - android:textColor="#B3000000" - android:textSize="16sp" - android:layout_marginTop="5dp" - /> - <View - android:layout_width="match_parent" - android:layout_height="1dp" - android:background="#6B000000" - android:layout_marginTop="8dp" - /> - </LinearLayout> - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="vertical" - android:layout_marginStart="40dp" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="濠氬Щ鐘跺喌" - android:textColor="@color/black" - android:textSize="12sp" - android:alpha="0.54" - /> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="绂诲" - android:textColor="#B3000000" - android:textSize="16sp" - android:layout_marginTop="5dp" - android:drawableStart="@drawable/ic_radio_button" - android:drawablePadding="8dp" - /> - <View - android:layout_width="match_parent" - android:layout_height="1dp" - android:background="#6B000000" - android:layout_marginTop="8dp" - /> - </LinearLayout> - </LinearLayout> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="20dp" - > - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="vertical" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="鍑虹敓鏃ユ湡" - android:textColor="@color/black" - android:textSize="12sp" - android:alpha="0.54" - /> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="2010-01-01" - android:textColor="#B3000000" - android:textSize="16sp" - android:layout_marginTop="5dp" - /> - <View - android:layout_width="match_parent" - android:layout_height="1dp" - android:background="#6B000000" - android:layout_marginTop="8dp" - /> - </LinearLayout> - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="vertical" - android:layout_marginStart="40dp" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="鎴风睄鍦板潃" - android:textColor="@color/black" - android:textSize="12sp" - android:alpha="0.54" - /> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="骞夸笢鐪佸箍宸炲競" - android:textColor="#B3000000" - android:textSize="16sp" - android:layout_marginTop="5dp" - /> - <View - android:layout_width="match_parent" - android:layout_height="1dp" - android:background="#6B000000" - android:layout_marginTop="8dp" - /> - </LinearLayout> - </LinearLayout> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="20dp" - android:layout_marginBottom="10dp" - > - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="vertical" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="宸ヤ綔鍗曚綅" - android:textColor="@color/black" - android:textSize="12sp" - android:alpha="0.54" - /> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="1" - android:text="寮犳皬鍏徃" - android:textColor="#B3000000" - android:textSize="16sp" - android:layout_marginTop="5dp" - android:ellipsize="marquee" - /> - <View - android:layout_width="match_parent" - android:layout_height="1dp" - android:background="#6B000000" - android:layout_marginTop="8dp" - /> - </LinearLayout> - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="vertical" - android:layout_marginStart="40dp" - > - </LinearLayout> - </LinearLayout> - </LinearLayout> + tools:listitem="@layout/item_old_spouse" + tools:itemCount="3" + /> + </RelativeLayout> </LinearLayout> @@ -837,6 +633,7 @@ android:layout_marginTop="10dp" app:cardCornerRadius="10dp" app:cardElevation="2dp" + tools:layout_height="wrap_content" > <LinearLayout android:layout_width="match_parent" @@ -844,7 +641,7 @@ android:orientation="vertical" android:layout_marginHorizontal="6dp" > - <LinearLayout + <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/layout_title_procreate" android:layout_width="match_parent" android:layout_height="50dp" @@ -857,20 +654,25 @@ android:text="鐢熻偛鎯呭喌" android:textColor="@color/black" android:textSize="20sp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> <ImageView android:id="@+id/iv_procreate_fold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@{viewModel.isProcreateExpendedLiveData?@drawable/ic_unfold:@drawable/ic_fold}" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> - </LinearLayout> + </androidx.constraintlayout.widget.ConstraintLayout> <LinearLayout android:id="@+id/layout_content_procreate" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - > <LinearLayout android:layout_width="match_parent" @@ -895,7 +697,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxLines="1" - android:text="宸茬敓鑲�" + android:text="@{viewModel.infoLiveData.bearStatus}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -942,7 +744,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxLines="1" - android:text="鏄�" + android:text="@{viewModel.infoLiveData.handbookStatus}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -990,7 +792,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxLines="1" - android:text="鏄�" + android:text="@{viewModel.infoLiveData.oneBorn}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -1024,7 +826,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxLines="1" - android:text="2023-01-01" + android:text="@{viewModel.infoLiveData.oneBornTime}" android:textColor="#DE000000" android:textSize="14sp" android:layout_marginTop="5dp" @@ -1069,16 +871,17 @@ android:layout_height="wrap_content" android:textSize="16sp" android:textColor="#FF131215" - android:text="闇�澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂囬渶澹版槑鐨勬儏鍐垫鏂�" + android:text="@{viewModel.infoLiveData.content}" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="16sp" android:textColor="@color/black" - android:text="2005骞�12鏈�20鏃�" + android:text="@{viewModel.infoLiveData.contentTime}" android:layout_marginTop="12dp" android:layout_gravity="end" + tools:text="" /> </LinearLayout> <TextView @@ -1107,14 +910,14 @@ android:layout_height="wrap_content" android:textSize="16sp" android:textColor="#FF131215" - android:text="澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃澶囨敞姝f枃" + android:text="@{viewModel.infoLiveData.remark}" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="16sp" android:textColor="@color/black" - android:text="2005骞�12鏈�20鏃�" + android:text="@{viewModel.infoLiveData.remarkTime}" android:layout_marginTop="12dp" android:layout_gravity="end" /> @@ -1122,6 +925,46 @@ </LinearLayout> - </ScrollView> + </androidx.core.widget.NestedScrollView> + + <LinearLayout + android:id="@+id/layout_data_null" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + android:gravity="center" + android:visibility="gone" + tools:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/titleBar"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/img_data_null" + /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="18dp" + android:text="绌虹┖濡備篃~" + android:textSize="14sp" + android:textColor="#73000000" + /> + </LinearLayout> + + <androidx.constraintlayout.utils.widget.ImageFilterView + android:id="@+id/fab_move_to_top" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + android:layout_marginEnd="25dp" + android:layout_marginBottom="44dp" + app:fabCustomSize="100dp" + android:background="@drawable/ic_move_to_top" + /> </androidx.constraintlayout.widget.ConstraintLayout> </layout> \ No newline at end of file -- Gitblit v1.9.1