Commit 980023b5 by Lee Jaebin

関連資料リンク・資料間リンク時、資料の更新メッセージ表示処理(共通化)

parent 6a06d49a
...@@ -495,6 +495,7 @@ ...@@ -495,6 +495,7 @@
<string name="Report">Report</string> <string name="Report">Report</string>
<string name="Routine">Routine</string> <string name="Routine">Routine</string>
<string name="ReportReply">ReportReply</string> <string name="ReportReply">ReportReply</string>
<string name="content_link_update">The document name [%1$s] will be updated. \nDo you want to update it?</string>
<!-- 1.0.1 Resource Pattern 1 --> <!-- 1.0.1 Resource Pattern 1 -->
<!-- 1.9.0.0--> <!-- 1.9.0.0-->
......
...@@ -111,6 +111,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -111,6 +111,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
private volatile ABVContentViewActivity objectViewActivity; private volatile ABVContentViewActivity objectViewActivity;
private MeetingManager meetingManager; private MeetingManager meetingManager;
private ABookAlertDialog downloadConfirmDialog; private ABookAlertDialog downloadConfirmDialog;
private ABookAlertDialog updateConfirmDialog;
private boolean requireHomeReload; private boolean requireHomeReload;
private ABookAlertDialog promotionRequestAlertDialog; private ABookAlertDialog promotionRequestAlertDialog;
private long lastDisconnect; private long lastDisconnect;
...@@ -1032,8 +1033,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1032,8 +1033,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
public void run() { public void run() {
if (meetingManager.isConnected()) { // 会議室参加の場合 if (meetingManager.isConnected()) { // 会議室参加の場合
meetingManager.setPaused(false); meetingManager.setPaused(false);
} else { // カスタムURIの場合
startContentActivity(data.contentId, 0);
} }
contentDownloader.removeContentDownloadListener(ActivityHandlingHelper.this); contentDownloader.removeContentDownloadListener(ActivityHandlingHelper.this);
} }
...@@ -1075,7 +1074,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1075,7 +1074,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
return false; return false;
} }
if (contentDto.downloadedFlg) { // DLの場合はOK if (contentDto.downloadedFlg && !contentDto.updatedFlg) { // DL && Update済みの場合はOK
return true; return true;
} }
...@@ -1113,12 +1112,23 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1113,12 +1112,23 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
} }
} }
} else { } else {
handler.post(new Runnable() { if (contentDto.downloadedFlg && contentDto.updatedFlg) {
@Override // 更新処理
public void run() { handler.post(new Runnable() {
showDownloadConfirm(contentId, contentDto.contentName); @Override
} public void run() {
}); showUpdateConfirm(contentId, contentDto.contentName);
}
});
} else {
// ダウンロード処理
handler.post(new Runnable() {
@Override
public void run() {
showDownloadConfirm(contentId, contentDto.contentName);
}
});
}
} }
} }
...@@ -1229,6 +1239,39 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1229,6 +1239,39 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
} }
}); });
} }
/**
* 資料の更新ダイアログ生成処理
* @param contentId
*/
private void createUpdateConfirm(final long contentId, final String contentName) {
if (updateConfirmDialog != null && updateConfirmDialog.isShowing()) { // すでにダイアログがある場合は閉じる
updateConfirmDialog.dismiss();
}
updateConfirmDialog = AlertDialogUtil.createAlertDialog(getCurrentActivity(), R.string.confirm);
updateConfirmDialog.setCancelable(false);
updateConfirmDialog.setMessage(String.format(mContext.getString(R.string.content_link_update), contentName));
updateConfirmDialog.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
updateConfirmDialog.dismiss();
downloadContent(contentId);
updateConfirmDialog = null;
}
});
updateConfirmDialog.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
updateConfirmDialog.dismiss();
startContentActivity(contentId, 0);
updateConfirmDialog = null;
}
});
}
/** /**
* DL確認ダイアローグ表示 * DL確認ダイアローグ表示
* *
...@@ -1240,6 +1283,17 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1240,6 +1283,17 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
downloadConfirmDialog.show(); downloadConfirmDialog.show();
} }
// 資料更新画面表示
private void showUpdateConfirm(final long contentId, final String contentName) {
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
// インターネットが繋がってない場合は、更新前の関連資料を開く
startContentActivity(contentId, 0);
} else {
createUpdateConfirm(contentId, contentName);
updateConfirmDialog.show();
}
}
public void finishContentObjectActivity() { public void finishContentObjectActivity() {
if (objectViewActivity != null) { if (objectViewActivity != null) {
objectViewActivity.finish(); objectViewActivity.finish();
......
package jp.agentec.abook.abv.ui.home.helper; package jp.agentec.abook.abv.ui.home.helper;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
...@@ -19,7 +18,6 @@ import jp.agentec.abook.abv.bl.common.log.Logger; ...@@ -19,7 +18,6 @@ import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic; import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.ABVApplication; import jp.agentec.abook.abv.launcher.android.ABVApplication;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -144,7 +142,7 @@ public class OperationListHelper { ...@@ -144,7 +142,7 @@ public class OperationListHelper {
OperationDto operationDto = (OperationDto) parent.getAdapter().getItem(position); OperationDto operationDto = (OperationDto) parent.getAdapter().getItem(position);
if (operationDto.contentId != null && operationDto.contentId != 0) { if (operationDto.contentId != null && operationDto.contentId != 0) {
// 作業画面 // 作業画面
mAppActivity.openDirectionsOrReportView(operationDto); mAppActivity.openReportView(operationDto);
} else { } else {
if (operationDto.operationType == PANO) { if (operationDto.operationType == PANO) {
// パノラマ登録画面 // パノラマ登録画面
...@@ -215,10 +213,8 @@ public class OperationListHelper { ...@@ -215,10 +213,8 @@ public class OperationListHelper {
public void onItemClick(AdapterView<?> parent, View view, int position, long operationId) { public void onItemClick(AdapterView<?> parent, View view, int position, long operationId) {
OperationDto operationDto = (OperationDto) parent.getAdapter().getItem(position); OperationDto operationDto = (OperationDto) parent.getAdapter().getItem(position);
if (operationDto.contentId != null && operationDto.contentId != 0) { if (operationDto.contentId != null && operationDto.contentId != 0) {
//TODO テスト用のため、削除
ABVToastUtil.showMakeText(mAppActivity, "open operationId : " + operationId, Toast.LENGTH_LONG);
// 作業画面 // 作業画面
mAppActivity.openDirectionsOrReportView(operationDto); mAppActivity.openReportView(operationDto);
} else { } else {
if (operationDto.operationType == PANO) { if (operationDto.operationType == PANO) {
// パノラマ登録画面 // パノラマ登録画面
......
...@@ -638,7 +638,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -638,7 +638,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
Logger.d(TAG, "onDownloadingContentZip ...........................................>");
if (notification.getDownloadStatus() == DownloadStatusType.Downloading) { if (notification.getDownloadStatus() == DownloadStatusType.Downloading) {
Logger.d(TAG, "onDownloadingContentZip .....................Downloading......................>"); Logger.d(TAG, "onDownloadingContentZip .....................Downloading......................>");
ABVToastUtil.showMakeText(getApplicationContext(), R.string.reader_downloading, Toast.LENGTH_SHORT); ABVToastUtil.showMakeText(getApplicationContext(), R.string.reader_downloading, Toast.LENGTH_SHORT);
......
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