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_pet.xml | 449 +++++++++++++++++++++++++++----------------------------- 1 files changed, 216 insertions(+), 233 deletions(-) diff --git a/app/src/main/res/layout/activity_pet.xml b/app/src/main/res/layout/activity_pet.xml index 43ef49b..1bddf4d 100644 --- a/app/src/main/res/layout/activity_pet.xml +++ b/app/src/main/res/layout/activity_pet.xml @@ -12,18 +12,14 @@ <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" android:background="@color/color_normal_background" > <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" app:layout_constraintTop_toTopOf="parent" - app:title="榄呭疇(浠呬緵鏌ョ湅)" - app:titleGravity="left" > <FrameLayout android:layout_width="24dp" @@ -39,6 +35,71 @@ android:background="@drawable/ic_operate" /> </FrameLayout> + <LinearLayout + android:id="@+id/layout_default" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginHorizontal="56dp" + android:gravity="center_vertical" + > + <TextView + android:id="@+id/tv_title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginHorizontal="16dp" + android:text="榄呭疇锛堜粎渚涙煡鐪嬶級" + android:layout_weight="1" + android:textColor="@color/white" + android:textSize="20sp" + app:textOverflowMode="@{4}" + /> + <ImageView + android:id="@+id/iv_search_default" + android:layout_width="@dimen/dp_24" + android:layout_height="@dimen/dp_24" + android:background="@drawable/ic_search" + /> + </LinearLayout> + <LinearLayout + android:id="@+id/layout_search" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginVertical="4dp" + android:layout_marginHorizontal="56dp" + android:gravity="center_vertical" + android:background="@color/white" + android:paddingHorizontal="5dp" + android:visibility="gone" + > + <ImageView + android:id="@+id/iv_search" + android:layout_width="24dp" + android:layout_height="24dp" + android:background="@drawable/ic_search_gray" + /> + <EditText + android:id="@+id/et_search" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_marginStart="5dp" + android:textSize="14sp" + android:textColor="#61000000" + android:background="@null" + android:imeOptions="actionSearch" + android:singleLine="true" + android:text="鍦ㄢ�滈瓍瀹犫�濆唴鎼滅储" + android:editable="false" + android:clickable="false" + android:focusable="false" + /> + <ImageView + android:id="@+id/iv_search_type" + android:layout_width="24dp" + android:layout_height="24dp" + android:background="@drawable/ic_search_by" + /> + </LinearLayout> </com.android.app_base.widget.ExtendTitleBar> <LinearLayout @@ -51,7 +112,7 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/extendTitleBar"> + app:layout_constraintTop_toBottomOf="@+id/titleBar"> <ImageView android:layout_width="wrap_content" @@ -62,261 +123,183 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="18dp" - android:text="鏆傛椂杩樻病鏈夋暟鎹摝~\n鐐瑰嚮鈥濓紜鈥濈珛鍗冲垱寤�" + android:text="鏆傛椂杩樻病鏈夋暟鎹摝~" android:textSize="14sp" android:textColor="#73000000" /> </LinearLayout> - - <androidx.core.widget.NestedScrollView + <com.scwang.smart.refresh.layout.SmartRefreshLayout + android:id="@+id/refreshLayout" android:layout_width="match_parent" android:layout_height="0dp" + app:layout_constraintTop_toBottomOf="@+id/titleBar" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintTop_toBottomOf="@+id/extendTitleBar" > - <LinearLayout + <com.scwang.smart.refresh.header.MaterialHeader android:layout_width="match_parent" android:layout_height="wrap_content" + /> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recyclerView" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="20dp" + tools:itemCount="20" + tools:listitem="@layout/item_pet" /> + + <com.scwang.smart.refresh.footer.BallPulseFooter + android:layout_width="match_parent" + android:layout_height="wrap_content"/> + </com.scwang.smart.refresh.layout.SmartRefreshLayout> + <RelativeLayout + android:id="@+id/container_search_parameter" + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintTop_toBottomOf="@id/titleBar" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + android:layout_marginTop="-4dp" + tools:layout_height="wrap_content" + > + <LinearLayout + android:id="@+id/layout_search_parameter" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/white" + android:layout_marginHorizontal="56dp" + android:paddingEnd="12dp" + android:paddingStart="5dp" > - <androidx.cardview.widget.CardView + + <View android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginHorizontal="20dp" - android:layout_marginVertical="26dp" - app:cardBackgroundColor="#99FFE2EF" - app:cardCornerRadius="10dp" - app:cardElevation="0dp" - > - <LinearLayout - android:layout_width="match_parent" + android:layout_height="0.3dp" + android:background="#FF939393" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="40dp" + android:gravity="center"> + + <androidx.appcompat.widget.AppCompatTextView + android:layout_width="0dp" + android:layout_weight="1" android:layout_height="wrap_content" - android:layout_marginHorizontal="40dp" - android:layout_marginVertical="20dp" - android:orientation="vertical" + android:text="瀹犵墿鍚�" + android:textColor="#FF333333" + android:textSize="14sp" + android:gravity="center" + android:maxLines="1" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="10sp" + app:autoSizeMaxTextSize="14sp" + /> + + <com.android.app_base.widget.ClearEditText + android:layout_width="0dp" + android:layout_weight="4" + android:layout_height="wrap_content" + android:background="@null" + android:inputType="text" + android:layout_marginStart="6dp" + android:text="@={viewModel.requestBeanLiveData.name}" + android:hint="璇疯緭鍏ュ疇鐗╁悕" + android:textColorHint="#61000000" + android:textColor="#FF333333" + android:textSize="14sp" + android:maxLines="1" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="10sp" + app:autoSizeMaxTextSize="14sp" + app:background="@drawable/ic_clear" + /> + </LinearLayout> + <View + android:layout_width="match_parent" + android:layout_height="0.5dp" + android:background="#FF939393" /> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="40dp" + android:gravity="center" + > + + <androidx.appcompat.widget.AppCompatTextView + android:layout_width="0dp" + android:layout_weight="1" + android:layout_height="match_parent" + android:text="鍑虹敓鏃ユ湡" + android:textColor="#FF333333" + android:textSize="14sp" + android:gravity="center" + android:maxLines="1" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="10sp" + app:autoSizeMaxTextSize="14sp" + /> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="4" + android:gravity="center" > - <TextView - android:layout_width="wrap_content" + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/et_start_time" + android:layout_width="0dp" + android:layout_weight="1" android:layout_height="wrap_content" - android:text="灏忛粍鐨勫熀鏈俊鎭�" - android:textColor="#66000000" + android:gravity="center" + android:layout_marginStart="6dp" + android:text="@={viewModel.requestBeanLiveData.happenStartTime}" + android:hint="寮�濮嬫椂闂�" + android:textColorHint="#61000000" + android:textColor="#FF333333" android:textSize="14sp" - /> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - > - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="鐘悕锛氬皬榛�" - android:textColor="#FF000000" - android:textSize="14sp" - /> - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="鐘锛氶噾姣�" - android:textColor="#FF000000" - android:textSize="14sp" - /> - </LinearLayout> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - > - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="鎬у埆锛氶泴鎬�" - android:textColor="#FF000000" - android:textSize="14sp" - /> - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="鐘彧棰滆壊锛氶噾榛勮壊" - android:textColor="#FF000000" - android:textSize="14sp" - /> - </LinearLayout> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="鍑虹敓鏃ユ湡锛�2010-03-01" - android:textColor="#FF000000" - android:textSize="14sp" - android:layout_marginTop="10dp" + android:maxLines="1" + android:lines="1" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="10sp" + app:autoSizeMaxTextSize="14sp" + tools:text="2022-01-01" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="鐘瘉鍙风爜锛�1234567891" - android:textColor="#FF000000" - android:textSize="14sp" - android:layout_marginTop="10dp" + android:text="鈥�" /> - <TextView + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/et_end_time" + android:layout_width="0dp" + android:layout_weight="1" + android:gravity="center" + android:layout_height="wrap_content" + android:text="@={viewModel.requestBeanLiveData.happenEndTime}" + android:hint="缁撴潫鏃堕棿" + android:textColorHint="#61000000" + android:textColor="#FF333333" + android:textSize="14sp" + android:maxLines="1" + app:autoSizeTextType="uniform" + app:autoSizeMinTextSize="10sp" + app:autoSizeMaxTextSize="14sp" + tools:text="2022-01-01" + /> + <ImageView + android:id="@+id/iv_time_clear" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="闃蹭吉鐮侊細1234567891" - android:textColor="#FF000000" - android:textSize="14sp" - android:layout_marginTop="10dp" + android:background="@drawable/ic_clear" + android:visibility="invisible" /> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="楗涔犳儻锛堝枩锛夛細" - android:textColor="#FF000000" - android:textSize="14sp" - /> - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="灏忕嫍绮�" - android:textColor="#FF000000" - android:textSize="14sp" - /> - </LinearLayout> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="楗涔犳儻锛堟伓锛夛細" - android:textColor="#FF000000" - android:textSize="14sp" - /> - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="灏忕嫍绮�" - android:textColor="#FF000000" - android:textSize="14sp" - /> - </LinearLayout> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="鐢熸椿涔犳儻锛堢埍濂斤級锛�" - android:textColor="#FF000000" - android:textSize="14sp" - /> - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="灏忕嫍绮皬鐙楃伯" - android:textColor="#FF000000" - android:textSize="14sp" - /> - </LinearLayout> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="鐢熸椿涔犳儻锛堝棞濂斤級锛�" - android:textColor="#FF000000" - android:textSize="14sp" - /> - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯灏忕嫍绮皬鐙楃伯" - android:textColor="#FF000000" - android:textSize="14sp" - /> - </LinearLayout> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="鍚噦鏂硅█锛�" - android:textColor="#FF000000" - android:textSize="14sp" - /> - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="绮よ銆佸瀹惰瘽" - android:textColor="#FF000000" - android:textSize="14sp" - /> - </LinearLayout> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - > - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="鐘眳浣忓湴鍧�锛�" - android:textColor="#FF000000" - android:textSize="14sp" - /> - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="骞夸笢鐪佸箍宸炲競" - android:textColor="#FF000000" - android:textSize="14sp" - /> - </LinearLayout> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="榄呭疇鍏ㄨ韩鐓э細" - android:textColor="#FF000000" - android:textSize="14sp" - android:layout_marginTop="10dp" - /> - <androidx.recyclerview.widget.RecyclerView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/recyclerView" - android:layout_marginTop="10dp" - /> - </LinearLayout> - </androidx.cardview.widget.CardView> + </LinearLayout> </LinearLayout> - </androidx.core.widget.NestedScrollView> - + </RelativeLayout> </androidx.constraintlayout.widget.ConstraintLayout> -- Gitblit v1.9.1