From cece79bf75a9b672b33b772acffca209eecfc8f2 Mon Sep 17 00:00:00 2001
From: zuoxiao <lf_zuo@163.com>
Date: 星期四, 26 六月 2025 08:27:25 +0800
Subject: [PATCH] refactor(generallibrary):优化补卡界面布局和样式- 调整了卡片信息展示区域的样式,包括背景色、文字颜色等 - 优化了输入区域的布局结构,减小了控件间距和尺寸- 更新了确认补卡按钮的样式 - 统一了文字大小和颜色,提高了可读性
---
generallibrary/src/main/res/layout/activity_new_card_ge.xml | 461 +++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 301 insertions(+), 160 deletions(-)
diff --git a/generallibrary/src/main/res/layout/activity_new_card_ge.xml b/generallibrary/src/main/res/layout/activity_new_card_ge.xml
index 43fe50f..b1cb270 100644
--- a/generallibrary/src/main/res/layout/activity_new_card_ge.xml
+++ b/generallibrary/src/main/res/layout/activity_new_card_ge.xml
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout 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"
- android:background="#F5F7FA">
+ android:background="@color/base_list_bg">
<com.dayu.baselibrary.view.TitleBar
android:id="@+id/titleBar"
@@ -11,31 +12,136 @@
android:layout_height="@dimen/dimen_title_height"
android:background="@color/title_bar_bg"
android:elevation="4dp"
- app:centerText="鏂板崱寮�鎴�"
- app:leftImage="@mipmap/icon_back" />
+ app:centerText="鐢ㄦ埛寮�鍗�"
+ app:leftImage="@mipmap/icon_back"
+ tools:ignore="MissingConstraints" />
+
+ <androidx.cardview.widget.CardView
+ android:id="@+id/nfcContainer"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="24dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="24dp"
+ android:visibility="visible"
+ app:cardBackgroundColor="@android:color/white"
+ app:cardCornerRadius="12dp"
+ app:cardElevation="4dp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/titleBar">
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center"
+ android:orientation="vertical"
+ android:padding="16dp">
+
+ <TextView
+ android:id="@+id/textView"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:text="璇峰皢鏂板崱璐村湪璁惧涓婅繘琛岃鍗�"
+ android:textColor="#333333"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:text="灏嗚繘琛屽垵濮嬪寲鍗$墖\n鑰楁椂杈冮暱璇蜂笉瑕佺Щ鍔ㄥ崱鐗�"
+ android:textColor="@color/base_blue_bg"
+ android:textSize="18sp"
+ android:layout_marginTop="20dp"
+ android:textStyle="bold" />
+
+ <ImageView
+ android:id="@+id/nfcImageView"
+ android:layout_width="200dp"
+ android:layout_height="200dp"
+ android:layout_marginTop="24dp"
+ android:scaleType="fitCenter"
+ android:src="@mipmap/nfc_write" />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:gravity="center"
+ android:text="璇蜂繚鎸佹墜鎸佹満鍜屽崱鐗囦笉瑕佺Щ鍔�"
+ android:textColor="#666666"
+ android:textSize="14sp" />
+ </LinearLayout>
+
+ <RelativeLayout
+ android:id="@+id/loadingContainer"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="#80000000"
+ android:visibility="gone">
+
+ <com.pnikosis.materialishprogress.ProgressWheel
+ android:id="@+id/nfcProgressWheel"
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_centerInParent="true"
+ app:matProg_barColor="@color/base_blue_bg"
+ app:matProg_progressIndeterminate="true"
+ app:matProg_barWidth="8dp"
+ app:matProg_rimColor="#33000000"
+ app:matProg_rimWidth="8dp"
+ app:matProg_spinSpeed="0.5"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/nfcProgressWheel"
+ android:layout_centerHorizontal="true"
+ android:layout_marginTop="12dp"
+ android:text="姝e湪澶勭悊NFC鍗$墖..."
+ android:textColor="#FFFFFF"
+ android:textSize="16sp"/>
+ </RelativeLayout>
+ </FrameLayout>
+ </androidx.cardview.widget.CardView>
<ScrollView
+ android:id="@+id/center_scroll"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_above="@+id/newCard_registBtn"
- android:layout_below="@+id/titleBar"
+ android:layout_height="0dp"
android:fillViewport="true"
- android:scrollbars="none">
+ android:scrollbars="none"
+ android:visibility="gone"
+ app:layout_constraintBottom_toTopOf="@+id/newCard_registBtn"
+ app:layout_constraintTop_toBottomOf="@+id/titleBar">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:padding="16dp">
+ android:paddingBottom="16dp"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:paddingTop="10dp">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
+ android:layout_marginBottom="10dp"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<LinearLayout
+ android:id="@+id/center_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
@@ -44,7 +150,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
+ android:layout_marginBottom="10dp"
android:text="鍩烘湰淇℃伅"
android:textColor="#333333"
android:textSize="18sp"
@@ -53,14 +159,14 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
+ android:layout_marginBottom="6dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
- android:layout_width="wrap_content"
+ android:layout_width="105dp"
android:layout_height="wrap_content"
- android:text="@string/eq_no"
+ android:text="鍗″彿锛�"
android:textColor="#666666"
android:textSize="@dimen/new_card_size" />
@@ -69,7 +175,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
- android:inputType="number"
android:textColor="#333333"
android:textSize="@dimen/new_card_size" />
</LinearLayout>
@@ -77,94 +182,78 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
+ android:layout_marginBottom="6dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
- android:layout_width="80dp"
+ android:layout_width="105dp"
android:layout_height="wrap_content"
- android:text="濮撳悕"
+ android:text="濮撳悕锛�"
android:textColor="#666666"
android:textSize="@dimen/new_card_size" />
- <LinearLayout
- android:layout_width="0dp"
+ <TextView
+ android:id="@+id/newCard_userName"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:background="#FFFFFF"
- android:orientation="vertical">
-
- <EditText
- android:id="@+id/newCard_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@null"
- android:hint="璇疯緭鍏ュ鍚�"
- android:inputType="textPersonName"
- android:padding="12dp"
- android:textSize="@dimen/new_card_size" />
- </LinearLayout>
-
- <ImageView
- android:id="@+id/newCard_scanBtn"
- android:layout_width="45dp"
- android:layout_height="45dp"
- android:background="?attr/selectableItemBackgroundBorderless"
- android:padding="10dp"
- android:src="@mipmap/icon_scan"
- />
+ android:layout_marginStart="8dp"
+ android:textColor="#333333"
+ android:textSize="@dimen/new_card_size" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
+ android:layout_marginBottom="6dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
- android:layout_width="80dp"
+ android:layout_width="105dp"
android:layout_height="wrap_content"
- android:text="韬唤璇佸彿"
+ android:text="韬唤璇佸彿锛�"
android:textColor="#666666"
android:textSize="@dimen/new_card_size" />
- <LinearLayout
+ <TextView
+ android:id="@+id/newCard_idCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="#FFFFFF"
- android:orientation="vertical">
-
- <EditText
- android:id="@+id/newCard_id"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@null"
- android:digits="0123456789Xx"
- android:hint="璇疯緭鍏ヨ韩浠借瘉鍙�"
- android:inputType="text"
- android:maxLength="18"
- android:padding="12dp"
- android:textSize="@dimen/new_card_size" />
- </LinearLayout>
+ android:layout_marginStart="8dp"
+ android:textColor="#333333"
+ android:textSize="@dimen/new_card_size" />
</LinearLayout>
- <TextView
- android:id="@+id/newCard_idTip"
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
- android:text="鎵弿鍚庤鏍稿韬唤淇℃伅鏃犺"
- android:textColor="#FF4500"
- android:visibility="gone" />
+ android:layout_marginBottom="5dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="105dp"
+ android:layout_height="wrap_content"
+ android:text="鍐滄埛缂栧彿锛�"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+
+ <TextView
+ android:id="@+id/newCard_farmerCode"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:textColor="#333333"
+ android:textSize="@dimen/new_card_size" />
+ </LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
+ android:layout_marginBottom="10dp"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
@@ -177,135 +266,187 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
- android:text="鑱旂郴鏂瑰紡"
- android:textColor="#333333"
- android:textSize="18sp"
- android:textStyle="bold" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
- android:gravity="center_vertical"
- android:orientation="horizontal">
-
- <TextView
- android:layout_width="80dp"
- android:layout_height="wrap_content"
- android:text="鐢佃瘽"
- android:textColor="#666666"
- android:textSize="@dimen/new_card_size" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="#FFFFFF"
- android:orientation="vertical">
-
- <EditText
- android:id="@+id/newCard_phone"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@null"
- android:hint="璇疯緭鍏ユ墜鏈哄彿鐮�"
- android:inputType="phone"
- android:maxLength="11"
- android:padding="12dp"
- android:textSize="@dimen/new_card_size" />
- </LinearLayout>
- </LinearLayout>
- </LinearLayout>
- </androidx.cardview.widget.CardView>
-
- <androidx.cardview.widget.CardView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- app:cardCornerRadius="8dp"
- app:cardElevation="2dp">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:padding="16dp">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
+ android:layout_marginBottom="10dp"
android:text="璐圭敤淇℃伅"
android:textColor="#333333"
android:textSize="18sp"
android:textStyle="bold" />
-
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginBottom="12dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
- android:layout_width="80dp"
+ android:layout_width="105dp"
android:layout_height="wrap_content"
- android:text="宸ユ湰璐�(鍏�)"
+ android:text="宸ユ湰璐癸細"
android:textColor="#666666"
android:textSize="@dimen/new_card_size" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="#FFFFFF"
- android:orientation="vertical">
+ android:background="@drawable/edit_text_bg_selector"
+ android:orientation="horizontal"
+ android:gravity="center_vertical"
+ android:paddingStart="10dp"
+ android:paddingEnd="10dp"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp">
<EditText
- android:id="@+id/newCard_morny"
+ android:id="@+id/newCard_cardFee"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:background="@null"
+ android:hint="璇疯緭鍏ュ伐鏈垂(閫夊~)"
+ android:inputType="number"
+ android:textColor="#333333"
+ android:textColorHint="#BBBBBB"
+ android:textSize="@dimen/new_card_size" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="鍏�"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+ </LinearLayout>
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="12dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="105dp"
+ android:layout_height="wrap_content"
+ android:text="鍏呭�奸噾棰濓細"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/edit_text_bg_selector"
+ android:orientation="horizontal"
+ android:gravity="center_vertical"
+ android:paddingStart="10dp"
+ android:paddingEnd="10dp"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp">
+
+ <EditText
+ android:id="@+id/newCard_rechargeAmount"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:background="@null"
+ android:hint="璇疯緭鍏ュ厖鍊奸噾棰�(閫夊~)"
+ android:inputType="numberDecimal"
+ android:textColor="#333333"
+ android:textColorHint="#BBBBBB"
+ android:textSize="@dimen/new_card_size" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="鍏�"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+ </LinearLayout>
+ </LinearLayout>
+
+
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="5dp"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="105dp"
+ android:layout_height="wrap_content"
+ android:text="澶囨敞锛�"
+ android:textColor="#666666"
+ android:textSize="@dimen/new_card_size" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/edit_text_bg_selector"
+ android:orientation="vertical"
+ android:paddingStart="10dp"
+ android:paddingEnd="10dp"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp">
+
+ <EditText
+ android:id="@+id/newCard_remark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
- android:hint="璇疯緭鍏ュ伐鏈垂"
- android:inputType="numberDecimal"
- android:padding="12dp"
+ android:hint="璇疯緭鍏ュ娉�(閫夊~)"
+ android:textColor="#333333"
+ android:textColorHint="#BBBBBB"
android:textSize="@dimen/new_card_size" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
- <!-- 闅愯棌鐨勬按鏉冨唴姘撮噺閮ㄥ垎 -->
- <LinearLayout
+ <androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:visibility="gone">
+ app:cardCornerRadius="8dp"
+ app:cardElevation="2dp">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="姘存潈鍐呮按閲忥細"
- android:textSize="@dimen/new_card_size" />
-
- <EditText
- android:id="@+id/newCard_water"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:inputType="number"
- android:maxLength="5"
- android:textSize="@dimen/new_card_size" />
- </LinearLayout>
+ android:orientation="vertical"
+ android:padding="16dp">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dp"
+ android:text="鏀粯鏂瑰紡"
+ android:textColor="#333333"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <RadioGroup
+ android:id="@+id/newCard_paymentMethod"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <!-- 鍔ㄦ�佹坊鍔燫adioButton锛岀Щ闄ゅ浐瀹氱殑RadioButton -->
+ </RadioGroup>
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
</LinearLayout>
</ScrollView>
-
+
<TextView
android:id="@+id/newCard_registBtn"
android:layout_width="match_parent"
android:layout_height="56dp"
- android:layout_alignParentBottom="true"
- android:layout_marginStart="16dp"
- android:layout_marginEnd="16dp"
- android:layout_marginBottom="16dp"
- android:background="#4285F4"
+ android:background="@color/bottom_color"
android:gravity="center"
- android:text="纭寮�鎴�"
+ android:text="纭寮�鍗�"
android:textColor="#FFFFFF"
- android:textSize="16sp" />
-</RelativeLayout>
\ No newline at end of file
+ android:textSize="16sp"
+ android:visibility="gone"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
--
Gitblit v1.8.0