Commit 7a273f5f by Kim Peace

Fixed for push message handling from operation list activity

parent 30c20320
...@@ -210,39 +210,67 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -210,39 +210,67 @@ public class OperationListActivity extends ABVUIActivity {
if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId))) { if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId))) {
final long operationId = Long.parseLong(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId)); final long operationId = Long.parseLong(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId));
String message = getIntent().getStringExtra(AppDefType.PushMessageKey.message); String message = getIntent().getStringExtra(AppDefType.PushMessageKey.message);
if (operationId > 0) { if (operationId < 1) { return; }
final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, getRString(R.string.app_name), message); final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, getRString(R.string.app_name), message);
// リソースパターンの適用 // リソースパターンの適用
alertDialog.setPositiveButton(PatternStringUtil.patternToInt(getApplicationContext(), R.string.work_report, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), alertDialog.setPositiveButton(PatternStringUtil.patternToInt(
getApplicationContext(),
R.string.work_report,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)
),
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {
if (contentRefresher.isRefreshing()) { if (contentRefresher.isRefreshing()) {
// リソースパターンの適用 // リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(), ErrorMessage.showErrorMessageToast(
OperationListActivity.this,
PatternStringUtil.patternToInt(
getApplicationContext(),
R.string.msg_routineTask_report_disable_refreshing, R.string.msg_routineTask_report_disable_refreshing,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)
)
);
} else if(ActivityHandlingHelper.getInstance().isMeetingConnected()) { } else if(ActivityHandlingHelper.getInstance().isMeetingConnected()) {
// リソースパターンの適用 // リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(), ErrorMessage.showErrorMessageToast(
OperationListActivity.this,
PatternStringUtil.patternToInt(
getApplicationContext(),
R.string.msg_routineTask_report_disable_meeting_room, R.string.msg_routineTask_report_disable_meeting_room,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)
)
);
} else if (isShowingBatchSync()) { } else if (isShowingBatchSync()) {
// 一括同期中は移動しない // 一括同期中は移動しない
ErrorMessage.showErrorMessageToast(OperationListActivity.this, getString(R.string.msg_batch_sync_move_operation_view)); ErrorMessage.showErrorMessageToast(
OperationListActivity.this,
getString(R.string.msg_batch_sync_move_operation_view)
);
} else { } else {
OperationDto operationDto = mOperationLogic.getOperation(operationId); OperationDto operationDto = mOperationLogic.getOperation(operationId);
if (operationDto == null) { if (operationDto == null) {
// リソースパターンの適用 // リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(), ErrorMessage.showErrorMessageToast(
OperationListActivity.this,
PatternStringUtil.patternToInt(
getApplicationContext(),
R.string.msg_routineTask_report_disable_no_operation, R.string.msg_routineTask_report_disable_no_operation,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)
)
);
} else if (operationDto.needSyncFlg) { } else if (operationDto.needSyncFlg) {
// リソースパターンの適用 // リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(), ErrorMessage.showErrorMessageToast(
OperationListActivity.this,
PatternStringUtil.patternToInt(
getApplicationContext(),
R.string.msg_routineTask_report_disable_not_updated, R.string.msg_routineTask_report_disable_not_updated,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)
)
);
} else { } else {
startTaskDirectionOrReportView(operationDto); startTaskDirectionOrReportView(operationDto);
} }
...@@ -250,7 +278,8 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -250,7 +278,8 @@ public class OperationListActivity extends ABVUIActivity {
dialog.dismiss(); dialog.dismiss();
} }
}); }
);
alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override @Override
...@@ -260,15 +289,19 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -260,15 +289,19 @@ public class OperationListActivity extends ABVUIActivity {
}); });
alertDialog.show(); alertDialog.show();
} }
// プッシュメッセージがある場合
else if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName))
&& getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') > 0
) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(
"",
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName),
getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomType)
);
} }
// // プッシュメッセージがある場合
// else if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
// getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') > 0) {
// ActivityHandlingHelper.getInstance().startChatWebviewActivity(
// getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
// getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName));
// }
} }
private class JsInf { private class JsInf {
......
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