Commit adcea12a by Lee Jaebin

一時保存処理修正

PDFレンダリング処理修正
OZDのプレビュー処理
parent d69c2733
...@@ -958,6 +958,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -958,6 +958,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
closeCurrentScreen(mOperationType); closeCurrentScreen(mOperationType);
} }
} else { } else {
// ozd画面ではない一時保存処理時、コールバックを呼び出す
if (mCmd.equals(ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
return null;
}
if (mAddReport) { // 作業追加ありの場合 if (mAddReport) { // 作業追加ありの場合
// コールバック処理のみ行う。 // コールバック処理のみ行う。
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf()); afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
...@@ -999,7 +1005,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -999,7 +1005,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} else if (mCmd.equals(ABookKeys.CMD_PREVIEW_REPORT_OZD)) { } else if (mCmd.equals(ABookKeys.CMD_PREVIEW_REPORT_OZD)) {
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, false, taskReportLevel); ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, true, taskReportLevel);
} 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() {
......
...@@ -217,6 +217,11 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -217,6 +217,11 @@ public class OperationListActivity extends ABVUIActivity {
mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu); mCommunicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
mCommonContentButton = (ImageButton) findViewById(R.id.btn_common_content); mCommonContentButton = (ImageButton) findViewById(R.id.btn_common_content);
// 作業一覧のタイトルパータンでセット
mTitleView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.operation_list,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
mViewModeButton.setOnClickListener(new View.OnClickListener() { mViewModeButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
......
...@@ -109,36 +109,17 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -109,36 +109,17 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
String rearTitle = ""; String rearTitle = "";
// TODO リソース変更 // TODO リソース変更
// if (mDirectionFlg) {
// リソースパターンの適用 // リソースパターンの適用
// frontTitle = PatternStringUtil.patternToString(getApplicationContext(),
// R.string.title_operation_direction_form,
// getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
// } else {
frontTitle = PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_operation_report_form,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
// }
if (mReadOnlyFlg) {
// リソースパターンの適用
rearTitle = PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_preview,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
} else {
rearTitle = PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_input,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
}
TextView tvTitle = (TextView) findViewById(R.id.tv_title); TextView tvTitle = (TextView) findViewById(R.id.tv_title);
tvTitle.setText(frontTitle + rearTitle);
// OZ閲覧画面に表示するボタン表示の可否設定 // OZ閲覧画面に表示するボタン表示の可否設定
// 一時保存情報についてボタン表示:「0:false、一時保存ボタン非表示」「1:ture、一時保存ボタン表示」 // 一時保存情報についてボタン表示:「0:false、一時保存ボタン非表示」「1:ture、一時保存ボタン表示」
mLocalSave = intent.getBooleanExtra(ABookKeys.LOCAL_SAVE, false); mLocalSave = intent.getBooleanExtra(ABookKeys.LOCAL_SAVE, false);
// 作業追加区分についてボタンを表示:「0:false、作業追加区分なし、作業一覧へボタン」「1:ture、作業追加区分あり、閉じるボタン」 // 作業追加区分についてボタンを表示:「0:false、作業追加区分なし、作業一覧へボタン」「1:ture、作業追加区分あり、閉じるボタン」
mAddReport = intent.getBooleanExtra(ABookKeys.ADD_REPORT, false); mAddReport = intent.getBooleanExtra(ABookKeys.ADD_REPORT, true);
final Button homeButton = (Button) findViewById(R.id.btn_operation_home); final Button homeButton = (Button) findViewById(R.id.btn_operation_home);
final Button closeButton = (Button) findViewById(R.id.btn_close); final Button closeButton = (Button) findViewById(R.id.btn_close);
...@@ -146,14 +127,41 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -146,14 +127,41 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
final Button saveButton = (Button) findViewById(R.id.btn_save); final Button saveButton = (Button) findViewById(R.id.btn_save);
final Button deleteButton = (Button) findViewById(R.id.btn_delete); final Button deleteButton = (Button) findViewById(R.id.btn_delete);
// 一時ボタン表示可否判断 frontTitle = PatternStringUtil.patternToString(getApplicationContext(),
homeButton.setVisibility(mAddReport ? View.GONE : View.VISIBLE); R.string.work_report,
closeButton.setVisibility(mAddReport ? View.VISIBLE : View.GONE); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
tempSaveButton.setVisibility(mLocalSave ? View.VISIBLE : View.GONE);
if (mReadOnlyFlg) {
// プレビューの場合
// リソースパターンの適用
rearTitle = PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_preview,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
// クローズボタン以外非表示
closeButton.setVisibility(View.VISIBLE);
homeButton.setVisibility(View.GONE);
tempSaveButton.setVisibility(View.GONE);
deleteButton.setVisibility(View.GONE);
saveButton.setVisibility(View.GONE);
} else {
// プレビューではない場合
// 削除ボタン表示可否判断 rearTitle = PatternStringUtil.patternToString(getApplicationContext(),
mIsOzFilePath = OzdFileHelper.checkOzFilePath(mOperationId, mTaskKey, mTaskReportId, mReportStartDate, mReportFileName, mTaskReportLevel); R.string.title_input,
deleteButton.setVisibility(mIsOzFilePath ? View.VISIBLE : View.GONE); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
// 一時ボタン表示可否判断
homeButton.setVisibility(mAddReport ? View.GONE : View.VISIBLE);
closeButton.setVisibility(mAddReport ? View.VISIBLE : View.GONE);
tempSaveButton.setVisibility(mLocalSave ? View.VISIBLE : View.GONE);
// 削除ボタン表示可否判断
mIsOzFilePath = OzdFileHelper.checkOzFilePath(mOperationId, mTaskKey, mTaskReportId, mReportStartDate, mReportFileName, mTaskReportLevel);
deleteButton.setVisibility(mIsOzFilePath ? View.VISIBLE : View.GONE);
}
// タイトルセット
tvTitle.setText(frontTitle + rearTitle);
// 作業一覧へ戻るボタン // 作業一覧へ戻るボタン
homeButton.setOnClickListener(new OnClickListener() { homeButton.setOnClickListener(new OnClickListener() {
......
...@@ -164,9 +164,10 @@ public class FoxitPdfCore { ...@@ -164,9 +164,10 @@ public class FoxitPdfCore {
* @param patchH * @param patchH
* @return * @return
*/ */
public Bitmap drawPage(Bitmap bm, int page, int pageW, int pageH, int patchX, int patchY, int patchW, int patchH) { public Bitmap drawPage(int page, int pageW, int pageH, int patchX, int patchY, int patchW, int patchH) {
Logger.i(TAG, "drawPage start."); Logger.i(TAG, "drawPage start.");
synchronized (mContext) { synchronized (mContext) {
Bitmap bm = Bitmap.createBitmap(patchW, patchH, Bitmap.Config.ARGB_8888);
PDFPage pdfPage = loadPage(mPDFDoc, page, PDFPage.e_ParsePageNormal); PDFPage pdfPage = loadPage(mPDFDoc, page, PDFPage.e_ParsePageNormal);
Renderer renderer = null; Renderer renderer = null;
Progressive progressive = null; Progressive progressive = null;
......
...@@ -246,9 +246,7 @@ public class PDFPageView extends PageView { ...@@ -246,9 +246,7 @@ public class PDFPageView extends PageView {
if (pdfImageProvider != null) { if (pdfImageProvider != null) {
pdfImageProvider.setPauseTask(true); pdfImageProvider.setPauseTask(true);
} }
Bitmap patchBm = Bitmap.createBitmap(patchArea.width(), patchArea.height(), Config.ARGB_8888); mPatchBm = mFoxitPdfCore.drawPage(mPageNumber, patchViewSize.x, patchViewSize.y, patchArea.left, patchArea.top, patchArea.width(), patchArea.height());
patchBm = mFoxitPdfCore.drawPage(patchBm, mPageNumber, patchViewSize.x, patchViewSize.y, patchArea.left, patchArea.top, patchArea.width(), patchArea.height());
mPatchBm = patchBm;
} catch (OutOfMemoryError e) { } catch (OutOfMemoryError e) {
Logger.e(TAG, "mDrawPatchTask.doInBackground() " + e.toString()); Logger.e(TAG, "mDrawPatchTask.doInBackground() " + e.toString());
} finally { } finally {
...@@ -273,7 +271,7 @@ public class PDFPageView extends PageView { ...@@ -273,7 +271,7 @@ public class PDFPageView extends PageView {
} }
}; };
Logger.v(TAG, "[createPatch]: page: " + mPageNumber); Logger.v(TAG, "[createPatch]: page: " + mPageNumber);
mDrawPatchTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void[])null); mDrawPatchTask.execute();
} }
public void releaseResources() { public void releaseResources() {
......
...@@ -308,9 +308,9 @@ public class PdfImageProvider { ...@@ -308,9 +308,9 @@ public class PdfImageProvider {
int height = (int) (size.y * pageScale); int height = (int) (size.y * pageScale);
Logger.i(TAG, "[drawPage]: pageNumber=" + pageNumber + " width=" + width + " height=" + height + " imagePath=" + imagePath); Logger.i(TAG, "[drawPage]: pageNumber=" + pageNumber + " width=" + width + " height=" + height + " imagePath=" + imagePath);
Bitmap bm = Bitmap.createBitmap(width, height, Config.ARGB_8888); Bitmap bm = null;
try { try {
bm = mFoxitPdfCore.drawPage(bm, pageNumber, width, height, 0, 0, width, height); bm = mFoxitPdfCore.drawPage(pageNumber, width, height, 0, 0, width, height);
} catch (OutOfMemoryError e) { } catch (OutOfMemoryError e) {
Logger.e(TAG, "mFoxitPdfCore.drawPage error." + e.toString()); Logger.e(TAG, "mFoxitPdfCore.drawPage error." + e.toString());
if (bm != null) { if (bm != null) {
...@@ -318,7 +318,7 @@ public class PdfImageProvider { ...@@ -318,7 +318,7 @@ public class PdfImageProvider {
} }
System.gc(); System.gc();
try { try {
bm = mFoxitPdfCore.drawPage(bm, pageNumber, width, height, 0, 0, width, height); bm = mFoxitPdfCore.drawPage(pageNumber, width, height, 0, 0, width, height);
} catch (OutOfMemoryError e2) { } catch (OutOfMemoryError e2) {
Logger.e(TAG, "mFoxitPdfCore.drawPage error." + e2.toString()); Logger.e(TAG, "mFoxitPdfCore.drawPage error." + e2.toString());
if (bm != null) { if (bm != null) {
......
...@@ -208,7 +208,7 @@ public class PdfThumbnailProvider { ...@@ -208,7 +208,7 @@ public class PdfThumbnailProvider {
pdfImageProvider.setPauseTask(true); pdfImageProvider.setPauseTask(true);
} }
bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888); bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
bitmap = mFoxitPdfCore.drawPage(bitmap, page, width, height, 0, 0, width, height); bitmap = mFoxitPdfCore.drawPage(page, width, height, 0, 0, width, height);
} finally { } finally {
if (pdfImageProvider != null) { if (pdfImageProvider != null) {
pdfImageProvider.setPauseTask(false); pdfImageProvider.setPauseTask(false);
......
...@@ -335,7 +335,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -335,7 +335,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
bitmap = readFromFile(page, false); bitmap = readFromFile(page, false);
if (bitmap == null) { if (bitmap == null) {
bitmap = Bitmap.createBitmap(largeWidth, largeHeight, Config.ARGB_8888); bitmap = Bitmap.createBitmap(largeWidth, largeHeight, Config.ARGB_8888);
bitmap = mFoxitPdfCore.drawPage(bitmap, page, largeWidth, largeHeight, 0, 0, largeWidth, largeHeight); // PDF描画 bitmap = mFoxitPdfCore.drawPage(page, largeWidth, largeHeight, 0, 0, largeWidth, largeHeight); // PDF描画
} }
} finally { } finally {
if (pdfImageProvider != null) { if (pdfImageProvider != null) {
...@@ -473,8 +473,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -473,8 +473,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
} }
pageBitmap = readFromFile(page, true); pageBitmap = readFromFile(page, true);
if (pageBitmap == null) { if (pageBitmap == null) {
pageBitmap = Bitmap.createBitmap(midWidth, midHeight, Config.ARGB_8888); pageBitmap = mFoxitPdfCore.drawPage(page, midWidth, midHeight, 0, 0, midWidth, midHeight); // PDF描画
pageBitmap = mFoxitPdfCore.drawPage(pageBitmap, page, midWidth, midHeight, 0, 0, midWidth, midHeight); // PDF描画
} }
} finally { } finally {
if (pdfImageProvider != null) { if (pdfImageProvider != null) {
......
...@@ -184,7 +184,6 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -184,7 +184,6 @@ public class ZoomRelativeLayout extends RelativeLayout {
canvas.concat(imgMatrix); canvas.concat(imgMatrix);
} }
super.dispatchDraw(canvas); super.dispatchDraw(canvas);
invalidate();
canvas.restore(); canvas.restore();
} }
......
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