Commit 12ec3e07 by Lee Jaebin

報告画面で「端末の戻る」ボタンタップ時、画面を閉じるための確認ダイアログ表示対応

parent 93ebd851
......@@ -78,7 +78,6 @@ public class Constant {
public interface XWalkOpenType {
int DEFAULT = -1;
int TASK_DERECTION = 1;
int TASK_REPORT = 2;
int PANO_EDIT = 3;
}
......
......@@ -1420,4 +1420,7 @@
<!--稼働時間登録可否チェック-->
<string name="msg_error_check_running_info">稼働時間情報のチェックに失敗しました。</string>
<string name="msg_report_close">報告画面を閉じますか?</string>
</resources>
......@@ -1428,4 +1428,6 @@
<!--稼働時間登録可否チェック-->
<string name="msg_error_check_running_info">실행 상태를 확인하지 못했습니다.</string>
</resources>
\ No newline at end of file
<string name="msg_report_close">보고화면을 닫으시겠습니까?</string>
</resources>
......@@ -1426,4 +1426,6 @@
<!--稼働時間登録可否チェック-->
<string name="msg_error_check_running_info">Failed to check running status.</string>
<string name="msg_report_close">Do you want to close the report screen?</string>
</resources>
\ No newline at end of file
......@@ -780,34 +780,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected void finishActivity() {}
protected void webViewLoadUrl(String url){}
public void onClickOperationHome(View v) {
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
// リソースパターンの適用
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ABVContentViewActivity.this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
// リソースパターンの適用
alertDialog.setMessage(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_confirm_save_pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
alertDialog.setNegativeButton(R.string.cancel, null);
alertDialog.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
callUnloadAuth();
dialog.dismiss();
finish();
}
});
alertDialog.show();
} else {
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); // 作業IDの設定
finishActivity(); // 開いてる画面を閉じる
}
}
/**
* Be override
*/
......@@ -1586,10 +1558,45 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected void showPhotoEditDialog(PhotoEditActivity photoEditDialog) {
if (this.mPhotoEditDialog != null) {
this.mPhotoEditDialog.dismiss();
}
else {
} else {
this.mPhotoEditDialog = photoEditDialog;
this.mPhotoEditDialog.show();
}
}
/**
* 報告画面を閉じる前の確認ダイアログ画面
* @param ozFormFlg
*/
protected void showBackConfirmDialog(final boolean ozFormFlg) {
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, R.string.app_name);
alertDialog.setMessage(R.string.msg_report_close);
alertDialog.setNegativeButton(R.string.cancel, null);
alertDialog.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (mOperationId != null && mOperationId > -1) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
}
if (ozFormFlg) {
// 帳票フォームで報告追加なしの場合
if (ActivityHandlingHelper.getInstance().searchOzdActivityStack()) { // OZD画面で画面遷移処理
goToMain(); // 一覧画面に遷移
} else {
finishActivity(); // 一覧画面に遷移
}
} else {
// 報告画面の場合
if (isLinkedContent) {
goToBack();
} else {
finishActivity();
}
}
}
});
alertDialog.show();
}
}
\ No newline at end of file
......@@ -369,7 +369,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
ozdCancelProcess(); // Ozd作業画面を閉じる
} else {
// 作業追加区分がなしの場合
goToMain(); // 一覧画面に遷移
showBackConfirmDialog(true);
}
} else {
return super.onKeyUp(keyCode, event);
......
......@@ -1535,11 +1535,9 @@ public class ContentViewActivity extends ABVContentViewActivity {
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
Logger.d(TAG, "KeyEvent.KEYCODE_BACK");
if (mOperationId != null && mOperationId > -1) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
}
if (isVideoMax) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
showBackConfirmDialog(false);
} else if (isVideoMax) {
videoMaxToDefault();
} else if (isMarking) {
mMarkingLayout.showSaveDialog();
......
......@@ -194,12 +194,11 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
showBackConfirmDialog(false);
} else if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
showConfirmSavePanoEdit();
} else {
if (mOperationId != null && mOperationId > -1) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
}
if (isLinkedContent) {
goToBack();
} else {
......@@ -462,8 +461,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// KAGOME Ph2 WebView表示時に戻るボタンの誤打で報告が消えることがあるため非活性に変更
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {return true;}
if (event.getAction()==KeyEvent.ACTION_UP) {
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_ENTER:
......
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