From 040f1aba13b179ff318366680a6346af7fd97795 Mon Sep 17 00:00:00 2001 From: zuoxiao <470321431@qq.com> Date: 星期五, 11 四月 2025 16:11:23 +0800 Subject: [PATCH] feat(generallibrary): 新增补卡功能并优化底部导航栏 --- generallibrary/src/main/res/layout/fragment_recharge.xml | 428 ++++++++++++++++++++++++++-------------------------- 1 files changed, 213 insertions(+), 215 deletions(-) diff --git a/generallibrary/src/main/res/layout/fragment_recharge.xml b/generallibrary/src/main/res/layout/fragment_recharge.xml index e9971e8..0c190b0 100644 --- a/generallibrary/src/main/res/layout/fragment_recharge.xml +++ b/generallibrary/src/main/res/layout/fragment_recharge.xml @@ -3,54 +3,73 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="#F5F5F5"> + android:background="@color/base_green_bg"> - <com.dayu.baselibrary.view.TitleBar - android:id="@+id/titleBar" - android:layout_width="match_parent" - android:layout_height="@dimen/dimen_title_height" - android:background="@color/title_bar_bg" - android:elevation="4dp" - app:centerText="鎴戠殑" /> <LinearLayout android:id="@+id/recharge_read_LL" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_below="@+id/titleBar" + android:gravity="center" android:orientation="vertical" android:visibility="visible"> <androidx.cardview.widget.CardView android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_margin="16dp" app:cardCornerRadius="8dp" + app:cardElevation="2dp"> - <LinearLayout + <RelativeLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" + android:layout_height="match_parent" android:padding="16dp"> <TextView + android:id="@+id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_marginTop="10dp" android:layout_marginBottom="16dp" android:gravity="center" - android:text="璇峰皢鍗¤创鍦ㄨ澶囦笂杩涜璇诲崱" - android:textColor="#333333" - android:textSize="@dimen/text_size" + android:text="鍏呭�艰鍗�" + android:textColor="@color/base_blue_bg" + android:textSize="@dimen/big_text_size" android:textStyle="bold" /> - <ImageView - android:layout_width="200dp" - android:layout_height="200dp" - android:layout_gravity="center" - android:scaleType="fitCenter" - android:src="@mipmap/nfc_write" /> - </LinearLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:orientation="vertical"> + + <TextView + android:id="@+id/textView2" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_marginBottom="40dp" + android:gravity="center" + + android:text="璇峰皢鍗¤创鍦ㄨ澶囦笂杩涜璇诲崱" + android:textColor="#333333" + android:textSize="@dimen/text_size" + android:textStyle="bold" /> + + <ImageView + android:layout_width="200dp" + android:layout_height="200dp" + android:layout_below="@+id/textView2" + android:layout_centerHorizontal="true" + android:layout_gravity="center" + android:scaleType="fitCenter" + android:src="@mipmap/nfc_write" /> + </LinearLayout> + + </RelativeLayout> </androidx.cardview.widget.CardView> </LinearLayout> @@ -58,8 +77,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@+id/recharge_registBtn" - android:layout_below="@+id/header_layout" - android:fillViewport="true"> + android:fillViewport="true" + android:visibility="gone"> <LinearLayout android:layout_width="match_parent" @@ -72,68 +91,13 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:visibility="gone"> + android:visibility="visible"> + <androidx.cardview.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" - - app:cardCornerRadius="8dp" - app:cardElevation="2dp"> - - <LinearLayout - android:id="@+id/recharge_LL" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - android:padding="16dp"> - - - <TextView - android:id="@+id/red_recharge_water" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:text="鍏呭�兼按閲忥細" - android:textColor="#333333" - android:textSize="@dimen/text_size" - android:visibility="gone" /> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="#F9F9F9" - android:orientation="vertical" - android:padding="12dp"> - - <TextView - android:id="@+id/recharge_tx" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:text="鍏呭�奸噾棰濓紙鍏冿級锛�" - android:textColor="@color/red" - android:textSize="@dimen/new_card_size" - android:textStyle="bold" /> - - <EditText - android:id="@+id/recharge_water" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@android:color/white" - android:hint="璇疯緭鍏ュ厖鍊肩殑閲戦" - android:inputType="numberDecimal" - android:padding="12dp" - 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_marginTop="15dp" - android:layout_marginBottom="16dp" + android:layout_marginBottom="10dp" app:cardCornerRadius="8dp" app:cardElevation="2dp"> @@ -141,7 +105,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:padding="16dp"> + android:padding="12dp"> <TextView android:layout_width="match_parent" @@ -155,49 +119,7 @@ <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:orientation="horizontal"> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="鍗$姸鎬侊細" - android:textColor="#666666" - android:textSize="@dimen/text_size" /> - - <TextView - android:id="@+id/red_statu" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:textColor="@color/red" - android:textSize="@dimen/new_card_size" /> - </LinearLayout> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:orientation="horizontal"> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="濮撳悕锛�" - android:textColor="#666666" - android:textSize="@dimen/new_card_size" /> - - <TextView - android:id="@+id/userName" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:textColor="#333333" - android:textSize="@dimen/new_card_size" /> - </LinearLayout> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" + android:layout_marginBottom="5dp" android:orientation="horizontal"> <TextView @@ -219,7 +141,50 @@ <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" + android:layout_marginBottom="5dp" + android:orientation="horizontal"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="鍗$姸鎬侊細" + android:textColor="#666666" + android:textSize="@dimen/text_size" /> + + <TextView + android:id="@+id/red_statu" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="@color/red" + android:textSize="@dimen/new_card_size" /> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="5dp" + android:orientation="horizontal"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="濮撳悕锛�" + android:textColor="#666666" + android:textSize="@dimen/new_card_size" /> + + <TextView + android:id="@+id/userName" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="#333333" + android:textSize="@dimen/new_card_size" /> + </LinearLayout> + + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="5dp" android:orientation="horizontal"> <TextView @@ -241,14 +206,14 @@ <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" + android:layout_marginBottom="5dp" android:orientation="horizontal" android:visibility="visible"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="鍏呭�煎悗鍓╀綑閲戦锛�" + android:text="褰撳墠浣欓锛�" android:textColor="#666666" android:textSize="@dimen/text_size" /> @@ -265,7 +230,73 @@ <androidx.cardview.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="16dp" + + app:cardCornerRadius="8dp" + app:cardElevation="2dp"> + + <LinearLayout + android:id="@+id/recharge_LL" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="12dp"> + + + <TextView + android:id="@+id/red_recharge_water" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="8dp" + android:text="鍏呭�兼按閲忥細" + android:textColor="#333333" + android:textSize="@dimen/text_size" + android:visibility="gone" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/base_green_bg" + android:orientation="vertical" + android:padding="12dp"> + + <TextView + android:id="@+id/recharge_tx" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="8dp" + android:text="鍏呭�奸噾棰濓紙鍏冿級锛�" + android:textColor="@color/red" + android:textSize="@dimen/new_card_size" + android:textStyle="bold" /> + + <EditText + android:id="@+id/recharge_morny" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@android:color/white" + android:hint="璇疯緭鍏ュ厖鍊肩殑閲戦" + android:inputType="numberDecimal" + android:padding="5dp" + android:textSize="@dimen/new_card_size" /> + + <EditText + android:id="@+id/recharge_water" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="5dp" + android:background="@android:color/white" + android:hint="璇疯緭鍏ヨ禒閫佺殑閲戦(閫夊~)" + android:inputType="numberDecimal" + android:padding="5dp" + 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_marginTop="10dp" app:cardCornerRadius="8dp" app:cardElevation="2dp"> @@ -273,103 +304,67 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:padding="16dp"> + android:padding="12dp"> <TextView - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="12dp" - android:text="鐢甸噺淇℃伅" + android:layout_marginBottom="10dp" + android:text="鏀粯鏂瑰紡" android:textColor="#333333" - android:textSize="16sp" + android:textSize="18sp" android:textStyle="bold" /> - <TextView - android:id="@+id/red_balance_electric" + <RadioGroup + android:id="@+id/newCard_paymentMethod" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:background="#F9F9F9" - android:padding="12dp" - android:text="鍓╀綑鐢甸噺锛�" - android:textColor="#333333" - android:textSize="@dimen/text_size" - android:visibility="visible" /> + android:orientation="horizontal"> - <TextView - android:id="@+id/red_rechargeDate" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:background="#F9F9F9" - android:padding="12dp" - android:text="鏈�鍚庤喘姘存棩鏈燂細" - android:textColor="#333333" - android:textSize="@dimen/text_size" - android:visibility="visible" /> + <RadioButton + android:id="@+id/newCard_cashPayment" + android:layout_width="0dp" + android:layout_height="40dp" + android:layout_marginRight="15dp" + android:layout_weight="1" + android:background="@drawable/radio_selector" + android:button="@null" + android:checked="true" + android:gravity="center" - <TextView - android:id="@+id/red_rechargeElectric" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:background="#F9F9F9" - android:padding="12dp" - android:text="鐢甸噺鍗曚环锛�" - android:textColor="#333333" - android:textSize="@dimen/text_size" - android:visibility="visible" /> + android:text="鐜伴噾" + android:textColor="@color/radio_button_text_color" + android:textSize="@dimen/new_card_size" /> - <TextView - android:id="@+id/red_rechargeNumber" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:background="#F9F9F9" - android:padding="12dp" - android:text="鍏呭�兼鏁帮細" - android:textColor="#333333" - android:textSize="@dimen/text_size" - android:visibility="gone" /> + <RadioButton + android:id="@+id/newCard_posPayment" + android:layout_width="0dp" + android:layout_height="40dp" + android:layout_marginRight="15dp" + android:layout_weight="1" + android:background="@drawable/radio_selector" + android:button="@null" + android:gravity="center" - <TextView - android:id="@+id/red_total_water" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:background="#F9F9F9" - android:padding="12dp" - android:text="鎬荤敤姘撮噺锛�" - android:textColor="#333333" - android:textSize="@dimen/text_size" - android:visibility="gone" /> + android:text="POS鏈�" + android:textColor="@color/radio_button_text_color" + android:textSize="@dimen/new_card_size" /> - <TextView - android:id="@+id/red_total_power" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:background="#F9F9F9" - android:padding="12dp" - android:text="鎬荤敤鐢甸噺锛�" - android:textColor="#333333" - android:textSize="@dimen/text_size" - android:visibility="gone" /> + <RadioButton + android:id="@+id/newCard_bankTransfer" + android:layout_width="0dp" + android:layout_height="40dp" + android:layout_weight="1" + android:background="@drawable/radio_selector" + android:button="@null" + android:gravity="center" - <TextView - android:id="@+id/red_waterPrice" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="#F9F9F9" - android:padding="12dp" - android:text="姣忕珛鏂圭背姘翠环鏍硷細" - android:textColor="#333333" - android:textSize="@dimen/text_size" - android:visibility="gone" /> + android:text="閾惰杞处" + android:textColor="@color/radio_button_text_color" + android:textSize="@dimen/new_card_size" /> + </RadioGroup> </LinearLayout> </androidx.cardview.widget.CardView> - - </LinearLayout> </LinearLayout> </ScrollView> @@ -379,11 +374,14 @@ android:layout_width="match_parent" android:layout_height="50dp" android:layout_alignParentBottom="true" - android:layout_margin="16dp" - android:background="@drawable/rounded_button_bg" + android:layout_marginLeft="16dp" + android:layout_marginTop="10dp" + android:layout_marginRight="16dp" + android:layout_marginBottom="10dp" + android:background="@drawable/recharge_button_ripple" android:elevation="2dp" android:gravity="center" - android:text="鍏呭��" + android:text="涓嬩竴姝ワ紙鍐欏崱锛�" android:textColor="@color/white" android:textSize="@dimen/new_card_size" android:textStyle="bold" -- Gitblit v1.8.0