From c7134fe7128d26e27c4857ede8ec53221e914e6a Mon Sep 17 00:00:00 2001 From: TaiwanStar Developer Date: Mon, 15 Jun 2026 09:03:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E6=9B=B4=E6=96=B0=E7=99=BC?= =?UTF-8?q?=E7=A5=A8=E9=81=B8=E6=93=87=E5=B0=8D=E8=A9=B1=E6=A1=86=20UI=20?= =?UTF-8?q?=E4=BD=88=E5=B1=80=E7=82=BA=E5=9E=82=E7=9B=B4=E6=8E=92=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 將發票選擇對話框 (InvoiceTypeDialog) 根佈局改為 ConstraintLayout,並加入半透明深色背景。 - 將發票選項(手機條碼、捐贈發票、公司統編)改為垂直排列,並移除副標題文字。 - 新增 invoice_button_height 定義發票選項卡片的高度。 - 調整返回按鈕位置,並優化倒數計時文字顯示邏輯。 --- .../ui/dialog/InvoiceTypeDialog.java | 9 +- .../main/res/layout/dialog_invoice_type.xml | 313 +++++++++--------- app/src/main/res/values/dimens.xml | 3 + 3 files changed, 163 insertions(+), 162 deletions(-) diff --git a/app/src/main/java/com/unibuy/smartdevice/ui/dialog/InvoiceTypeDialog.java b/app/src/main/java/com/unibuy/smartdevice/ui/dialog/InvoiceTypeDialog.java index 4ce7f3f..df1194f 100644 --- a/app/src/main/java/com/unibuy/smartdevice/ui/dialog/InvoiceTypeDialog.java +++ b/app/src/main/java/com/unibuy/smartdevice/ui/dialog/InvoiceTypeDialog.java @@ -90,6 +90,13 @@ public class InvoiceTypeDialog extends DialogAbstract { binding = DialogInvoiceTypeBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); + android.view.Window window = getWindow(); + if (window != null) { + android.view.WindowManager.LayoutParams layoutParams = window.getAttributes(); + layoutParams.gravity = android.view.Gravity.CENTER; + window.setAttributes(layoutParams); + } + // 選擇:輸入載具(手機條碼) binding.cardVehicle.setOnClickListener(v -> { closeDialogCountdown.shutdown(); @@ -139,7 +146,7 @@ public class InvoiceTypeDialog extends DialogAbstract { } public void setButtonCancelText(long countdown) { - binding.buttonCancel.setText("返回支付方式(" + countdown + ")"); + binding.buttonCancel.setText("返回" + countdown + "秒"); } public static class CloseDialogOnThreadHandler extends HandlerMainCountdown { diff --git a/app/src/main/res/layout/dialog_invoice_type.xml b/app/src/main/res/layout/dialog_invoice_type.xml index a6f1def..48afd43 100644 --- a/app/src/main/res/layout/dialog_invoice_type.xml +++ b/app/src/main/res/layout/dialog_invoice_type.xml @@ -1,181 +1,172 @@ - + android:layout_height="match_parent" + android:background="@color/transparent"> - - + - - - - - + + android:layout_height="wrap_content" + android:gravity="center" + android:text="請選擇發票開立方式" + android:textColor="@color/primary" + android:textSize="36sp" + android:textStyle="bold" + android:letterSpacing="0.15" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - - - - - - - - - - - + + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingHorizontal="32dp" + app:layout_constraintBottom_toTopOf="@id/bottomButtonLayout" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/titleTextView"> - + + android:layout_height="@dimen/invoice_button_height" + android:layout_marginBottom="12dp" + android:clickable="true" + android:focusable="true" + android:foreground="?attr/selectableItemBackground" + app:cardBackgroundColor="@color/white" + app:cardCornerRadius="12dp" + app:cardElevation="2dp" + app:cardUseCompatPadding="true"> - + - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + android:layout_height="wrap_content" + android:gravity="center" + android:orientation="horizontal" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent"> - + android:layout_height="64dp" + android:backgroundTint="@color/warning" + android:text="返回40秒" + android:textColor="@color/white" + android:textSize="20sp" + app:cornerRadius="8dp" /> - + - + - - - - - - - - - - - - - + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 4aefb6d..5ee95a4 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -21,4 +21,7 @@ 72dp 8dp 16dp + + + 100dp \ No newline at end of file