Commit 759a293a by Lee Jaebin

#32576 作業指示ボタンの改善(ピン表示)

#32574 拡大状態でも作業指示・報告画面表示
parent fd158993
......@@ -193,6 +193,7 @@ public class ProjectTaskLayout extends RelativeLayout {
} else {
final PointF pointView = rootLayout.convertToViewPoint(dto.pdfX, dto.pdfY);
if (isShowPin) {
// ピンで表示
final ActionProjectTaskPin taskPin = new ActionProjectTaskPin(context, dto);
taskPin.taskKey = dto.taskKey;
if (dto.isFinished) {
......@@ -206,12 +207,13 @@ public class ProjectTaskLayout extends RelativeLayout {
params = new RelativeLayout.LayoutParams(width, height);
taskPin.setVisibility(View.INVISIBLE);
rootLayout.addView(taskPin, params);
// 座標x,yのセット
taskPin.setTranslationX(pointView.x - (width / 2));
taskPin.setTranslationY(pointView.y - height);
taskPin.setVisibility(View.VISIBLE);
taskView = taskPin;
} else {
// 作業コードで表示
final ActionProjectTaskCode taskCode = new ActionProjectTaskCode(context, dto);
//taskCode.startBlinkAnimation();
taskCode.taskKey = dto.taskKey;
......@@ -231,6 +233,7 @@ public class ProjectTaskLayout extends RelativeLayout {
public void run() {
Logger.d(TAG, String.format("[ActionProjectTaskCode] : taskCode=%s, CODE_WIDTH=%d, fX=%d, fY=%d", dto.taskCode, CODE_WIDTH, (int) pointView.x, (int) pointView.y));
int realWidth = taskCode.getWidth(); //height is ready, sometimes realWidth = 0
// 座標x,yのセット
taskCode.setTranslationX(pointView.x - ((realWidth > 0 ? realWidth : postWidth) / 2));
taskCode.setTranslationY(pointView.y - (postHeight / 2));
taskCode.setVisibility(View.VISIBLE);
......@@ -497,9 +500,9 @@ public class ProjectTaskLayout extends RelativeLayout {
if (icon.taskKey.equals(TEMP_TASK_KEY) || icon.taskKey.equals(taskKey)) {
icon.stopAnimation();
if (isTaskFinished(taskKey)) {
icon.setBackgroundColor(ProjectTaskLayout.COLOR_BLUE);
icon.setImageResource(R.drawable.s_pin2);
} else {
icon.setBackgroundColor(ProjectTaskLayout.COLOR_ORANGE);
icon.setImageResource(R.drawable.s_pin1);
}
if (isDelete || icon.taskKey.equals(TEMP_TASK_KEY)) {
currentLayout.removeView(v);
......
......@@ -274,6 +274,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
mLastTouchX = x;
mLastTouchY = y;
// 作業の座標をすべて調整する
changeTaskChildView();
break;
}
......@@ -332,14 +333,17 @@ public class ZoomRelativeLayout extends RelativeLayout {
return mPageView;
}
/**
* 作業の座標をすべて調整する
*/
private void changeTaskChildView() {
if (getChildCount() > 0) {
for (int i = 0; i < getChildCount(); i++) {
View view = getChildAt(i);
if (view instanceof ActionProjectTaskCode) {
setTaskTranslation((ActionProjectTaskCode) view);
setTaskTranslationCode((ActionProjectTaskCode) view);
} else if (view instanceof ActionProjectTaskPin) {
setTaskTranslation((ActionProjectTaskPin) view);
setTaskTranslationPin((ActionProjectTaskPin) view);
}
}
}
......@@ -349,7 +353,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
* ActionProjectTaskCodeのx,y座標をセット
* @param view
*/
private void setTaskTranslation(ActionProjectTaskCode view) {
private void setTaskTranslationCode(ActionProjectTaskCode view) {
ProjectTaskDto dto = view.mProjectTaskDto;
PointF point = convertToAuthoringPoint(dto.pdfX, dto.pdfY);
view.setTranslationX(point.x - (view.getWidth() / 2));
......@@ -360,7 +364,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
* ActionProjectTaskPinのx,y座標をセット
* @param view
*/
private void setTaskTranslation(ActionProjectTaskPin view) {
private void setTaskTranslationPin(ActionProjectTaskPin view) {
ProjectTaskDto dto = view.mProjectTaskDto;
PointF point = convertToAuthoringPoint(dto.pdfX, dto.pdfY);
view.setTranslationX(point.x - (view.getWidth() / 2));
......@@ -491,7 +495,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
imgMatrix.postScale(detector.getScaleFactor(), detector.getScaleFactor(), detector.getFocusX(), detector.getFocusY());
mScaleFactor = matrixScale;
invalidate();
}
}// 作業の座標をすべて調整する
changeTaskChildView();
Logger.v(TAG, "SimpleOnScaleGestureListener:[onScale]:scaleFactor=%s", mScaleFactor);
......@@ -555,6 +559,8 @@ public class ZoomRelativeLayout extends RelativeLayout {
mPageScrollView.setZoomingFlag(false);
imgMatrix.set(initMatrix);
invalidate();
// 作業の座標をすべて調整する
changeTaskChildView();
} else {
mScaleFactor = matrixScale;
......@@ -617,6 +623,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
matrixValue[Matrix.MTRANS_Y] = matrixY;
imgMatrix.setValues(matrixValue);
invalidate();
// 作業の座標をすべて調整する
changeTaskChildView();
Logger.v(TAG, "[fixPosition]invalidate");
}
......@@ -679,7 +686,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
float pdfX = (x * scaleX) - (matrixX * scaleX);
float pdfY = (y * scaleY) - (matrixY * scaleY);
return new PointF((int)pdfX, (int)pdfY);
return new PointF(pdfX, pdfY);
}
/**
......@@ -697,7 +704,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
float pdfX = (x * scale) + matrixX;
float pdfY = (y * scale) + matrixY;
return new PointF((int)pdfX, (int)pdfY);
return new PointF(pdfX, pdfY);
}
public PointF convertToViewPoint(float x, float y) {
......
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