[FIX] 通行碼 Dialog 防呆強化(Part 2-3)
CheckoutAccessCodeDialog.changeOk()(自 Luzui 移植防呆): - 加 3 秒防連點,避免重複送出驗證 - 輸入加 .trim() 與 isEmpty 過濾 - 修正誤植文案「統一編號長度不能少於 8 碼」→「通行碼長度不能少於 8 碼」 三 flavor 完整 APK 打包成功(General/Chengwai/Cmuh)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
2315a32f56
commit
e8856d0a8b
@ -312,12 +312,21 @@ public class CheckoutAccessCodeDialog extends DialogAbstract {
|
||||
}
|
||||
}
|
||||
|
||||
private long lastChangeOkClickTime = 0;
|
||||
|
||||
public void changeOk() {
|
||||
try {
|
||||
String number = binding.editTextNumber.getText().toString();
|
||||
// 防連點:3 秒內重複點擊忽略(自 Luzui 移植)
|
||||
long now = System.currentTimeMillis();
|
||||
if (now - lastChangeOkClickTime < 3000) {
|
||||
return;
|
||||
}
|
||||
lastChangeOkClickTime = now;
|
||||
|
||||
String number = binding.editTextNumber.getText().toString().trim();
|
||||
// 長度檢查
|
||||
if (number.length() < 8) {
|
||||
getHandlerMain().start(getClass().getSimpleName(), "統一編號長度不能少於 8 碼");
|
||||
if (number.isEmpty() || number.length() < 8) {
|
||||
getHandlerMain().start(getClass().getSimpleName(), "通行碼長度不能少於 8 碼");
|
||||
return;
|
||||
}
|
||||
MyApp.getInstance().getAccessCodeStructure().setPassCode(number);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user