Commit a698ea7e by Lee Jaebin

図面タイプでフォームのサイズ修正(タブレット)

parent 82a59ce3
...@@ -105,7 +105,7 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -105,7 +105,7 @@ public class OperationTaskLayout extends RelativeLayout {
} else { } else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH); int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT); params = createParam(halfWidth, ViewGroup.LayoutParams.MATCH_PARENT);
} }
params.addRule(RelativeLayout.ALIGN_PARENT_TOP); params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
...@@ -290,12 +290,12 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -290,12 +290,12 @@ public class OperationTaskLayout extends RelativeLayout {
RelativeLayout.LayoutParams params; RelativeLayout.LayoutParams params;
if (isNormalSize) { if (isNormalSize) {
params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
} else { } else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH); int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
int screenWidth = displayMetrics.widthPixels; int screenWidth = displayMetrics.widthPixels;
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT); params = createParam(halfWidth, ViewGroup.LayoutParams.MATCH_PARENT);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
} }
...@@ -347,12 +347,12 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -347,12 +347,12 @@ public class OperationTaskLayout extends RelativeLayout {
public void setTaskFormPosition(float screenX, boolean isNormalSize) { public void setTaskFormPosition(float screenX, boolean isNormalSize) {
RelativeLayout.LayoutParams params; RelativeLayout.LayoutParams params;
if (isNormalSize) { if (isNormalSize) {
params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
} else { } else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH); int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
int screenWidth = displayMetrics.widthPixels; int screenWidth = displayMetrics.widthPixels;
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT); params = createParam(halfWidth, ViewGroup.LayoutParams.MATCH_PARENT);
if (screenX < screenWidth / 2) { if (screenX < screenWidth / 2) {
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
...@@ -367,14 +367,14 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -367,14 +367,14 @@ public class OperationTaskLayout extends RelativeLayout {
public void setTaskFormPosition(String taskKey, boolean isNormalSize) { public void setTaskFormPosition(String taskKey, boolean isNormalSize) {
RelativeLayout.LayoutParams params; RelativeLayout.LayoutParams params;
if (isNormalSize) { if (isNormalSize) {
params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
setLayoutParams(params); setLayoutParams(params);
} else { } else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH); int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT); params = createParam(halfWidth, ViewGroup.LayoutParams.MATCH_PARENT);
if (!StringUtil.isNullOrEmpty(taskKey)) { if (!StringUtil.isNullOrEmpty(taskKey)) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
......
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