Commit bb556ea2 by Lee Munkyeong

コードレビュー対応

parent 9cbda6fd
...@@ -164,7 +164,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -164,7 +164,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
protected PushMessageListAdapter mPushMessageListAdapter; protected PushMessageListAdapter mPushMessageListAdapter;
protected ListView mFixPushMessageListView; protected ListView mFixPushMessageListView;
protected Dialog mPushMessageSendDialog; protected Dialog mPushMessageSendDialog;
protected ImageButton communicationButton; // コミュニケーションボタン protected ImageButton communicationButton; // コミュニケーションボタン
protected int mSelectedFixPuchMessagePosition; protected int mSelectedFixPuchMessagePosition;
protected int mSendType; protected int mSendType;
protected PushMessageLogic pushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class); protected PushMessageLogic pushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
...@@ -1310,8 +1310,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1310,8 +1310,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
*/ */
public String syncOperation(final long operationId, int reportType, boolean buttonEventFlag) { public String syncOperation(final long operationId, int reportType, boolean buttonEventFlag) {
final StringBuilder errorMsg = new StringBuilder(); final StringBuilder errorMsg = new StringBuilder();
Logger.i(TAG, "---sync start");
try { try {
//コンテンツダウンロード関連プログレスバー値設定 //コンテンツダウンロード関連プログレスバー値設定
progressDialogHorizontal.setProgress(20); progressDialogHorizontal.setProgress(20);
...@@ -1413,7 +1411,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1413,7 +1411,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
closeProgressPopup(); closeProgressPopup();
} }
}); });
Logger.i(TAG, "---sync end");
} }
return errorMsg.length() > 0 ? errorMsg.toString() : null; return errorMsg.length() > 0 ? errorMsg.toString() : null;
} }
......
...@@ -100,46 +100,46 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -100,46 +100,46 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected String contentType; protected String contentType;
protected ABVPopupListWindow mShowedPopupWindow = null; protected ABVPopupListWindow mShowedPopupWindow = null;
protected int readingLogId; protected int readingLogId;
protected String path; // PanoViewController protected String path; // PanoViewController
protected boolean readingLogFlg = true; // HTMLWebViewActivity,PreviewActivityがPDFのアクションとして呼び出されることがあるので、その場合ログは記録しない protected boolean readingLogFlg = true; // HTMLWebViewActivity,PreviewActivityがPDFのアクションとして呼び出されることがあるので、その場合ログは記録しない
protected ImageButton subMenuBtn; protected ImageButton subMenuBtn;
protected ImageButton exitMeetingBtn; protected ImageButton exitMeetingBtn;
protected ConcurrentHashMap<Long, Object> objectIdPopupMap = new ConcurrentHashMap<>(); protected ConcurrentHashMap<Long, Object> objectIdPopupMap = new ConcurrentHashMap<>();
protected int mCurrentPageNumber = 0; // 表示中のページ番号(0からスタート) protected int mCurrentPageNumber = 0; // 表示中のページ番号(0からスタート)
public Long mOperationId; public Long mOperationId;
protected int mXWalkOpenType = -1; protected int mXWalkOpenType = -1;
protected int mOperationType; protected int mOperationType;
private int mReportType; private int mReportType;
protected int mEnableReportHistory; //0:履歴無し 1:履歴可 protected int mEnableReportHistory; //0:履歴無し 1:履歴可
// 報告可能区分 // 報告可能区分
protected int mEnableReportEdit; //0:報告無し 1:報告可 protected int mEnableReportEdit; //0:報告無し 1:報告可
protected String mContentPath; protected String mContentPath;
protected int mStatusCode; protected int mStatusCode;
protected boolean isOperationPdf = false; protected boolean isOperationPdf = false;
protected OperationDto operationDto = null; protected OperationDto operationDto = null;
protected String linkUrl; protected String linkUrl;
private String mReportFileName; private String mReportFileName;
protected TextView operationNameTitle; protected TextView operationNameTitle;
protected ImageButton operationHomeButton; protected ImageButton operationHomeButton;
protected ImageButton taskListButton; protected ImageButton taskListButton;
protected ImageButton quickReportPrintButton; protected ImageButton quickReportPrintButton;
// protected ImageButton helpButton; // protected ImageButton helpButton;
protected boolean isPageFinished; protected boolean isPageFinished;
protected Double latitude; protected Double latitude;
protected Double longitude; protected Double longitude;
protected String mCmd; protected String mCmd;
protected String mTaskKey; protected String mTaskKey;
protected String mAttachedFileName; protected String mAttachedFileName;
protected File mLocalFile; protected File mLocalFile;
public boolean isLinkedContent; public boolean isLinkedContent;
public int pageNo; public int pageNo;
public int mButtonStatus; // 保存ボタンチェック public int mButtonStatus; // 保存ボタンチェック
protected boolean mAddReport; // 作業追加区分 protected boolean mAddReport; // 作業追加区分
// 編集 // 編集
...@@ -154,68 +154,68 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -154,68 +154,68 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
Intent intent = getIntent(); Intent intent = getIntent();
contentId = intent.getLongExtra(ABookKeys.CONTENT_ID, 0); contentId = intent.getLongExtra(ABookKeys.CONTENT_ID, 0);
contentType = intent.getStringExtra(ABookKeys.CONTENT_TYPE); contentType = intent.getStringExtra(ABookKeys.CONTENT_TYPE);
objectId = intent.getLongExtra("objectId", -1); objectId = intent.getLongExtra("objectId", -1);
objectPageNumber = intent.getIntExtra("pageNumber", -1); objectPageNumber = intent.getIntExtra("pageNumber", -1);
readingLogId = intent.getIntExtra("readingLogId", -1); readingLogId = intent.getIntExtra("readingLogId", -1);
path = intent.getStringExtra("path"); path = intent.getStringExtra("path");
isLinkedContent = intent.getBooleanExtra("isLinkedContent", false); isLinkedContent = intent.getBooleanExtra("isLinkedContent", false);
mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1); mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1);
// 戻り先のActivity名を保存しておく // 戻り先のActivity名を保存しておく
baseActivityName = getIntent().getStringExtra(AppDefType.ChatPushMessageKey.baseActivityName); baseActivityName = getIntent().getStringExtra(AppDefType.ChatPushMessageKey.baseActivityName);
if (!isLinkedContent) { if (!isLinkedContent) {
operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId); operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId);
mXWalkOpenType = intent.getIntExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.DEFAULT); mXWalkOpenType = intent.getIntExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.DEFAULT);
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
mOperationType = operationDto.operationType; mOperationType = operationDto.operationType;
mReportType = operationDto.reportType; mReportType = operationDto.reportType;
if (mOperationType != OperationType.PDF && isNormalSize()) { if (mOperationType != OperationType.PDF && isNormalSize()) {
// 縦画面固定 // 縦画面固定
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} }
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
// 添付ファイル表示のため、キャッシュディレクトリにコピーする // 添付ファイル表示のため、キャッシュディレクトリにコピーする
ABookCheckWebViewHelper.getInstance().allCopyTaskAttachedMovieFileToCache(mOperationId, getContentId(), operationDto); ABookCheckWebViewHelper.getInstance().allCopyTaskAttachedMovieFileToCache(mOperationId, getContentId(), operationDto);
} }
}).start(); }).start();
mStatusCode = 0; mStatusCode = 0;
} }
mEnableReportEdit = operationDto.enableReportEdit; mEnableReportEdit = operationDto.enableReportEdit;
mEnableReportHistory = operationDto.enableReportHistory; mEnableReportHistory = operationDto.enableReportHistory;
linkUrl = intent.getStringExtra("LINKURL"); // LinkURL linkUrl = intent.getStringExtra("LINKURL"); // LinkURL
if (operationDto != null && operationDto.operationType == OperationType.PDF) { if (operationDto != null && operationDto.operationType == OperationType.PDF) {
isOperationPdf = true; isOperationPdf = true;
} }
} }
} }
// 遠隔連動 // 遠隔連動
meetingManager = MeetingManager.getInstance(); meetingManager = MeetingManager.getInstance();
isCollaboration = meetingManager.isCollaboration(); isCollaboration = meetingManager.isCollaboration();
mContentDir = getIntent().getStringExtra(FILEPATH); mContentDir = getIntent().getStringExtra(FILEPATH);
// Activity登録 // Activity登録
if (objectId == -1) { if (objectId == -1) {
ActivityHandlingHelper.getInstance().setContentViewActivity(this); ActivityHandlingHelper.getInstance().setContentViewActivity(this);
ContentDto dto = contentDao.getContent(contentId); ContentDto dto = contentDao.getContent(contentId);
if (dto != null) { if (dto != null) {
// 閲覧履歴保存 // 閲覧履歴保存
contentDao.updateContentReadingDate(DateTimeUtil.getCurrentTimestamp(), getContentId()); contentDao.updateContentReadingDate(DateTimeUtil.getCurrentTimestamp(), getContentId());
} }
} else { } else {
ActivityHandlingHelper.getInstance().setObjectViewActivity(this); ActivityHandlingHelper.getInstance().setObjectViewActivity(this);
} }
contentDownloader.pauseAll(); contentDownloader.pauseAll();
showUpdateContentAlert(contentId); showUpdateContentAlert(contentId);
...@@ -233,7 +233,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -233,7 +233,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
confirmDialog.setMessage(R.string.msg_content_to_be_updated); confirmDialog.setMessage(R.string.msg_content_to_be_updated);
confirmDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { confirmDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {
confirmDialog.dismiss(); confirmDialog.dismiss();
} }
}); });
...@@ -246,11 +246,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -246,11 +246,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
try { try {
if (readingLogFlg) { if (readingLogFlg) {
readingLogId = ContentLogUtil.getInstance().startContentReadLog(this, contentId, getABVUIDataCache().getPermissionAccessLocation()); readingLogId = ContentLogUtil.getInstance().startContentReadLog(this, contentId, getABVUIDataCache().getPermissionAccessLocation());
} }
} catch (Exception e) { } catch (Exception e) {
Logger.e("Exception", e); Logger.e("Exception", e);
handleErrorMessageToast(ErrorCode.E107); handleErrorMessageToast(ErrorCode.E107);
...@@ -271,27 +271,27 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -271,27 +271,27 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
@Override @Override
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
} }
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
} }
@Override @Override
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();
if (!DeviceInfo.isForegrdound(getApplicationContext()) && readingLogFlg) { if (!DeviceInfo.isForegrdound(getApplicationContext()) && readingLogFlg) {
ContentReadingLogLogic logic = AbstractLogic.getLogic(ContentReadingLogLogic.class); ContentReadingLogLogic logic = AbstractLogic.getLogic(ContentReadingLogLogic.class);
logic.pauseContentReadLog(contentId); logic.pauseContentReadLog(contentId);
} }
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
Logger.d(TAG, "onDestroy"); Logger.d(TAG, "onDestroy");
if (readingLogFlg) { if (readingLogFlg) {
ContentReadingLogLogic logic = AbstractLogic.getLogic(ContentReadingLogLogic.class); ContentReadingLogLogic logic = AbstractLogic.getLogic(ContentReadingLogLogic.class);
...@@ -304,14 +304,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -304,14 +304,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
meetingManager.sendWs(MeetingManager.CMD_CLOSEPOPUP, contentId, objectPageNumber, objectId, null); meetingManager.sendWs(MeetingManager.CMD_CLOSEPOPUP, contentId, objectPageNumber, objectId, null);
} }
if (meetingManager.isSubscribed()) { if (meetingManager.isSubscribed()) {
ActivityHandlingHelper.getInstance().refreshMeetingListActivity(); ActivityHandlingHelper.getInstance().refreshMeetingListActivity();
} }
if (objectId == -1) { if (objectId == -1) {
ActivityHandlingHelper.getInstance().removeContentViewActivity(this); ActivityHandlingHelper.getInstance().removeContentViewActivity(this);
} else { } else {
ActivityHandlingHelper.getInstance().removeObjectViewActivity(this); ActivityHandlingHelper.getInstance().removeObjectViewActivity(this);
} }
//キャッシュを使用しない場合、ディレクトリが残っていれば削除 //キャッシュを使用しない場合、ディレクトリが残っていれば削除
if (!getRBoolean(R.bool.use_cache) && objectId == -1) { if (!getRBoolean(R.bool.use_cache) && objectId == -1) {
...@@ -331,11 +331,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -331,11 +331,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
protected boolean isCursorModeEnable() { protected boolean isCursorModeEnable() {
if (isOperationPdf()) { if (isOperationPdf()) {
return false; return false;
} else { } else {
return PreferenceUtil.get(this, DefPrefKey.CURSOR_ENABLE, false); return PreferenceUtil.get(this, DefPrefKey.CURSOR_ENABLE, false);
} }
} }
protected void initError() { protected void initError() {
...@@ -365,7 +365,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -365,7 +365,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
alert.setView(layout); alert.setView(layout);
alert.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { alert.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss(); dialog.dismiss();
} }
}); });
...@@ -374,7 +374,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -374,7 +374,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 指定ページへのジャンプ // 指定ページへのジャンプ
@Override @Override
public void startContentViewActivity(long contentId, int pageNum) { public void startContentViewActivity(long contentId, int pageNum) {
Logger.d(TAG, "startContentViewActivity:%s, pageNum=%s", contentId, pageNum); Logger.d(TAG, "startContentViewActivity:%s, pageNum=%s", contentId, pageNum);
releaseInit(); releaseInit();
Intent intent = new Intent(); Intent intent = new Intent();
...@@ -444,15 +444,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -444,15 +444,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
@Override @Override
public void finish() { public void finish() {
// ホームをリロードさせる // ホームをリロードさせる
ActivityHandlingHelper.getInstance().setRequireHomeReload(true); ActivityHandlingHelper.getInstance().setRequireHomeReload(true);
super.finish(); super.finish();
Logger.d(TAG, "finish"); Logger.d(TAG, "finish");
} }
protected void commonConfigureRemote() { protected void commonConfigureRemote() {
} }
public void configureRemote() { public void configureRemote() {
} }
...@@ -475,8 +475,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -475,8 +475,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) { // if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) {
// helpButton.setLayoutParams(params); // helpButton.setLayoutParams(params);
// } // }
} }
else { // 会議室退室ボタン非表示 else { // 会議室退室ボタン非表示
if (exitMeetingBtn != null) { if (exitMeetingBtn != null) {
...@@ -487,9 +487,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -487,9 +487,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
params.rightMargin = (int) (getResources().getDisplayMetrics().density * 5); params.rightMargin = (int) (getResources().getDisplayMetrics().density * 5);
subMenuBtn.setLayoutParams(params); subMenuBtn.setLayoutParams(params);
} }
// if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) { // if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) {
// helpButton.setLayoutParams(params); // helpButton.setLayoutParams(params);
// } // }
} }
} }
}); });
...@@ -505,22 +505,22 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -505,22 +505,22 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
alert.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { alert.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {
// 遠隔連動中に保存したマーキングファイルを削除 // 遠隔連動中に保存したマーキングファイルを削除
ContentMarkingFileHelper contentMarkingFileHelper = new ContentMarkingFileHelper(); ContentMarkingFileHelper contentMarkingFileHelper = new ContentMarkingFileHelper();
contentMarkingFileHelper.deleteRemoteMarkingFile(contentId); contentMarkingFileHelper.deleteRemoteMarkingFile(contentId);
setMeetingEnteredFlg(); setMeetingEnteredFlg();
if (meetingManager.isOwner()) { if (meetingManager.isOwner()) {
try { try {
meetingManager.deleteMeeting(); meetingManager.deleteMeeting();
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, "showMeetingExitDialog deleteMeeting error", e); Logger.e(TAG, "showMeetingExitDialog deleteMeeting error", e);
ABVToastUtil.showMakeText(ABVContentViewActivity.this, getString(R.string.E126), Toast.LENGTH_SHORT); ABVToastUtil.showMakeText(ABVContentViewActivity.this, getString(R.string.E126), Toast.LENGTH_SHORT);
} }
} }
//会議室に参加する前のonCloseと識別するため //会議室に参加する前のonCloseと識別するため
meetingManager.close(); meetingManager.close();
configureRemote(); configureRemote();
ActivityHandlingHelper handlingHelper = ActivityHandlingHelper.getInstance(); ActivityHandlingHelper handlingHelper = ActivityHandlingHelper.getInstance();
...@@ -530,7 +530,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -530,7 +530,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}); });
alert.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { alert.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {
dialog.cancel(); dialog.cancel();
} }
}); });
...@@ -569,22 +569,22 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -569,22 +569,22 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (textView == null) { if (textView == null) {
return; return;
} }
textView.setVisibility(View.GONE); textView.setVisibility(View.GONE);
if (isVisible && !isCollaboration) { if (isVisible && !isCollaboration) {
if (meetingManager.isConnected() && meetingManager.isOwner()) { if (meetingManager.isConnected() && meetingManager.isOwner()) {
textView.setVisibility(View.VISIBLE); textView.setVisibility(View.VISIBLE);
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
final int count = meetingManager.getParticipantCount(); final int count = meetingManager.getParticipantCount();
handler.post(new Runnable() { handler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
textView.setText(getRString(R.string.meeting_participant_count) + ":" + count); textView.setText(getRString(R.string.meeting_participant_count) + ":" + count);
} }
}); });
} }
}); });
} }
} }
...@@ -609,14 +609,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -609,14 +609,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
} }
public int getCurrentPageNumber() { public int getCurrentPageNumber() {
return mCurrentPageNumber; return mCurrentPageNumber;
} }
/** /**
* 戻る用コンテンツIDリストをリセット * 戻る用コンテンツIDリストをリセット
*/ */
public void resetReturnContentIdList () { public void resetReturnContentIdList () {
getABVUIDataCache().resetReturnContentIdList(); getABVUIDataCache().resetReturnContentIdList();
} }
...@@ -630,25 +630,25 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -630,25 +630,25 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
/** /**
* コンテンツビューから戻るボタンタップ時の処理 * コンテンツビューから戻るボタンタップ時の処理
*/ */
public void moveToBack() { public void moveToBack() {
//戻る用コンテンツIDの数 //戻る用コンテンツIDの数
int listSize = getReturnContentIdList().size(); int listSize = getReturnContentIdList().size();
if (listSize == 0) { if (listSize == 0) {
finish(); finish();
} else { } else {
long[] contentInfo = getReturnContentIdList().get(listSize - 1); long[] contentInfo = getReturnContentIdList().get(listSize - 1);
// 直前のコンテンツが360コンテンツか確認⇒画面遷移ではなくfinish()で廃棄することで戻る // 直前のコンテンツが360コンテンツか確認⇒画面遷移ではなくfinish()で廃棄することで戻る
if (ActivityHandlingHelper.getInstance().hasPreviousPanoContentId(contentInfo[0])) { if (ActivityHandlingHelper.getInstance().hasPreviousPanoContentId(contentInfo[0])) {
finish(); finish();
} else { } else {
ActivityHandlingHelper.getInstance().startContentActivity(contentInfo[0], (int) contentInfo[1]); ActivityHandlingHelper.getInstance().startContentActivity(contentInfo[0], (int) contentInfo[1]);
} }
if (this instanceof HTMLXWalkWebViewActivity) { if (this instanceof HTMLXWalkWebViewActivity) {
return; return;
} }
getReturnContentIdList().remove(listSize - 1); getReturnContentIdList().remove(listSize - 1);
} }
} }
/** /**
* コンテンツビューから戻るボタンタップ時の処理(ABookCheck専用) * コンテンツビューから戻るボタンタップ時の処理(ABookCheck専用)
...@@ -658,29 +658,29 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -658,29 +658,29 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
finish(); finish();
} }
protected void createCheckToolbar() { protected void createCheckToolbar() {
final RelativeLayout fl; final RelativeLayout fl;
if (operationDto != null && operationDto.operationType == OperationType.PDF && mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { if (operationDto != null && operationDto.operationType == OperationType.PDF && mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
fl = (RelativeLayout) findViewById(R.id.RelativeLayout2); fl = (RelativeLayout) findViewById(R.id.RelativeLayout2);
} else { } else {
fl = (RelativeLayout) findViewById(R.id.frameTopbar); fl = (RelativeLayout) findViewById(R.id.frameTopbar);
} }
fl.setBackgroundColor(getResources().getColor(R.color.operation_color)); fl.setBackgroundColor(getResources().getColor(R.color.operation_color));
operationHomeButton = (ImageButton) findViewById(R.id.btn_operation_home); operationHomeButton = (ImageButton) findViewById(R.id.btn_operation_home);
quickReportPrintButton = (ImageButton) findViewById(R.id.btn_operation_print); quickReportPrintButton = (ImageButton) findViewById(R.id.btn_operation_print);
operationHomeButton.setOnClickListener(new View.OnClickListener() { operationHomeButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
showConfirmSavePanoEdit(); showConfirmSavePanoEdit();
} else { } else {
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。 // 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
finishActivity(); // 開いてる画面を閉じる finishActivity(); // 開いてる画面を閉じる
} }
} }
}); });
operationHomeButton.setVisibility(View.VISIBLE); operationHomeButton.setVisibility(View.VISIBLE);
if(operationDto != null && operationDto.operationType == OperationType.PDF){ if(operationDto != null && operationDto.operationType == OperationType.PDF){
// 簡易帳票印刷ボタン // 簡易帳票印刷ボタン
...@@ -701,58 +701,58 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -701,58 +701,58 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
} }
taskListButton = (ImageButton) findViewById(R.id.btn_show_task_list); taskListButton = (ImageButton) findViewById(R.id.btn_show_task_list);
taskListButton.setOnClickListener(new View.OnClickListener() { taskListButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
// 作業一覧表示 // 作業一覧表示
showTaskList(); showTaskList();
} }
}); });
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
if (mOperationType != OperationType.PDF && isNormalSize()) { if (mOperationType != OperationType.PDF && isNormalSize()) {
// 縦画面固定 // 縦画面固定
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} }
mOperationType = operationDto.operationType; mOperationType = operationDto.operationType;
String cacheDirPath = ABVEnvironment.getInstance().getContentCacheDirectoryPath(getContentId()); String cacheDirPath = ABVEnvironment.getInstance().getContentCacheDirectoryPath(getContentId());
if (operationDto.operationType == OperationType.LIST) { if (operationDto.operationType == OperationType.LIST) {
mContentPath = ABVEnvironment.getInstance().getTaskListDirName(cacheDirPath); mContentPath = ABVEnvironment.getInstance().getTaskListDirName(cacheDirPath);
if (operationDto.reportType == Constant.ReportType.ReportContinuous) { if (operationDto.reportType == Constant.ReportType.ReportContinuous) {
mContentPath = ABVEnvironment.getInstance().getProcessListDirName(cacheDirPath); mContentPath = ABVEnvironment.getInstance().getProcessListDirName(cacheDirPath);
} }
} else if (operationDto.operationType == OperationType.PDF) { } else if (operationDto.operationType == OperationType.PDF) {
mContentPath = ABVEnvironment.getInstance().getTaskPdfDirName(cacheDirPath); mContentPath = ABVEnvironment.getInstance().getTaskPdfDirName(cacheDirPath);
} else { } else {
mContentPath = ABVEnvironment.getInstance().getPanoImageDirName(cacheDirPath); mContentPath = ABVEnvironment.getInstance().getPanoImageDirName(cacheDirPath);
} }
mStatusCode = 0; mStatusCode = 0;
} }
operationNameTitle = (TextView) findViewById(R.id.title); operationNameTitle = (TextView) findViewById(R.id.title);
operationNameTitle.setText(operationDto.operationName); operationNameTitle.setText(operationDto.operationName);
if (isNormalSize()) { if (isNormalSize()) {
operationNameTitle.setWidth(getRDimensionSize(R.dimen.operation_title_normal_width)); operationNameTitle.setWidth(getRDimensionSize(R.dimen.operation_title_normal_width));
} else { } else {
operationNameTitle.setWidth(getRDimensionSize(R.dimen.operation_title_large_width)); operationNameTitle.setWidth(getRDimensionSize(R.dimen.operation_title_large_width));
} }
operationNameTitle.setVisibility(View.VISIBLE); operationNameTitle.setVisibility(View.VISIBLE);
} }
} }
/** /**
* 簡易帳票印刷対象選択画面表示 * 簡易帳票印刷対象選択画面表示
*/ */
private void showPrintTargetSelect(OperationDto operationDto) { private void showPrintTargetSelect(OperationDto operationDto) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClass(ABVContentViewActivity.this, OnlineHTMLWebViewActivity.class); intent.setClass(ABVContentViewActivity.this, OnlineHTMLWebViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("LINKURL", AcmsApis.getApiUrl(ABVEnvironment.getInstance().acmsAddress, ABVDataCache.getInstance().getUrlPath(), AcmsApis.ApiQuickReportRevision) + "?isNative=1"); intent.putExtra("LINKURL", AcmsApis.getApiUrl(ABVEnvironment.getInstance().acmsAddress, ABVDataCache.getInstance().getUrlPath(), AcmsApis.ApiQuickReportRevision) + "?isNative=1");
intent.putExtra("operationId", mOperationId); intent.putExtra("operationId", mOperationId);
startActivity(intent, NaviConsts.Right); startActivity(intent, NaviConsts.Right);
} }
/** /**
...@@ -808,124 +808,124 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -808,124 +808,124 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected void finishActivity() {} protected void finishActivity() {}
protected void webViewLoadUrl(String url){} protected void webViewLoadUrl(String url){}
public void onClickOperationHome(View v) { public void onClickOperationHome(View v) {
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
// リソースパターンの適用 // リソースパターンの適用
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ABVContentViewActivity.this, PatternStringUtil.patternToString(getApplicationContext(), ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ABVContentViewActivity.this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.pano_edit, R.string.pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
// リソースパターンの適用 // リソースパターンの適用
alertDialog.setMessage(PatternStringUtil.patternToString(getApplicationContext(), alertDialog.setMessage(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_confirm_save_pano_edit, R.string.msg_confirm_save_pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
alertDialog.setNegativeButton(R.string.cancel, null); alertDialog.setNegativeButton(R.string.cancel, null);
alertDialog.setPositiveButton(R.string.ok, alertDialog.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
callUnloadAuth(); callUnloadAuth();
dialog.dismiss(); dialog.dismiss();
finish(); finish();
} }
}); });
alertDialog.show(); alertDialog.show();
} else { } else {
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。 // 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); // 作業IDの設定 putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); // 作業IDの設定
finishActivity(); // 開いてる画面を閉じる finishActivity(); // 開いてる画面を閉じる
} }
} }
/** /**
* Be override * Be override
*/ */
protected void onActionOperationPdfWebView(Map<String, String> checkParam, OperationTaskDto operationTaskDto) {} protected void onActionOperationPdfWebView(Map<String, String> checkParam, OperationTaskDto operationTaskDto) {}
// public void onClickShowHelpView(View v) { // public void onClickShowHelpView(View v) {
// int helpViewType = 0; // int helpViewType = 0;
// switch (mStatusCode) { // switch (mStatusCode) {
// case Constant.XWalkWebViewDisplayStatus.InitView: // case Constant.XWalkWebViewDisplayStatus.InitView:
// if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { // if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
// helpViewType = Constant.HelpViewType.PanoContentEdit; // helpViewType = Constant.HelpViewType.PanoContentEdit;
// } else { // } else {
// switch (mOperationType) { // switch (mOperationType) {
// case OperationType.LIST: // case OperationType.LIST:
// switch (mXWalkOpenType) { // switch (mXWalkOpenType) {
// case Constant.XWalkOpenType.TASK_DERECTION: // case Constant.XWalkOpenType.TASK_DERECTION:
// helpViewType = Constant.HelpViewType.ListOperationDirector; // helpViewType = Constant.HelpViewType.ListOperationDirector;
// break; // break;
// case Constant.XWalkOpenType.TASK_REPORT: // case Constant.XWalkOpenType.TASK_REPORT:
// if (operationDto.reportType == Constant.ReportType.RoutineTask) { // if (operationDto.reportType == Constant.ReportType.RoutineTask) {
// helpViewType = Constant.HelpViewType.RoutineTaskOperation; // helpViewType = Constant.HelpViewType.RoutineTaskOperation;
// } else { // } else {
// helpViewType = Constant.HelpViewType.ListOperationReporter; // helpViewType = Constant.HelpViewType.ListOperationReporter;
// } // }
// break; // break;
// } // }
// break; // break;
// case OperationType.DRAWING: // case OperationType.DRAWING:
// case OperationType.PDF: // case OperationType.PDF:
// switch (mXWalkOpenType) { // switch (mXWalkOpenType) {
// case Constant.XWalkOpenType.TASK_DERECTION: // case Constant.XWalkOpenType.TASK_DERECTION:
// helpViewType = Constant.HelpViewType.DrawingOperationDirector; // helpViewType = Constant.HelpViewType.DrawingOperationDirector;
// break; // break;
// case Constant.XWalkOpenType.TASK_REPORT: // case Constant.XWalkOpenType.TASK_REPORT:
// helpViewType = Constant.HelpViewType.DrawingOperationReporter; // helpViewType = Constant.HelpViewType.DrawingOperationReporter;
// break; // break;
// } // }
// break; // break;
// case OperationType.PANO: // case OperationType.PANO:
// switch (mXWalkOpenType) { // switch (mXWalkOpenType) {
// case Constant.XWalkOpenType.TASK_DERECTION: // case Constant.XWalkOpenType.TASK_DERECTION:
// helpViewType = Constant.HelpViewType.PanoOperationDirector; // helpViewType = Constant.HelpViewType.PanoOperationDirector;
// break; // break;
// case Constant.XWalkOpenType.TASK_REPORT: // case Constant.XWalkOpenType.TASK_REPORT:
// helpViewType = Constant.HelpViewType.PanoOperationReporter; // helpViewType = Constant.HelpViewType.PanoOperationReporter;
// break; // break;
// } // }
// //
// break; // break;
// } // }
// } // }
// break; // break;
// case Constant.XWalkWebViewDisplayStatus.TaskView: // case Constant.XWalkWebViewDisplayStatus.TaskView:
// if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { // if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
// helpViewType = Constant.HelpViewType.DirectorTask; // helpViewType = Constant.HelpViewType.DirectorTask;
// } else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { // } else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
// if (operationDto.reportType == Constant.ReportType.RoutineTask) { // if (operationDto.reportType == Constant.ReportType.RoutineTask) {
// helpViewType = Constant.HelpViewType.RoutineTaskOperationReport; // helpViewType = Constant.HelpViewType.RoutineTaskOperationReport;
// } else { // } else {
// helpViewType = Constant.HelpViewType.ReportTask; // helpViewType = Constant.HelpViewType.ReportTask;
// } // }
// } // }
// break; // break;
// case Constant.XWalkWebViewDisplayStatus.ReportPreView: // case Constant.XWalkWebViewDisplayStatus.ReportPreView:
// helpViewType = Constant.HelpViewType.ReportPreview; // helpViewType = Constant.HelpViewType.ReportPreview;
// break; // break;
// case Constant.XWalkWebViewDisplayStatus.TaskListView: // case Constant.XWalkWebViewDisplayStatus.TaskListView:
// if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { // if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
// helpViewType = Constant.HelpViewType.DirectorTaskList; // helpViewType = Constant.HelpViewType.DirectorTaskList;
// } else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { // } else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
// helpViewType = Constant.HelpViewType.ReportTaskList; // helpViewType = Constant.HelpViewType.ReportTaskList;
// } // }
// break; // break;
// } // }
// //
// showHelpViewDialog(helpViewType); // showHelpViewDialog(helpViewType);
// } // }
public void commonShouldOverrideUrlLoading (Uri uri, OperationTaskDto operationTaskDto) { public void commonShouldOverrideUrlLoading (Uri uri, OperationTaskDto operationTaskDto) {
Logger.d(TAG, "Uri : %s", uri); Logger.d(TAG, "Uri : %s", uri);
//parent method //parent method
Map<String, String> abookCheckParam = new HashMap<String, String>(); Map<String, String> abookCheckParam = new HashMap<String, String>();
for (String key : uri.getQueryParameterNames()) { for (String key : uri.getQueryParameterNames()) {
abookCheckParam.put(key, uri.getQueryParameter(key)); abookCheckParam.put(key, uri.getQueryParameter(key));
} }
mCmd = abookCheckParam.get(ABookKeys.CMD); mCmd = abookCheckParam.get(ABookKeys.CMD);
if (abookCheckParam.containsKey(ABookKeys.TASK_KEY)) { if (abookCheckParam.containsKey(ABookKeys.TASK_KEY)) {
mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY); mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY);
} }
int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答)) int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) { if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) {
taskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル taskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル
...@@ -961,23 +961,23 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -961,23 +961,23 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
try { try {
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT)) { if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT)) {
// リソースパターンの適用 // リソースパターンの適用
showProgressPopup(PatternStringUtil.patternToString(getApplicationContext(), showProgressPopup(PatternStringUtil.patternToString(getApplicationContext(),
R.string.file_initialization, R.string.file_initialization,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} }
//連続作業の全削除ボタンタップ時のインジケーター表示 //連続作業の全削除ボタンタップ時のインジケーター表示
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_DELETE_PROCESS)) { if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_DELETE_PROCESS)) {
showProgressPopup(PatternStringUtil.patternToString(getApplicationContext(), showProgressPopup(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_common_processing, R.string.msg_common_processing,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} }
if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd, if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd,
ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_INSERT_TASK_REPORT,
ABookKeys.CMD_UPDATE_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_MOVE_HOT_SPOT,
ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) { ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
String taskCode = ""; String taskCode = "";
...@@ -1102,47 +1102,47 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1102,47 +1102,47 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME); mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// 作業報告画面改善 // 作業報告画面改善
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, true, taskReportLevel, processKey, phaseNo); ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, true, taskReportLevel, processKey, phaseNo);
} else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) { } else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) {
showProgressPopup(); showProgressPopup();
handler.postDelayed(new Runnable() { handler.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
closeProgressPopup(); closeProgressPopup();
finish(); finish();
} }
}, 5000); }, 5000);
} else if (mCmd.equals(ABookKeys.CMD_GET_GPS_INFO)) { } else if (mCmd.equals(ABookKeys.CMD_GET_GPS_INFO)) {
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
setLocation((Integer.valueOf(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1)); setLocation((Integer.valueOf(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1));
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
} else if (mCmd.equals(ABookKeys.CMD_SCENE_REGIST)) { } else if (mCmd.equals(ABookKeys.CMD_SCENE_REGIST)) {
String successFlg = abookCheckParam.get(ABookKeys.SUCCESS_FLG); String successFlg = abookCheckParam.get(ABookKeys.SUCCESS_FLG);
if(Integer.parseInt(successFlg) == 0) { if(Integer.parseInt(successFlg) == 0) {
// リソースパターンの適用 // リソースパターンの適用
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, PatternStringUtil.patternToInt(getApplicationContext(), ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.pano_edit, R.string.pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
alertDialog.setMessage(PatternStringUtil.patternToInt(getApplicationContext(), alertDialog.setMessage(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.msg_sence_regist_failed, R.string.msg_sence_regist_failed,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
alertDialog.setPositiveButton(R.string.ok, alertDialog.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
dialog.dismiss(); dialog.dismiss();
} }
}); });
alertDialog.show(); alertDialog.show();
} else { } else {
progressDialog.setProgress(100); progressDialog.setProgress(100);
// 成功 // 成功
Logger.i(TAG, ABookKeys.CMD_SCENE_REGIST + "is success"); Logger.i(TAG, ABookKeys.CMD_SCENE_REGIST + "is success");
progressDialog.setProgress(0); progressDialog.setProgress(0);
} }
closeProgressPopup(); closeProgressPopup();
} else if (mCmd.equals(ABookKeys.CMD_MOVE_PAGE)) { } else if (mCmd.equals(ABookKeys.CMD_MOVE_PAGE)) {
onActionOperationPdfWebView(abookCheckParam, operationTaskDto); onActionOperationPdfWebView(abookCheckParam, operationTaskDto);
} else if (mCmd.equals(ABookKeys.CMD_SHOW_RELATED_CONTENT)) { } else if (mCmd.equals(ABookKeys.CMD_SHOW_RELATED_CONTENT)) {
try { try {
long linkedContentId = Long.valueOf(abookCheckParam.get(ABookKeys.CONTENT_ID)); long linkedContentId = Long.valueOf(abookCheckParam.get(ABookKeys.CONTENT_ID));
...@@ -1171,40 +1171,40 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1171,40 +1171,40 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
finishActivity(); // 開いてる画面を閉じる finishActivity(); // 開いてる画面を閉じる
} }
} }
} }
public void commonAttachedDataUrl (String taskKey, String data) { public void commonAttachedDataUrl (String taskKey, String data) {
boolean isError = false; boolean isError = false;
if (data != null) { if (data != null) {
try { try {
String imagePath = ABVEnvironment.getInstance().getTempFilePath(getContentId(), taskKey, mAttachedFileName); String imagePath = ABVEnvironment.getInstance().getTempFilePath(getContentId(), taskKey, mAttachedFileName);
ABookCheckWebViewHelper.getInstance().decodeToImage(data, imagePath); ABookCheckWebViewHelper.getInstance().decodeToImage(data, imagePath);
//アプリ内のファイルのみ削除(Galleryファイルは削除しない) //アプリ内のファイルのみ削除(Galleryファイルは削除しない)
if (mLocalFile != null && mLocalFile.getPath().contains(getPackageName())) { if (mLocalFile != null && mLocalFile.getPath().contains(getPackageName())) {
FileUtil.delete(mLocalFile); FileUtil.delete(mLocalFile);
} }
mLocalFile = null; mLocalFile = null;
//編集可能可否をチェックする。 //編集可能可否をチェックする。
if (mEnablePhotoEdit.equals("1")) { //編集の場合、編集画面を開ける。 if (mEnablePhotoEdit.equals("1")) { //編集の場合、編集画面を開ける。
commonOpenEditPage(); commonOpenEditPage();
} }
} catch (Exception e) { } catch (Exception e) {
isError = true; isError = true;
Logger.e(TAG, e); Logger.e(TAG, e);
} }
} }
afterABookCheckApi(mCmd, taskKey, isError ? 1 : 0, "", null); afterABookCheckApi(mCmd, taskKey, isError ? 1 : 0, "", null);
} }
protected Uri attachmentImageProcessing(Uri uri) throws Exception { protected Uri attachmentImageProcessing(Uri uri) throws Exception {
if (uri == null) { if (uri == null) {
return null; return null;
} }
String[] operationion = {MediaStore.MediaColumns.DATA}; String[] operationion = {MediaStore.MediaColumns.DATA};
Cursor cursor = getContentResolver().query(uri, operationion, null, null, null); Cursor cursor = getContentResolver().query(uri, operationion, null, null, null);
String photoFilePath = ABookCheckWebViewHelper.getInstance().contentSchemeUriToFilePath(cursor); String photoFilePath = ABookCheckWebViewHelper.getInstance().contentSchemeUriToFilePath(cursor);
try { try {
int rotationAngle = ABookCheckWebViewHelper.getInstance().rotateBitmapOrientation(photoFilePath); int rotationAngle = ABookCheckWebViewHelper.getInstance().rotateBitmapOrientation(photoFilePath);
if (rotationAngle == 0) { if (rotationAngle == 0) {
mLocalFile = new File(photoFilePath); mLocalFile = new File(photoFilePath);
...@@ -1217,106 +1217,106 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1217,106 +1217,106 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
Logger.e(TAG, "image file is not found", e); Logger.e(TAG, "image file is not found", e);
} }
return null; return null;
} }
public void afterABookCheckApi(final String cmd, final String taskKey, final int result, final String message, final String extParam) { public void afterABookCheckApi(final String cmd, final String taskKey, final int result, final String message, final String extParam) {
afterABookCheckApi(cmd, taskKey, result, message, extParam, false); afterABookCheckApi(cmd, taskKey, result, message, extParam, false);
} }
public void afterABookCheckApi(final String cmd, final String taskKey, final int result, final String message, final String extParam, final boolean isParent) { public void afterABookCheckApi(final String cmd, final String taskKey, final int result, final String message, final String extParam, final boolean isParent) {
Logger.v(TAG, "run javaScript for ABookCheck : cmd=%s, taskKey=%s, result=%s, message=%s", cmd, taskKey, result, message); Logger.v(TAG, "run javaScript for ABookCheck : cmd=%s, taskKey=%s, result=%s, message=%s", cmd, taskKey, result, message);
final String finalParent = isParent ? "window.parent." : ""; final String finalParent = isParent ? "window.parent." : "";
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
if (extParam != null) { if (extParam != null) {
Logger.i(TAG, String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)", finalParent, cmd, taskKey, result, message, extParam)); Logger.i(TAG, String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)", finalParent, cmd, taskKey, result, message, extParam));
webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)", finalParent, cmd, taskKey, result, message, extParam)); webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)", finalParent, cmd, taskKey, result, message, extParam));
} else { } else {
Logger.i(TAG, String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message)); Logger.i(TAG, String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message));
webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message)); webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message));
} }
}
});
}
protected void commonConfigureHeader() {
}
/**
* 添付ファイルのBase64文字列取得
*/
public void getAttachedDataUrl(final String taskKey) {
runOnUiThread(new Runnable() {
@Override
public void run() {
webViewLoadUrl("javascript:android.getAttachedDataUrl('" + taskKey + "', CHK.getAttachedDataUrl())");
} }
}); });
} }
protected void commonConfigureHeader() {
}
/**
* 添付ファイルのBase64文字列取得
*/
public void getAttachedDataUrl(final String taskKey) {
runOnUiThread(new Runnable() {
@Override
public void run() {
webViewLoadUrl("javascript:android.getAttachedDataUrl('" + taskKey + "', CHK.getAttachedDataUrl())");
}
});
}
public void openEditPage(){ public void openEditPage(){
webViewLoadUrl("javascript:android.openEditPage()"); webViewLoadUrl("javascript:android.openEditPage()");
} }
/** /**
* 位置情報取得 * 位置情報取得
* @param showPermissionDialogFlg * @param showPermissionDialogFlg
*/ */
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
protected void setLocation(final boolean showPermissionDialogFlg) { protected void setLocation(final boolean showPermissionDialogFlg) {
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
ABookPermissionHelper helper = new ABookPermissionHelper(this, Constant.ABookPermissionType.AccessFineLocation, null); ABookPermissionHelper helper = new ABookPermissionHelper(this, Constant.ABookPermissionType.AccessFineLocation, null);
if (helper.checkMultiPermissions(showPermissionDialogFlg)) { if (helper.checkMultiPermissions(showPermissionDialogFlg)) {
// 位置情報取得 // 位置情報取得
LocationManagerUtil locationManagerUtil = new LocationManagerUtil(this, new LocationManagerUtil.LocationManagerUtilListener() { LocationManagerUtil locationManagerUtil = new LocationManagerUtil(this, new LocationManagerUtil.LocationManagerUtilListener() {
@Override @Override
public void onGetLocationFailed() { public void onGetLocationFailed() {
Logger.w(TAG, "onGetLocationFailed"); Logger.w(TAG, "onGetLocationFailed");
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
afterABookCheckApi(mCmd, "", 1, PatternStringUtil.patternToString(getApplicationContext(), afterABookCheckApi(mCmd, "", 1, PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_location_search_fail, R.string.msg_location_search_fail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), null); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), null);
} }
@Override @Override
public void onGetLocation(final Location location) { public void onGetLocation(final Location location) {
latitude = location.getLatitude(); latitude = location.getLatitude();
longitude = location.getLongitude(); longitude = location.getLongitude();
Logger.v(TAG, "location latitude(%s), longitude(%s)", latitude, longitude); Logger.v(TAG, "location latitude(%s), longitude(%s)", latitude, longitude);
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("latitude", latitude); json.put("latitude", latitude);
json.put("longitude", longitude); json.put("longitude", longitude);
afterABookCheckApi(mCmd, "", 0, "", json.toString()); afterABookCheckApi(mCmd, "", 0, "", json.toString());
}; };
}); });
} }
}); });
locationManagerUtil.startLocationService(); locationManagerUtil.startLocationService();
} else { } else {
Logger.w(TAG,"onGetLocationFailed AccessFineLocation false"); Logger.w(TAG,"onGetLocationFailed AccessFineLocation false");
// リソースパターンの適用 // リソースパターンの適用
afterABookCheckApi(mCmd, "", 1, PatternStringUtil.patternToString(getApplicationContext(), afterABookCheckApi(mCmd, "", 1, PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_location_search_fail, R.string.msg_location_search_fail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), null); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), null);
} }
} }
protected boolean isOperationPdf() { protected boolean isOperationPdf() {
return isOperationPdf; return isOperationPdf;
} }
/** /**
* 報告可能フラグ * 報告可能フラグ
* @return * @return
*/ */
public boolean isReportEdit() { public boolean isReportEdit() {
return mEnableReportEdit == Constant.EnableReportEdit.YES; return mEnableReportEdit == Constant.EnableReportEdit.YES;
} }
/** /**
* PDF操作インスタンスを作成 * PDF操作インスタンスを作成
......
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