Merge remote-tracking branch 'origin/ui-design' into feat/general-cart-and-payment
# Conflicts: # app/src/main/java/com/unibuy/v2/adapter/CartOperationAdapter.kt
This commit is contained in:
commit
a80bb4dd85
@ -88,6 +88,7 @@ public abstract class DialogAbstract extends AlertDialog {
|
||||
// 設定對話框寬度為螢幕的 90%
|
||||
Window window = getWindow();
|
||||
if (window != null) {
|
||||
window.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT));
|
||||
WindowManager.LayoutParams layoutParams = window.getAttributes();
|
||||
// layoutParams.width = (int) (getContext().getResources().getDisplayMetrics().widthPixels * 0.9);
|
||||
|
||||
@ -97,8 +98,8 @@ public abstract class DialogAbstract extends AlertDialog {
|
||||
// 設定高度為包裹內容(可調整為 MATCH_PARENT)
|
||||
layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
|
||||
// 設定對話框貼齊底部
|
||||
layoutParams.gravity = Gravity.BOTTOM;
|
||||
// 設定對話框居中顯示
|
||||
layoutParams.gravity = Gravity.CENTER;
|
||||
|
||||
window.setAttributes(layoutParams);
|
||||
getSrcHandlerMain().start(getClass().getSimpleName(), FontendActivity.Option.HIDE_SALE_OVERLAY.getOption(), "hide sale overlay");
|
||||
|
||||
@ -91,22 +91,18 @@ public class RecyclerVmcBuyListAdpter extends RecyclerView.Adapter<RecyclerVmcBu
|
||||
boolean isLock = slot.isLock();
|
||||
|
||||
int price = machinePrice > 0 ? machinePrice : sellingPrice;
|
||||
if (price > 0) {
|
||||
holder.binding.textPrice.setVisibility(View.VISIBLE);
|
||||
holder.binding.textPrice.setText("NT$ " + price);
|
||||
} else {
|
||||
holder.binding.textPrice.setVisibility(View.GONE);
|
||||
}
|
||||
holder.binding.textPrice.setVisibility(View.VISIBLE);
|
||||
holder.binding.textPrice.setText("NT$ " + price);
|
||||
|
||||
// 綁定庫存數量顯示
|
||||
holder.binding.textStock.setText("庫存: " + count);
|
||||
holder.binding.textStock.setText("庫存" + count);
|
||||
|
||||
holder.binding.mask.setVisibility(View.GONE);
|
||||
holder.binding.textMask.setText("");
|
||||
|
||||
if (count <= 0) {
|
||||
holder.binding.mask.setVisibility(View.VISIBLE);
|
||||
holder.binding.textMask.setText("補貨中");// 已經售完
|
||||
holder.binding.textMask.setText("售完");
|
||||
}
|
||||
|
||||
if (isLock) {
|
||||
|
||||
@ -144,6 +144,18 @@ public class CheckoutAccessCodeDialog extends DialogAbstract {
|
||||
openBarcode = true;
|
||||
httpAPI = new HttpAPI(getHandlerMain());
|
||||
|
||||
setInputMode(true);
|
||||
|
||||
binding.btnModeKeypad.setOnClickListener(v -> {
|
||||
setInputMode(true);
|
||||
if (closeDialogCountdown != null) closeDialogCountdown.setCountdown(40);
|
||||
});
|
||||
|
||||
binding.btnModeScan.setOnClickListener(v -> {
|
||||
setInputMode(false);
|
||||
if (closeDialogCountdown != null) closeDialogCountdown.setCountdown(40);
|
||||
});
|
||||
|
||||
binding.buttonFinish.setOnClickListener(v -> changeOk());
|
||||
binding.buttonCancel.setOnClickListener(v -> changeBuy());
|
||||
|
||||
@ -297,6 +309,14 @@ public class CheckoutAccessCodeDialog extends DialogAbstract {
|
||||
}
|
||||
}
|
||||
|
||||
private void setInputMode(boolean isKeyboard) {
|
||||
binding.btnModeKeypad.setSelected(isKeyboard);
|
||||
binding.btnModeScan.setSelected(!isKeyboard);
|
||||
|
||||
binding.linearNumpad.setVisibility(isKeyboard ? android.view.View.VISIBLE : android.view.View.GONE);
|
||||
binding.imageViewScanHint.setVisibility(isKeyboard ? android.view.View.GONE : android.view.View.VISIBLE);
|
||||
}
|
||||
|
||||
public int getTotalPrice() {
|
||||
int totalPrice = 0;
|
||||
if (MyApp.getInstance().getBuyList().size() == 0) return totalPrice;
|
||||
|
||||
@ -137,6 +137,18 @@ public class CheckoutFreeGiftCodeDialog extends DialogAbstract {
|
||||
openBarcode = true;
|
||||
httpAPI = new HttpAPI(getHandlerMain());
|
||||
|
||||
setInputMode(true);
|
||||
|
||||
binding.btnModeKeypad.setOnClickListener(v -> {
|
||||
setInputMode(true);
|
||||
if (closeDialogCountdown != null) closeDialogCountdown.setCountdown(40);
|
||||
});
|
||||
|
||||
binding.btnModeScan.setOnClickListener(v -> {
|
||||
setInputMode(false);
|
||||
if (closeDialogCountdown != null) closeDialogCountdown.setCountdown(40);
|
||||
});
|
||||
|
||||
binding.buttonFinish.setOnClickListener(v -> changeOk());
|
||||
binding.buttonCancel.setOnClickListener(v -> changeBuy());
|
||||
|
||||
@ -287,6 +299,14 @@ public class CheckoutFreeGiftCodeDialog extends DialogAbstract {
|
||||
}
|
||||
}
|
||||
|
||||
private void setInputMode(boolean isKeyboard) {
|
||||
binding.btnModeKeypad.setSelected(isKeyboard);
|
||||
binding.btnModeScan.setSelected(!isKeyboard);
|
||||
|
||||
binding.linearNumpad.setVisibility(isKeyboard ? android.view.View.VISIBLE : android.view.View.GONE);
|
||||
binding.imageViewScanHint.setVisibility(isKeyboard ? android.view.View.GONE : android.view.View.VISIBLE);
|
||||
}
|
||||
|
||||
public int getTotalPrice() {
|
||||
int totalPrice = 0;
|
||||
if (MyApp.getInstance().getBuyList().size() == 0) return totalPrice;
|
||||
|
||||
@ -180,6 +180,18 @@ public class FontendPickupCodeDialog extends DialogAbstract {
|
||||
|
||||
MyApp.getInstance().initialReportData();
|
||||
|
||||
setInputMode(true);
|
||||
|
||||
binding.btnModeKeypad.setOnClickListener(v -> {
|
||||
setInputMode(true);
|
||||
if (closeDialogCountdown != null) closeDialogCountdown.setCountdown(40);
|
||||
});
|
||||
|
||||
binding.btnModeScan.setOnClickListener(v -> {
|
||||
setInputMode(false);
|
||||
if (closeDialogCountdown != null) closeDialogCountdown.setCountdown(40);
|
||||
});
|
||||
|
||||
isChangeDispatch = true;
|
||||
openBarcode = true;
|
||||
httpAPI = new HttpAPI(getHandlerMain());
|
||||
@ -295,6 +307,14 @@ public class FontendPickupCodeDialog extends DialogAbstract {
|
||||
}
|
||||
}
|
||||
|
||||
private void setInputMode(boolean isKeyboard) {
|
||||
binding.btnModeKeypad.setSelected(isKeyboard);
|
||||
binding.btnModeScan.setSelected(!isKeyboard);
|
||||
|
||||
binding.linearNumpad.setVisibility(isKeyboard ? android.view.View.VISIBLE : android.view.View.GONE);
|
||||
binding.imageViewScanHint.setVisibility(isKeyboard ? android.view.View.GONE : android.view.View.VISIBLE);
|
||||
}
|
||||
|
||||
public class ReadBarCodeOnScheduler extends HandlerMainScheduler {
|
||||
public ReadBarCodeOnScheduler(HandlerMain handlerMain) {
|
||||
super(handlerMain);
|
||||
@ -471,7 +491,7 @@ public class FontendPickupCodeDialog extends DialogAbstract {
|
||||
}
|
||||
|
||||
public void setButtonCancelText(long countdown) {
|
||||
binding.buttonCancel.setText(getContext().getString(R.string.return_to)+"("+countdown+")");//返回
|
||||
binding.buttonCancel.setText("取消 " + countdown + "秒");
|
||||
}
|
||||
|
||||
public void setStatusText(String message) {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.unibuy.v2.adapter
|
||||
|
||||
import android.graphics.PorterDuff
|
||||
import android.widget.ImageView
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.unibuy.smartdevice.R
|
||||
@ -12,6 +14,11 @@ import com.unibuy.v2.UnibuyHelper
|
||||
/**
|
||||
* 購物車品項清單 Adapter(自 Luzui v2 移植)。
|
||||
* 依賴 BaseRecyclerViewAdapterHelper 的 BaseQuickAdapter。
|
||||
*
|
||||
* Disabled 按鈕規則:
|
||||
* - buttonMinus:當 cartSelectedCount == 1 時 disabled(最低 1 件,不允許繼續減少)
|
||||
* - buttonPlus :當 cartSelectedCount >= slot.count(庫存上限)或全車總件數 >= 8 時 disabled
|
||||
* Disabled 外觀:背景換 bg_quantity_button_disabled、圖示染灰(#ADADAD)、clickable = false。
|
||||
*/
|
||||
class CartOperationAdapter(layoutResId: Int, data: MutableList<SlotStructure>) :
|
||||
BaseQuickAdapter<SlotStructure, BaseViewHolder>(layoutResId, data) {
|
||||
@ -22,19 +29,65 @@ class CartOperationAdapter(layoutResId: Int, data: MutableList<SlotStructure>) :
|
||||
|
||||
override fun convert(holder: BaseViewHolder, item: SlotStructure) {
|
||||
val result = UnibuyHelper.getCartViewModel().createResult(item)
|
||||
val ctx = holder.itemView.context
|
||||
|
||||
// 多國語商品名稱(統一由 ProductStructure 處理,英/日未翻譯自動 fallback 中文)
|
||||
val name = item.product.getLocalizedName(holder.itemView.context)
|
||||
// 多國語商品名稱(統一由 ProductStructure 處理:i18n map → zh_TW → 舊 _en/_jp → 中文主值)
|
||||
val name = item.product.getLocalizedName(ctx)
|
||||
|
||||
holder.setText(R.id.textProductName, name)
|
||||
.setText(R.id.totalPriceTextView, "NT$ ${result.currentItemPrice}")
|
||||
.setText(R.id.textStock, String.format("庫存%02d件", item.count))
|
||||
.setText(R.id.textQuantity, "${result.currentItemCount}")
|
||||
.setText(R.id.textPrice, "NT$ ${item.product.realPrice}")
|
||||
|
||||
// ── 商品圖片 ────────────────────────────────────────────────────
|
||||
val imageProductPicture = holder.getView<ImageView>(R.id.image_product)
|
||||
try {
|
||||
ImageGlide(imageProductPicture.context).fileload(item.product.productImg, imageProductPicture)
|
||||
} catch (e: LogsEmptyException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
// ── 按鈕 Disabled 狀態判斷 ──────────────────────────────────────
|
||||
val buttonMinus = holder.getView<ImageView>(R.id.buttonMinus)
|
||||
val buttonPlus = holder.getView<ImageView>(R.id.buttonPlus)
|
||||
|
||||
val isAtMinCount = item.cartSelectedCount <= 1
|
||||
val isAtStockLimit = item.cartSelectedCount >= item.count
|
||||
val isCartFull = UnibuyHelper.getCartViewModel().hasMinimumCartItems()
|
||||
val isPlusDisabled = isAtStockLimit || isCartFull
|
||||
|
||||
// ── 減少按鈕 ────────────────────────────────────────────────────
|
||||
applyButtonState(buttonMinus, disabled = isAtMinCount, ctx)
|
||||
|
||||
// ── 增加按鈕 ────────────────────────────────────────────────────
|
||||
applyButtonState(buttonPlus, disabled = isPlusDisabled, ctx)
|
||||
}
|
||||
|
||||
/**
|
||||
* 套用啟用 / 停用外觀到 ImageView 按鈕。
|
||||
*
|
||||
* @param button 目標按鈕
|
||||
* @param disabled true = 停用(light_gray 背景 + 灰色圖示 + 不可點擊)
|
||||
* @param ctx Context(取色用)
|
||||
*/
|
||||
private fun applyButtonState(button: ImageView, disabled: Boolean, ctx: android.content.Context) {
|
||||
if (disabled) {
|
||||
button.setBackgroundResource(R.drawable.bg_quantity_button_disabled)
|
||||
// setBackgroundResource 會重置 stateListAnimator,需立刻清除以防止陰影跳動
|
||||
button.stateListAnimator = null
|
||||
button.setColorFilter(
|
||||
ContextCompat.getColor(ctx, R.color.gray),
|
||||
PorterDuff.Mode.SRC_IN
|
||||
)
|
||||
button.isClickable = false
|
||||
} else {
|
||||
button.setBackgroundResource(R.drawable.bg_quantity_outline_button)
|
||||
// setBackgroundResource 會重置 stateListAnimator,需立刻清除以防止陰影跳動
|
||||
button.stateListAnimator = null
|
||||
button.clearColorFilter()
|
||||
button.isClickable = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -200,6 +200,12 @@ public class ShoppingCartFragment extends FragmentAbstract {
|
||||
allCartItems = UnibuyHelper.INSTANCE.getCartViewModel().getAllCartItems();
|
||||
binding.totalItemsTextView.setText(getString(R.string.total_items_format, allCartItems.getTotalCount()));
|
||||
binding.totalAmountTextView.setText(getString(R.string.total_amount_format, allCartItems.getTotalPrice()));
|
||||
|
||||
if (UnibuyHelper.INSTANCE.getCartViewModel().hasMinimumCartItems()) {
|
||||
binding.maxItemsWarningTextView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
binding.maxItemsWarningTextView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
/** 清空購物車並切回 VMC 商品列表。 */
|
||||
|
||||
5
app/src/main/res/color/color_input_mode_bg.xml
Normal file
5
app/src/main/res/color/color_input_mode_bg.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true" android:color="@color/primary" />
|
||||
<item android:color="@android:color/transparent" />
|
||||
</selector>
|
||||
5
app/src/main/res/color/color_input_mode_text.xml
Normal file
5
app/src/main/res/color/color_input_mode_text.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true" android:color="@color/white" />
|
||||
<item android:color="@color/black" />
|
||||
</selector>
|
||||
8
app/src/main/res/drawable/bg_input_outline.xml
Normal file
8
app/src/main/res/drawable/bg_input_outline.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="8dp" />
|
||||
<stroke
|
||||
android:width="1.5dp"
|
||||
android:color="@color/outline" />
|
||||
<solid android:color="@color/cardSurface" />
|
||||
</shape>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 停用狀態背景:light_gray -->
|
||||
<solid android:color="@color/light_gray" />
|
||||
<!-- 與啟用按鈕同款圓角 -->
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
@ -1,12 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 頁面背景色 -->
|
||||
<solid android:color="@color/background" />
|
||||
<!-- 黑色外框線 -->
|
||||
<stroke
|
||||
android:width="1.5dp"
|
||||
android:color="@color/black" />
|
||||
<!-- 圓角 -->
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/light_gray">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<!-- 頁面背景色 -->
|
||||
<solid android:color="@color/background" />
|
||||
<!-- 黑色外框線 -->
|
||||
<stroke
|
||||
android:width="1.5dp"
|
||||
android:color="@color/black" />
|
||||
<!-- 圓角 -->
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
5
app/src/main/res/drawable/bg_rounded_card_surface.xml
Normal file
5
app/src/main/res/drawable/bg_rounded_card_surface.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="16dp" />
|
||||
<solid android:color="@color/cardSurface" />
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/bg_rounded_light_gray.xml
Normal file
6
app/src/main/res/drawable/bg_rounded_light_gray.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/light_gray" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/bg_rounded_primary.xml
Normal file
6
app/src/main/res/drawable/bg_rounded_primary.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/primary" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
5
app/src/main/res/drawable/bg_rounded_surface.xml
Normal file
5
app/src/main/res/drawable/bg_rounded_surface.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="30dp" />
|
||||
<solid android:color="@color/background" />
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/bg_segmented_container.xml
Normal file
6
app/src/main/res/drawable/bg_segmented_container.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/cardSurface" />
|
||||
<corners android:radius="32dp" />
|
||||
|
||||
</shape>
|
||||
@ -1,12 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 頁面背景色 -->
|
||||
<solid android:color="@color/background" />
|
||||
<!-- 警告色外框線 -->
|
||||
<stroke
|
||||
android:width="1.5dp"
|
||||
android:color="@color/warning" />
|
||||
<!-- 圓角 -->
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/light_gray">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<!-- 頁面背景色 -->
|
||||
<solid android:color="@color/background" />
|
||||
<!-- 警告色外框線 -->
|
||||
<stroke
|
||||
android:width="1.5dp"
|
||||
android:color="@color/warning" />
|
||||
<!-- 圓角 -->
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
9
app/src/main/res/drawable/keyboard_alt_24.xml
Normal file
9
app/src/main/res/drawable/keyboard_alt_24.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M20,5H4C2.9,5 2,5.9 2,7v10c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V7C22,5.9 21.1,5 20,5zM11,8h2v2h-2V8zM11,11h2v2h-2V11zM8,8h2v2H8V8zM8,11h2v2H8V11zM7,13H5v-2h2V13zM7,10H5V8h2V10zM16,17H8v-2h8V17zM16,13h-2v-2h2V13zM16,10h-2V8h2V10zM19,13h-2v-2h2V13zM19,10h-2V8h2V10z"/>
|
||||
</vector>
|
||||
9
app/src/main/res/drawable/keyboard_backspace_24.xml
Normal file
9
app/src/main/res/drawable/keyboard_backspace_24.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M21,11H6.83l3.58,-3.59L9,6l-6,6 6,6 1.41,-1.41L6.83,13H21v-2z"/>
|
||||
</vector>
|
||||
12
app/src/main/res/drawable/qr_code_scanner_24.xml
Normal file
12
app/src/main/res/drawable/qr_code_scanner_24.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M9.5,2h5v5h-5zM2,9.5h5v5h-5zM2,17h5v5h-5zM9.5,17h5v5h-5zM17,17h5v5h-5zM9.5,9.5h5v5h-5zM17,9.5h5v5h-5z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M22,7h-5L17,2h-2v7h7zM19,17h3v-2h-3v-3h-2v7h5v-2zM21,21h-2v-2h-2v3h5v-3h-1zM2,2h5v5L2,7zM3,3v3h3L6,3zM10.5,3v3h3L13.5,3zM3,10.5v3h3v-3zM10.5,10.5v3h3v-3zM3,18v3h3v-3zM10.5,18v3h3v-3zM18,18v3h3v-3z"/>
|
||||
</vector>
|
||||
@ -6,12 +6,12 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/transparent">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
<LinearLayout
|
||||
android:id="@+id/cardView"
|
||||
android:layout_width="540dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="@color/surface"
|
||||
app:cardCornerRadius="30dp"
|
||||
android:background="@drawable/bg_rounded_surface"
|
||||
android:clipToOutline="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@ -20,7 +20,10 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="32dp"
|
||||
android:paddingBottom="24dp">
|
||||
|
||||
<TextView
|
||||
@ -38,6 +41,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
@ -57,9 +61,36 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutInputModeSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:background="@drawable/bg_segmented_container"
|
||||
android:padding="4dp"
|
||||
android:elevation="2dp"
|
||||
android:translationZ="3dp"
|
||||
android:outlineProvider="background"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnModeKeypad"
|
||||
style="@style/Widget.App.InputModeButton"
|
||||
android:text="鍵盤輸入" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnModeScan"
|
||||
style="@style/Widget.App.InputModeButton"
|
||||
android:text="掃描條碼" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -73,171 +104,100 @@
|
||||
android:layout_height="60dp"
|
||||
android:textSize="28sp"
|
||||
android:hint="@string/passcode"
|
||||
android:background="@color/white"
|
||||
android:background="@drawable/bg_input_outline"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:textColor="@color/black"
|
||||
android:gravity="center"
|
||||
android:inputType="number"
|
||||
android:maxLength="8" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Number pads -->
|
||||
<!-- Number pads & QRCode -->
|
||||
<LinearLayout
|
||||
android:id="@+id/linearNumpad"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button11"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button12"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="2" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button13"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:text="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button14"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="4" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button15"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="5" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button16"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:text="6" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button17"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="7" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button18"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="8" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button19"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:text="9" />
|
||||
</LinearLayout>
|
||||
|
||||
@ -245,56 +205,43 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 清空 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonC1"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
app:cornerRadius="16dp"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
android:text="C"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
app:icon="@drawable/close_24" />
|
||||
|
||||
<!-- 0 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button10"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="0" />
|
||||
|
||||
<!-- 退格 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonR1"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
android:text="←" />
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
app:icon="@drawable/keyboard_backspace_24" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageViewScanHint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/pay_show_qr_barcode"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部按鈕 -->
|
||||
@ -303,15 +250,25 @@
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonCancel"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
app:backgroundTint="@color/warning"
|
||||
android:elevation="8dp"
|
||||
app:elevation="8dp"
|
||||
android:translationZ="3dp"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:insetLeft="0dp"
|
||||
android:insetRight="0dp"
|
||||
android:padding="0dp"
|
||||
android:text="@string/return_to_40"
|
||||
android:textSize="26sp"
|
||||
app:cornerRadius="12dp"
|
||||
@ -319,16 +276,25 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonFinish"
|
||||
style="@style/Widget.Material3.Button"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="64dp"
|
||||
app:backgroundTint="@color/primary"
|
||||
app:rippleColor="#33FFFFFF"
|
||||
android:elevation="8dp"
|
||||
app:elevation="8dp"
|
||||
android:translationZ="3dp"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:insetLeft="0dp"
|
||||
android:insetRight="0dp"
|
||||
android:padding="0dp"
|
||||
android:text="@string/input_complete"
|
||||
android:textSize="26sp"
|
||||
app:cornerRadius="12dp"
|
||||
android:textColor="@color/white" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -3,192 +3,298 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/light_gray">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/transparent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="0dp"
|
||||
android:id="@+id/cardView"
|
||||
android:layout_width="540dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/light_gray"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_rounded_surface"
|
||||
android:clipToOutline="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:background="@color/error"
|
||||
android:gravity="center"
|
||||
android:text="@string/gifts"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
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="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/enter_gift_or_scan_qrcode"
|
||||
android:textColor="@color/error"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearMark1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="20dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="32dp"
|
||||
android:paddingBottom="24dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="65dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/gifts"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="36sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextNumber"
|
||||
android:layout_width="300dp"
|
||||
<TextView
|
||||
android:id="@+id/textStatus"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:textSize="20sp"
|
||||
android:hint="@string/passcode"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:inputType="number" />
|
||||
|
||||
android:text="@string/enter_gift_or_scan_qrcode"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearMark1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button10"
|
||||
android:layout_width="70dp"
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutInputModeSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/black"
|
||||
android:text="0" />
|
||||
<Button
|
||||
android:id="@+id/button11"
|
||||
android:layout_width="70dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:background="@drawable/bg_segmented_container"
|
||||
android:padding="4dp"
|
||||
android:elevation="2dp"
|
||||
android:translationZ="3dp"
|
||||
android:outlineProvider="background"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnModeKeypad"
|
||||
style="@style/Widget.App.InputModeButton"
|
||||
android:text="鍵盤輸入" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnModeScan"
|
||||
style="@style/Widget.App.InputModeButton"
|
||||
android:text="掃描條碼" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/black"
|
||||
android:text="1" />
|
||||
<Button
|
||||
android:id="@+id/button12"
|
||||
android:layout_width="70dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextNumber"
|
||||
android:layout_width="320dp"
|
||||
android:layout_height="60dp"
|
||||
android:textSize="28sp"
|
||||
android:hint="@string/passcode"
|
||||
android:background="@drawable/bg_input_outline"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:textColor="@color/black"
|
||||
android:gravity="center"
|
||||
android:inputType="number"
|
||||
android:maxLength="8" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Number pads & QRCode -->
|
||||
<LinearLayout
|
||||
android:id="@+id/linearNumpad"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/black"
|
||||
android:text="2" />
|
||||
<Button
|
||||
android:id="@+id/button13"
|
||||
android:layout_width="70dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button11"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button12"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="2" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button13"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:text="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/black"
|
||||
android:text="3" />
|
||||
<Button
|
||||
android:id="@+id/button14"
|
||||
android:layout_width="70dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button14"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="4" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button15"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="5" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button16"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:text="6" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/black"
|
||||
android:text="4" />
|
||||
<Button
|
||||
android:id="@+id/buttonR1"
|
||||
android:layout_width="70dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button17"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="7" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button18"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="8" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button19"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:text="9" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/light_gray"
|
||||
android:text="←" />
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 清空 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonC1"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
app:icon="@drawable/close_24" />
|
||||
|
||||
<!-- 0 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button10"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="0" />
|
||||
|
||||
<!-- 退格 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonR1"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
app:icon="@drawable/keyboard_backspace_24" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageViewScanHint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/pay_show_qr_barcode"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部按鈕 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button15"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/black"
|
||||
android:text="5" />
|
||||
<Button
|
||||
android:id="@+id/button16"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/black"
|
||||
android:text="6" />
|
||||
<Button
|
||||
android:id="@+id/button17"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/black"
|
||||
android:text="7" />
|
||||
<Button
|
||||
android:id="@+id/button18"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/black"
|
||||
android:text="8" />
|
||||
<Button
|
||||
android:id="@+id/button19"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/black"
|
||||
android:text="9" />
|
||||
<Button
|
||||
android:id="@+id/buttonC1"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/light_gray"
|
||||
android:text="C" />
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonCancel"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
app:backgroundTint="@color/warning"
|
||||
android:elevation="8dp"
|
||||
app:elevation="8dp"
|
||||
android:translationZ="3dp"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:insetLeft="0dp"
|
||||
android:insetRight="0dp"
|
||||
android:padding="0dp"
|
||||
android:text="@string/cancel_40"
|
||||
android:textSize="26sp"
|
||||
app:cornerRadius="12dp"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonFinish"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="64dp"
|
||||
app:backgroundTint="@color/primary"
|
||||
app:rippleColor="#33FFFFFF"
|
||||
android:elevation="8dp"
|
||||
app:elevation="8dp"
|
||||
android:translationZ="3dp"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:insetLeft="0dp"
|
||||
android:insetRight="0dp"
|
||||
android:padding="0dp"
|
||||
android:text="@string/input_complete"
|
||||
android:textSize="26sp"
|
||||
app:cornerRadius="12dp"
|
||||
android:textColor="@color/white" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonCancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:text="@string/cancel_40"
|
||||
android:textSize="20sp"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonFinish"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:text="@string/input_complete"
|
||||
android:textSize="20sp"
|
||||
android:textColor="@color/black" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,181 +1,172 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:id="@+id/linearLayoutInvoiceType"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/surface"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/transparent">
|
||||
|
||||
<!-- 標題 -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="選擇發票開立方式"
|
||||
android:textSize="30sp"
|
||||
android:textColor="@color/primary"
|
||||
android:padding="16dp"
|
||||
android:gravity="center"
|
||||
android:textStyle="bold" />
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/linearLayoutInvoiceType"
|
||||
android:layout_width="540dp"
|
||||
android:layout_height="720dp"
|
||||
android:background="@drawable/bg_rounded_surface"
|
||||
android:clipToOutline="true"
|
||||
android:paddingHorizontal="24dp"
|
||||
android:paddingTop="32dp"
|
||||
android:paddingBottom="32dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<!-- 三張卡片選項區 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<!-- 卡片1:輸入載具 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardVehicle"
|
||||
<!-- 上方:標題 (字距拉開) -->
|
||||
<TextView
|
||||
android:id="@+id/titleTextView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
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: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" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingVertical="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="輸入載具"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="手機條碼 / 自然人憑證"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- 卡片2:捐贈發票 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardDonation"
|
||||
<!-- 中間:按鈕區域 (左右增加 padding, 按鈕高度使用維度變數) -->
|
||||
<LinearLayout
|
||||
android:id="@+id/cardContainer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
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: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">
|
||||
|
||||
<LinearLayout
|
||||
<!-- 卡片1:輸入載具 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardVehicle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingVertical="16dp">
|
||||
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">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="捐贈發票"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="選擇捐贈機構"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:gravity="center" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="輸入載具"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- 卡片3:公司統編 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardCustomerIdentifier"
|
||||
<!-- 卡片2:捐贈發票 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardDonation"
|
||||
android:layout_width="match_parent"
|
||||
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">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="捐贈發票"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- 卡片3:公司統編 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardCustomerIdentifier"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/invoice_button_height"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="公司統編"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 下方:返回按鈕 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/bottomButtonLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_weight="1"
|
||||
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">
|
||||
|
||||
<LinearLayout
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonCancel"
|
||||
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingVertical="16dp">
|
||||
android:layout_height="64dp"
|
||||
android:backgroundTint="@color/warning"
|
||||
android:text="返回40秒"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
app:cornerRadius="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="公司統編"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="輸入統一編號"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:gravity="center" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部:返回按鈕 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonCancel"
|
||||
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:backgroundTint="@color/warning"
|
||||
android:text="返回支付方式(40)"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
app:cornerRadius="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/transparent">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
<LinearLayout
|
||||
android:id="@+id/cardView"
|
||||
android:layout_width="540dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="@color/surface"
|
||||
app:cardCornerRadius="30dp"
|
||||
android:background="@drawable/bg_rounded_surface"
|
||||
android:clipToOutline="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@ -20,7 +20,10 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="32dp"
|
||||
android:paddingBottom="24dp">
|
||||
|
||||
<TextView
|
||||
@ -28,7 +31,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="65dp"
|
||||
android:gravity="center"
|
||||
android:text="取貨碼"
|
||||
android:text="請輸入取貨碼"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="36sp"
|
||||
android:textStyle="bold" />
|
||||
@ -38,6 +41,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
@ -57,9 +61,36 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutInputModeSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:background="@drawable/bg_segmented_container"
|
||||
android:padding="4dp"
|
||||
android:elevation="2dp"
|
||||
android:translationZ="3dp"
|
||||
android:outlineProvider="background"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnModeKeypad"
|
||||
style="@style/Widget.App.InputModeButton"
|
||||
android:text="鍵盤輸入" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnModeScan"
|
||||
style="@style/Widget.App.InputModeButton"
|
||||
android:text="掃描條碼" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -73,172 +104,100 @@
|
||||
android:layout_height="60dp"
|
||||
android:textSize="28sp"
|
||||
android:hint="請輸入取貨碼"
|
||||
android:background="@color/white"
|
||||
android:background="@drawable/bg_input_outline"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:textColor="@color/black"
|
||||
android:gravity="center"
|
||||
android:inputType="number"
|
||||
android:maxLength="8" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Number pads -->
|
||||
<!-- Number pads & QRCode -->
|
||||
<LinearLayout
|
||||
android:id="@+id/linearNumpad"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button11"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="30dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="1" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button12"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="2" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button13"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:text="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button14"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="4" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button15"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="5" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button16"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:text="6" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button17"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="7" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button18"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="8" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button19"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:text="9" />
|
||||
</LinearLayout>
|
||||
|
||||
@ -246,56 +205,43 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 清空 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonC1"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
app:cornerRadius="16dp"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
android:text="X"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
app:icon="@drawable/close_24" />
|
||||
|
||||
<!-- 0 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button10"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="0" />
|
||||
|
||||
<!-- 退格 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonR1"
|
||||
android:layout_width="94dp"
|
||||
android:layout_height="94dp"
|
||||
app:backgroundTint="#FFFFFF"
|
||||
app:rippleColor="#33000000"
|
||||
android:elevation="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="32sp"
|
||||
app:cornerRadius="16dp"
|
||||
android:textStyle="bold"
|
||||
app:strokeColor="@color/black"
|
||||
app:strokeWidth="1.5dp"
|
||||
android:text="←" />
|
||||
style="@style/Widget.App.KeypadButton"
|
||||
app:icon="@drawable/keyboard_backspace_24" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageViewScanHint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/pay_show_qr_barcode"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部按鈕 -->
|
||||
@ -304,15 +250,25 @@
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonCancel"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
app:backgroundTint="@color/warning"
|
||||
android:elevation="8dp"
|
||||
app:elevation="8dp"
|
||||
android:translationZ="3dp"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:insetLeft="0dp"
|
||||
android:insetRight="0dp"
|
||||
android:padding="0dp"
|
||||
android:text="取消"
|
||||
android:textSize="26sp"
|
||||
app:cornerRadius="12dp"
|
||||
@ -320,16 +276,24 @@
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonFinish"
|
||||
style="@style/Widget.Material3.Button"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="64dp"
|
||||
app:backgroundTint="@color/primary"
|
||||
app:rippleColor="#33FFFFFF"
|
||||
android:text="輸入完成"
|
||||
android:elevation="8dp"
|
||||
app:elevation="8dp"
|
||||
android:translationZ="3dp"
|
||||
android:insetTop="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:insetLeft="0dp"
|
||||
android:insetRight="0dp"
|
||||
android:padding="0dp"
|
||||
android:text="確認"
|
||||
android:textSize="26sp"
|
||||
app:cornerRadius="12dp"
|
||||
android:textColor="@color/white" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@ -8,16 +8,35 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 購物車上方商品數量 -->
|
||||
<TextView
|
||||
android:id="@+id/totalItemsTextView"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="24dp"
|
||||
android:paddingVertical="16dp"
|
||||
android:text="@string/total_items_format"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="23sp"
|
||||
android:textStyle="bold" />
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/totalItemsTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/total_items_format"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="23sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/maxItemsWarningTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="@string/cart_max_items_warning"
|
||||
android:textColor="@color/warning"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 购物车商品列表 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
@ -50,17 +50,35 @@
|
||||
android:text="$ 0"
|
||||
style="@style/TextAppearance.App.QuickCart.Small" />
|
||||
|
||||
<!-- 小記金額(移至此處) -->
|
||||
<TextView
|
||||
android:id="@+id/totalPriceTextView"
|
||||
<!-- 庫存與小記金額 -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="$ 0.0000"
|
||||
style="@style/TextAppearance.App.QuickCart.Medium"
|
||||
android:textColor="@color/primary" />
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/totalPriceTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="$ 0.0000"
|
||||
style="@style/TextAppearance.App.QuickCart.Medium"
|
||||
android:textColor="@color/primary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textStock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="庫存00件"
|
||||
android:layout_marginStart="16dp"
|
||||
style="@style/TextAppearance.App.QuickCart.Medium"
|
||||
android:textColor="@color/gray"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="normal" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -69,34 +87,50 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/buttonMinus"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:padding="10dp"
|
||||
android:background="@drawable/bg_quantity_outline_button"
|
||||
android:elevation="4dp"
|
||||
android:src="@drawable/remove_24" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textQuantity"
|
||||
android:layout_width="86dp"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="1"
|
||||
style="@style/TextAppearance.App.QuickCart.Medium"
|
||||
android:textColor="@color/black" />
|
||||
android:gravity="center_vertical"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/buttonMinus"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_margin="6dp"
|
||||
android:padding="10dp"
|
||||
android:background="@drawable/bg_quantity_outline_button"
|
||||
android:elevation="4dp"
|
||||
android:stateListAnimator="@null"
|
||||
android:src="@drawable/remove_24" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textQuantity"
|
||||
android:layout_width="86dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="1"
|
||||
style="@style/TextAppearance.App.QuickCart.Medium"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/buttonPlus"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_margin="6dp"
|
||||
android:padding="10dp"
|
||||
android:background="@drawable/bg_quantity_outline_button"
|
||||
android:elevation="4dp"
|
||||
android:stateListAnimator="@null"
|
||||
android:src="@drawable/add_24" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/buttonPlus"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:padding="10dp"
|
||||
android:background="@drawable/bg_quantity_outline_button"
|
||||
android:elevation="4dp"
|
||||
android:src="@drawable/add_24" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 4. 刪除鈕(現有 Adapter / ShoppingCartFragment 沿用) -->
|
||||
@ -105,9 +139,13 @@
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:padding="10dp"
|
||||
android:background="@drawable/bg_waste_outline_button"
|
||||
android:elevation="4dp"
|
||||
android:stateListAnimator="@null"
|
||||
android:src="@drawable/close_warning_24" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -10,111 +10,148 @@
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="2dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<!-- root:無 padding,讓 mask 可覆蓋完整卡片 -->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- 商品圖片 1:1 -->
|
||||
<ImageView
|
||||
android:id="@+id/imageProductPicture"
|
||||
<!-- 內容容器:統一控制上方與左右 padding -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/default_product"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<!-- 貨道資訊 (左上角) -->
|
||||
<TextView
|
||||
android:id="@+id/textSlot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:background="@color/primary"
|
||||
android:text="貨道: 01"
|
||||
android:textColor="@color/onPrimary"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
android:paddingTop="12dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp">
|
||||
|
||||
<!-- 庫存資訊 (右下角) -->
|
||||
<TextView
|
||||
android:id="@+id/textStock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:background="@color/gray"
|
||||
android:text="庫存: 0"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/imageProductPicture"
|
||||
app:layout_constraintEnd_toEndOf="@+id/imageProductPicture" />
|
||||
<!-- 上半部:圖片容器 (1:1) -->
|
||||
<FrameLayout
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<!-- 商品名稱 -->
|
||||
<TextView
|
||||
android:id="@+id/textProductName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="@string/product_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageProductPicture"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
<!-- 商品圖片 -->
|
||||
<ImageView
|
||||
android:id="@+id/imageProductPicture"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/default_product"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<!-- 商品價格 (左下角) -->
|
||||
<TextView
|
||||
android:id="@+id/textPrice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="NT$ 000"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textProductName"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
<!-- 貨道 & 庫存標籤 (左上角,垂直排列) -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|start"
|
||||
android:layout_margin="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 售罄覆蓋層 -->
|
||||
<!-- 貨道資訊 -->
|
||||
<TextView
|
||||
android:id="@+id/textSlot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:background="@drawable/bg_rounded_primary"
|
||||
android:text="貨道01"
|
||||
android:textColor="@color/onPrimary"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 庫存資訊 -->
|
||||
<TextView
|
||||
android:id="@+id/textStock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:background="@drawable/bg_rounded_light_gray"
|
||||
android:text="庫存0"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<!-- 下半部:商品名稱 + 金額列 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="12dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageContainer"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<!-- 商品名稱 -->
|
||||
<TextView
|
||||
android:id="@+id/textProductName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="@string/product_name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 金額 + 快速新增按鈕 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 商品價格 -->
|
||||
<TextView
|
||||
android:id="@+id/textPrice"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="NT$ 000"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 快速新增按鈕 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonQuickAdd"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
app:icon="@drawable/add_24"
|
||||
app:backgroundTint="@color/primary"
|
||||
app:iconTint="@color/onPrimary" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- 售罄覆蓋層(覆蓋整張卡片含 padding 留白) -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/mask"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/transparent_black"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textMask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/product_sold_out"
|
||||
android:text="售完"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
@ -124,5 +161,6 @@
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
@ -21,4 +21,7 @@
|
||||
<dimen name="menu_btn_icon_size">72dp</dimen>
|
||||
<dimen name="menu_btn_inset">8dp</dimen>
|
||||
<dimen name="menu_btn_corner_radius">16dp</dimen>
|
||||
|
||||
<!-- 發票選項按鈕高度 -->
|
||||
<dimen name="invoice_button_height">100dp</dimen>
|
||||
</resources>
|
||||
@ -337,6 +337,8 @@
|
||||
<string name="cart_cannot_decrease">不能減少了</string>
|
||||
<string name="cart_max_items">購物車最多可購買 8 件商品</string>
|
||||
<string name="cart_added">已加入購物車</string>
|
||||
<string name="cart_max_items_warning">已達數量上限</string>
|
||||
|
||||
<string name="data_error">數據異常</string>
|
||||
<string name="product_delivery_success">商品出貨成功</string>
|
||||
<string name="please_go_to_cabinet_to_pick_up_goods">請至99號櫃門拿取您的商品</string>
|
||||
|
||||
@ -71,4 +71,44 @@
|
||||
<item name="android:layout_marginStart">72dp</item>
|
||||
</style>
|
||||
|
||||
<!-- 取貨碼鍵盤按鈕共用樣式 -->
|
||||
<style name="Widget.App.KeypadButton" parent="Widget.MaterialComponents.Button">
|
||||
<item name="android:layout_width">94dp</item>
|
||||
<item name="android:layout_height">94dp</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textSize">32sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:elevation">8dp</item>
|
||||
<item name="android:translationZ">3dp</item>
|
||||
<item name="backgroundTint">@color/cardSurface</item>
|
||||
<item name="rippleColor">#33000000</item>
|
||||
<item name="cornerRadius">16dp</item>
|
||||
<item name="iconGravity">textStart</item>
|
||||
<item name="iconPadding">0dp</item>
|
||||
<item name="iconSize">32dp</item>
|
||||
<item name="iconTint">@color/black</item>
|
||||
</style>
|
||||
|
||||
<!-- 輸入模式切換按鈕共用樣式 -->
|
||||
<style name="Widget.App.InputModeButton" parent="Widget.MaterialComponents.Button">
|
||||
<item name="android:layout_width">150dp</item>
|
||||
<item name="android:layout_height">56dp</item>
|
||||
<item name="android:textColor">@color/color_input_mode_text</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:elevation">0dp</item>
|
||||
<item name="android:translationZ">0dp</item>
|
||||
<item name="android:stateListAnimator">@null</item>
|
||||
<item name="android:insetTop">0dp</item>
|
||||
<item name="android:insetBottom">0dp</item>
|
||||
<item name="android:insetLeft">0dp</item>
|
||||
<item name="android:insetRight">0dp</item>
|
||||
<item name="backgroundTint">@color/color_input_mode_bg</item>
|
||||
<item name="cornerRadius">28dp</item>
|
||||
<item name="strokeWidth">0dp</item>
|
||||
<item name="iconTint">@color/color_input_mode_text</item>
|
||||
<item name="iconGravity">textStart</item>
|
||||
<item name="iconPadding">8dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
Loading…
Reference in New Issue
Block a user