Commit 5ef3cb6e by Lee Jaebin

PDF全画面対応を半分に戻す

parent 907fb6b4
......@@ -5175,6 +5175,19 @@ public class ContentViewActivity extends ABVContentViewActivity {
List<OperationTaskDto> tasks = mTaskHotspotJSON.getPageTasks(pageNumber);
operationTaskLayout.addAllOperationTaskIcon(rootLayout, tasks);
//画面回転の時
if (configChangedFlg && !isNormalSize()) {
operationTaskLayout.currentLayout = rootLayout;
RelativeLayout.LayoutParams params;
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
int screenWidth = displayMetrics.widthPixels;
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
params.addRule(operationTaskLayout.getAlignOfTaskLayer());
operationTaskLayout.setTaskCodeBlinkAnimation();
operationTaskLayout.setLayoutParams(params);
setOperationTaskViewStatus(isOpenedOperationTask);
}
}
public void setCurrentOperationTask(OperationTaskDto operationTaskDto) {
......
......@@ -100,8 +100,8 @@ public class OperationTaskLayout extends RelativeLayout {
mWebView.loadUrl(linkUrl);
RelativeLayout.LayoutParams params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
// params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
// params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
addView(mWebView, params);
mWebView.setWebChromeClient(new WebChromeClient() {
......@@ -282,15 +282,15 @@ public class OperationTaskLayout extends RelativeLayout {
final String script = String.format(SCRIPT_SHOW_TASK_LIST, pageNum + 1);
RelativeLayout.LayoutParams params;
// if (isNormalSize) {
if (isNormalSize) {
params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
// } else {
// DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
// int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
// int screenWidth = displayMetrics.widthPixels;
// params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
// params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
// }
} else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
int screenWidth = displayMetrics.widthPixels;
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
}
setLayoutParams(params);
......@@ -339,60 +339,60 @@ public class OperationTaskLayout extends RelativeLayout {
public void setTaskFormPosition(float screenX, boolean isNormalSize) {
RelativeLayout.LayoutParams params;
// if (isNormalSize) {
if (isNormalSize) {
params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
// } else {
// DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
// int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
// int screenWidth = displayMetrics.widthPixels;
// params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
//
// if (screenX < screenWidth / 2) {
// params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
// } else {
// params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
// }
// }
} else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
int screenWidth = displayMetrics.widthPixels;
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
if (screenX < screenWidth / 2) {
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
} else {
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
}
}
setLayoutParams(params);
}
public void setTaskFormPosition(String taskKey, boolean isNormalSize) {
RelativeLayout.LayoutParams params;
// if (isNormalSize) {
if (isNormalSize) {
params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
setLayoutParams(params);
// } else {
// DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
//
// // #32926 作業報告画面改善 start
// // 作業報告画面を全画面に表示する
// int screenWidth = displayMetrics.widthPixels;
// params = createParam(screenWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
// // #32926 作業報告画面改善 end
//
// if (!StringUtil.isNullOrEmpty(taskKey)) {
// TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
// if (taskDto != null) {
// OperationTaskDto operationTaskDto = new OperationTaskDto();
// operationTaskDto.taskKey = taskDto.taskKey;
// operationTaskDto.taskCode = taskDto.taskCode;
//
// JSONObject hotSpot = new JSONObject(taskDto.taskHotSpotInfo);
// operationTaskDto.pdfX = hotSpot.getInt(ABookKeys.PDF_X);
// operationTaskDto.pdfY = hotSpot.getInt(ABookKeys.PDF_Y);
//
// currentTaskDto = operationTaskDto;
//
// if (currentLayout.isLeftSideOfPdf((int)operationTaskDto.pdfX)) {
// params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
// } else {
// params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
// }
// setLayoutParams(params);
// }
// }
// }
} else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
// #32926 作業報告画面改善 start
// 作業報告画面を全画面に表示する
int screenWidth = displayMetrics.widthPixels;
params = createParam(screenWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
// #32926 作業報告画面改善 end
if (!StringUtil.isNullOrEmpty(taskKey)) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto != null) {
OperationTaskDto operationTaskDto = new OperationTaskDto();
operationTaskDto.taskKey = taskDto.taskKey;
operationTaskDto.taskCode = taskDto.taskCode;
JSONObject hotSpot = new JSONObject(taskDto.taskHotSpotInfo);
operationTaskDto.pdfX = hotSpot.getInt(ABookKeys.PDF_X);
operationTaskDto.pdfY = hotSpot.getInt(ABookKeys.PDF_Y);
currentTaskDto = operationTaskDto;
if (currentLayout.isLeftSideOfPdf((int)operationTaskDto.pdfX)) {
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
} else {
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
}
setLayoutParams(params);
}
}
}
}
public int getAlignOfTaskLayer() {
......
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