Commit a698ea7e by Lee Jaebin

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

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