Commit 759a293a by Lee Jaebin

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

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