Commit 3a68b824 by Jeong Gilmo

#33006 事業者毎のリソース多重化(Android)

- ErrorCodeのメッセージについてパターン化の修正
parent 4920ba2e
package jp.agentec.abook.abv.ui.common.constant;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
import static org.chromium.base.ContextUtils.getApplicationContext;
/**
* ユーザ認証を行ったりするときのエラーコードです。
......@@ -108,21 +102,7 @@ public enum ErrorCode {
M006(R.string.M006),
M007(R.string.M007),
ERROR(R.string.ERROR),
DOWNLOAD_CANCEL_ERROR(R.string.DOWNLOAD_CANCEL_ERROR),
// リソースパターンの適用
P_E_ACMS_P001(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.P001,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))),
P_E_ACMS_P002(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.P002,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))),
P_E_ACMS_P003(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.P003,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))),
P_E_ACMS_P004(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.P004,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
DOWNLOAD_CANCEL_ERROR(R.string.DOWNLOAD_CANCEL_ERROR);
public final int resId;
......
......@@ -150,10 +150,6 @@ public class ErrorMessage {
ErrorCode.S_E_ACMS_L010,
ErrorCode.S_E_ACMS_L012,
ErrorCode.E129,
ErrorCode.P_E_ACMS_P001,
ErrorCode.P_E_ACMS_P002,
ErrorCode.P_E_ACMS_P003,
ErrorCode.P_E_ACMS_P004
};
for (int i = 0; i < searchedArray.length; i++) {
if (searchedArray[i].name().equals(codeName)) {
......
......@@ -718,7 +718,9 @@ public class OperationListActivity extends ABVUIActivity {
// 報告送信
if (mOperationLogic.sendTaskReportSendData(operationId, progressCallback)) {
// 作業報告タイプが定期点検且つ、P005のエラーの場合、以下のエラーをトーストメッセージで表示
handleErrorMessageToast(R.string.P005);
handleErrorMessageToast(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.P005,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
}
progressDialogHorizontal.setProgress(60);
......@@ -752,10 +754,15 @@ public class OperationListActivity extends ABVUIActivity {
//noinspection EnumSwitchStatementWhichMissesCases
switch (e.getCode()) {
case P_E_ACMS_P003:
showSimpleAlertDialog(R.string.app_name, R.string.P003);
// リソースパターンを適用
showSimpleAlertDialog(R.string.app_name, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.P003,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
break;
case P_E_ACMS_P004:
showSimpleAlertDialog(R.string.app_name, R.string.P004);
showSimpleAlertDialog(R.string.app_name, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.P004,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
break;
case S_E_ACMS_0500:
handleErrorMessageToast(ABVExceptionCode.S_E_ACMS_0500);
......@@ -1138,10 +1145,16 @@ public class OperationListActivity extends ABVUIActivity {
//noroutineion EnumSwitchStatementWhichMissesCases
switch (e.getCode()) {
case P_E_ACMS_P001:
showSimpleAlertDialog(R.string.app_name, R.string.P001);
showSimpleAlertDialog(R.string.app_name,
PatternStringUtil.patternToInt(getApplicationContext(),
R.string.P001,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
break;
case P_E_ACMS_P002:
showSimpleAlertDialog(R.string.app_name, R.string.P002);
showSimpleAlertDialog(R.string.app_name,
PatternStringUtil.patternToInt(getApplicationContext(),
R.string.P002,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
break;
case S_E_ACMS_0500:
handleErrorMessageToast(ABVExceptionCode.S_E_ACMS_0500);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment