Commit adcea12a by Lee Jaebin

一時保存処理修正

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