[FEAT] Phase2 支付流程:移植 Travis 現金/玉山結帳對話框外觀
分區授權:checkout 對話框採 Travis 設計,邏輯沿用現有 main。 - dialog_checkout_cash_pay / dialog_checkout_esun_pay 換 Travis 版面 - 補回 buttonRetryEscrow(CashPayDialogGeneral 退鈔重試邏輯沿用),以新 Material 樣式呈現 - 新增 pay_* 付款圖檔、icon_network_poor/temperature、img_reload - 新增 colors infoContainer / surface Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
BIN
app/src/main/res/drawable/icon_network_poor.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
app/src/main/res/drawable/icon_temperature.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable/img_reload.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/pay_cash.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
app/src/main/res/drawable/pay_cash_method.png
Normal file
|
After Width: | Height: | Size: 336 KiB |
BIN
app/src/main/res/drawable/pay_credit_card_method.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
app/src/main/res/drawable/pay_show_qr_barcode.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
app/src/main/res/drawable/pay_show_qr_barcode_method.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
app/src/main/res/drawable/pay_smart_card_method.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
@ -11,7 +11,7 @@
|
||||
android:id="@+id/linearLayout4"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/light_gray"
|
||||
android:background="@color/surface"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@ -21,91 +21,179 @@
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:background="@color/error"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="center"
|
||||
android:text="現金支付"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="280dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="80dp"
|
||||
android:paddingVertical="30dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start|center_vertical"
|
||||
android:text="交易金額:"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="40sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end|center_vertical"
|
||||
android:text="NT$"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textPrice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="end|center_vertical"
|
||||
android:text="0"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="48sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutInCash"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start|center_vertical"
|
||||
android:text="已投入:"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="40sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end|center_vertical"
|
||||
android:text="NT$"
|
||||
android:textColor="#00AA00"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="end|center_vertical"
|
||||
android:text="0"
|
||||
android:textColor="#00AA00"
|
||||
android:textSize="48sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutRemaining"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start|center_vertical"
|
||||
android:text="未投入:"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="40sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end|center_vertical"
|
||||
android:text="NT$"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textStatus2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="end|center_vertical"
|
||||
android:text="0"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="48sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.1"
|
||||
android:gravity="center|end"
|
||||
android:text="訂單金額:"
|
||||
android:textColor="@color/error"
|
||||
android:textSize="40sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textPrice"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="0.9"
|
||||
android:gravity="center|start"
|
||||
android:text="0"
|
||||
android:textColor="@color/error"
|
||||
android:textSize="40sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="680dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:background="@color/white"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
android:id="@+id/textMessage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:textColor="@color/black"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/testOne"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="0.90"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:gravity="center"
|
||||
android:text="請投入硬幣或紙鈔"
|
||||
android:textColor="@color/error"
|
||||
android:textSize="80sp"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:paddingHorizontal="50dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/cash"
|
||||
android:src="@drawable/pay_cash_method"
|
||||
/>
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
app:srcCompat="@drawable/pay_cash" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="0.90"
|
||||
android:gravity="center"
|
||||
android:text="已投入的金額:"
|
||||
android:textColor="#0060E2"
|
||||
android:textSize="40sp"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:id="@+id/textStatus2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="0.90"
|
||||
android:gravity="center"
|
||||
android:text="未投入的金額:"
|
||||
android:textColor="#ff0000"
|
||||
android:textSize="40sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -126,43 +214,56 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonCancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="200dp"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:text="取消並退幣"
|
||||
android:textSize="28sp"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<Button
|
||||
android:backgroundTint="@color/warning"
|
||||
android:text="取消並退幣(45秒)"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
app:elevation="4dp"
|
||||
app:cornerRadius="8dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonChange"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:paddingHorizontal="0dp"
|
||||
android:backgroundTint="@color/infoContainer"
|
||||
android:text="@string/replacement_payment"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
android:textSize="28sp"
|
||||
android:textColor="@color/black" />
|
||||
app:elevation="4dp"
|
||||
app:cornerRadius="8dp" />
|
||||
|
||||
<Button
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonRetryEscrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="200dp"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="#FF9800"
|
||||
android:backgroundTint="@color/warning"
|
||||
android:text="嘗試退鈔並重試"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
android:textSize="28sp"
|
||||
android:textColor="@color/white" />
|
||||
app:elevation="4dp"
|
||||
app:cornerRadius="8dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -11,7 +11,7 @@
|
||||
android:id="@+id/linearLayout4"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/light_gray"
|
||||
android:background="@color/surface"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@ -21,73 +21,89 @@
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:background="@color/error"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="center"
|
||||
android:text="@string/shopping_cart_esun_payment_checkout"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="280dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingVertical="30dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="交易金額:"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="40sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="NT$"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="48sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textPrice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="48sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.10"
|
||||
android:gravity="center|end"
|
||||
android:text="@string/transaction_amount"
|
||||
android:textColor="@color/error"
|
||||
android:textSize="30sp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="請將付款條碼對準掃描器"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textPrice"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="0.90"
|
||||
android:gravity="center|start"
|
||||
android:text="0"
|
||||
android:textColor="@color/error"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="280dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textStatus"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="0.90"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/transaction_status"
|
||||
android:textColor="@color/error"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
android:text="交易狀態:等待掃描條碼"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="" />
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="50dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="100dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
@ -98,37 +114,57 @@
|
||||
android:id="@+id/imageCheckout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="100dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
app:srcCompat="@drawable/checkout_barcode" />
|
||||
app:srcCompat="@drawable/pay_show_qr_barcode_method" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
app:srcCompat="@drawable/pay_show_qr_barcode" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonCancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:text="@string/cancel_40"
|
||||
android:textSize="20sp"
|
||||
android:textColor="@color/black" />
|
||||
android:paddingHorizontal="0dp"
|
||||
android:backgroundTint="@color/warning"
|
||||
android:text="取消支付(40秒)"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
app:elevation="4dp"
|
||||
app:cornerRadius="8dp" />
|
||||
|
||||
<Button
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonChange"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:text="@string/replacement_payment"
|
||||
android:textSize="20sp"
|
||||
android:textColor="@color/black" />
|
||||
android:paddingHorizontal="0dp"
|
||||
android:backgroundTint="@color/infoContainer"
|
||||
android:text="修改支付方式"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
app:elevation="4dp"
|
||||
app:cornerRadius="8dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
工具色
|
||||
═══════════════════════════════════════════ -->
|
||||
<color name="transparent_black">#AA000000</color> <!-- 遮罩層 -->
|
||||
<color name="surface">#F8F9FF</color> <!-- 卡片/面板底色(Travis 支付/發票沿用) -->
|
||||
|
||||
<!-- ═══════════════════════════════════════════
|
||||
語意色(兩層架構:色 / on色)
|
||||
@ -27,6 +28,7 @@
|
||||
<!-- Info 提示(次要說明、補充資訊) -->
|
||||
<color name="info">#00639B</color>
|
||||
<color name="onInfo">#FFFFFF</color>
|
||||
<color name="infoContainer">#D1E4FF</color> <!-- Info 容器底色(Travis 支付/發票沿用) -->
|
||||
|
||||
<!-- Success 成功 -->
|
||||
<color name="success">#2E7D32</color>
|
||||
|
||||