Commit 1e9de99e by Lee Munkyeong

ハードコーディング修正

parent bb556ea2
......@@ -194,6 +194,8 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
int CHANGED_META_INFO = 2;
int PAYMENT = 3;
}
private int DEFAULT_VALUE_ZERO = 0;
private boolean DEFAULT_VALUE_FALSE = false;
// 遷移元のアクティビティ名
// PushMessage受信時に直接ChatRoomへ行かずに、ひとつまえのActivityに戻る為に使用する。
......@@ -209,7 +211,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
private void sendRegistrationIdToCMS() {
// Tokenが更新されたか確認
if (!PreferenceUtil.getUserPref(this, UserPrefKey.NEED_SEND_TOKEN, false)){
if (!PreferenceUtil.getUserPref(this, UserPrefKey.NEED_SEND_TOKEN, DEFAULT_VALUE_FALSE)){
// 更新されてない
return;
}
......@@ -969,7 +971,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
TextView operationSelect = (TextView) mOperationSelectDialog.findViewById(R.id.tv_toolbar_title);
operationSelect.setText(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.operation_select,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)));
mOperationSelectDialog.findViewById(R.id.close_btn).setOnClickListener(new View.OnClickListener() {
@Override
......@@ -1068,7 +1070,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
titleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_list,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)));
} else {
mPushMessageListView.setVisibility(View.GONE);
mPushMessageListDialog.findViewById(R.id.close_btn).setVisibility(View.VISIBLE);
......@@ -1077,7 +1079,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
titleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_message_detail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)));
}
}
......@@ -1141,7 +1143,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
messageTitleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.free_input,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)) + " > ");
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)) + " > ");
TextView tvOperationName = (TextView) mPushMessageSendDialog.findViewById(R.id.operation_name);
tvOperationName.setText(operationDto.operationName);
......@@ -1186,7 +1188,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_input_null,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT);
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
return;
}
byte[] messageByte = message.getBytes(StandardCharsets.UTF_8);
......@@ -1194,14 +1196,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_input_over,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT);
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
return;
}
// リソースパターンの適用
ProgressDialogHelper.showProgressPopup(this, true, PatternStringUtil.patternToString(getApplicationContext(),
R.string.file_initialization,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)));
try {
boolean result = pushMessageLogic.sendPushMessageRequest(mSendType, message, operationId);
if (result) {
......@@ -1209,19 +1211,19 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_send_success,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT);
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
} else {
// リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_send_fail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT);
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
}
} catch (Exception e) {
Logger.e(TAG, e);
// リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_send_fail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT);
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
} finally {
ProgressDialogHelper.closeProgressPopup();
}
......@@ -1238,14 +1240,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
ProgressDialogHelper.showProgressPopup(this, true, PatternStringUtil.patternToString(getApplicationContext(),
R.string.file_initialization,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)));
try {
List<FixPushMessageDto> fixPushMessageList = pushMessageLogic.getFixPushMessage();
FixPushMessageDto dto = new FixPushMessageDto();
// リソースパターンの適用
dto.name = PatternStringUtil.patternToString(getApplicationContext(),
R.string.free_input,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO));
fixPushMessageList.add(0, dto);
mFixPushMessageListView.setAdapter(new FixPushMessageAdapter(this, fixPushMessageList, mSelectedFixPuchMessagePosition));
mFixPushMessageListView.invalidate();
......@@ -1272,7 +1274,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.respons_fix_push_message_fail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT);
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
} finally {
ProgressDialogHelper.closeProgressPopup();
}
......@@ -1335,7 +1337,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
if (!mOperationLogic.deleteProcess(operationId)) { //工程全削除送信失敗時
return PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_error_all_process_delete,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO));
}
}
......@@ -1359,12 +1361,12 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用
dialogMsg = String.format(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_routineTask_report_available_from,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), avilableDateStr);
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), avilableDateStr);
} else if (!mTaskReportDao.existsToDoRoutineTaskReportData(operationId)) {
// 作業データが存在しないメッセージ
dialogMsg = PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_no_report_data,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO));
}
if (!StringUtil.isNullOrEmpty(dialogMsg)) {
errorMsg.append(dialogMsg);
......@@ -1377,16 +1379,16 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
switch (e.getCode()) {
case P_E_ACMS_P003:
// リソースパターンを適用
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P003, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))));
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P003, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
break;
case P_E_ACMS_P004:
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P004, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))));
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P004, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
break;
case P_E_ACMS_P005:
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P005, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))));
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P005, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
break;
case P_E_ACMS_P006:
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P006, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))));
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P006, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
break;
default:
Logger.e(TAG, "syncOperation", e);
......@@ -1505,7 +1507,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} catch (Exception e) {
Logger.e(TAG, e);
// リソースパターンの適用
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.msg_error_task_report_receiving_failed, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))));
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.msg_error_task_report_receiving_failed, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
return null;
}
if (localTaskReportDto != null) {
......@@ -1522,7 +1524,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} catch (Exception e) {
Logger.e(TAG, e);
// リソースパターンの適用
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.msg_error_task_report_receiving_failed, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))));
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.msg_error_task_report_receiving_failed, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
return null;
}
if (!serverTaskReportDto.jsonData.isEmpty()) {
......
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