Commit 0a489272 by Kim Jinsung

Merge branch 'feature/1.0.1_leej' into 'feature/1.0.1'

Feature/1.0.1 leej

See merge request !1
parents a2036236 b112ebc7
...@@ -316,7 +316,7 @@ public class ProjectLogic extends AbstractLogic { ...@@ -316,7 +316,7 @@ public class ProjectLogic extends AbstractLogic {
if (!newValue.equals(taskDirectionsItemsDto.inputValue)) { if (!newValue.equals(taskDirectionsItemsDto.inputValue)) {
// 値が異なる場合のみ、更新する // 値が異なる場合のみ、更新する
taskDirectionsItemsDto.inputValue = newValue; taskDirectionsItemsDto.inputValue = newValue;
if (taskDirectionsItemsDto.inputValue.startsWith("q_1_")) { if (taskDirectionsItemsDto.itemKey.startsWith("q_1_")) {
// 値が異なるため、作業コードの入力値を変更する // 値が異なるため、作業コードの入力値を変更する
taskDto.taskCode = taskDirectionsItemsDto.inputValue; taskDto.taskCode = taskDirectionsItemsDto.inputValue;
} }
......
...@@ -7,6 +7,16 @@ ...@@ -7,6 +7,16 @@
android:background="@color/transparent"> android:background="@color/transparent">
<ImageButton <ImageButton
android:id="@+id/btn_pin_toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2px"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_hidden_show_directions_button"
android:visibility="visible"/>
<ImageButton
android:id="@+id/btn_hide_task_direct" android:id="@+id/btn_hide_task_direct"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -155,14 +155,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -155,14 +155,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (!isLinkedContent) { if (!isLinkedContent) {
projectDto = AbstractLogic.getLogic(ProjectLogic.class).getProject(mProjectId); projectDto = AbstractLogic.getLogic(ProjectLogic.class).getProject(mProjectId);
mXWalkOpenType = intent.getIntExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, -1); mXWalkOpenType = intent.getIntExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.DEFAULT);
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
if (isNormalSize()) { mProjectType = projectDto.projectType;
if (mProjectType != ProjectType.PDF && isNormalSize()) {
// 縦画面固定 // 縦画面固定
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} }
mProjectType = projectDto.projectType;
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
...@@ -693,7 +693,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -693,7 +693,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
if (isNormalSize()) { if (mProjectType != ProjectType.PDF && isNormalSize()) {
// 縦画面固定 // 縦画面固定
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} }
...@@ -775,11 +775,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -775,11 +775,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
*/ */
protected void onActionProjectPdfWebView(Map<String, String> checkParam, ProjectTaskDto projectTaskDto) {} protected void onActionProjectPdfWebView(Map<String, String> checkParam, ProjectTaskDto projectTaskDto) {}
/**
* Be override
*/
public Point convertToAuthoringPoint(float x, float y) { return new Point((int)x, (int)y); }
public void onClickShowHelpView(View v) { public void onClickShowHelpView(View v) {
int helpViewType = 0; int helpViewType = 0;
switch (mStatusCode) { switch (mStatusCode) {
......
...@@ -19,7 +19,6 @@ import android.graphics.Color; ...@@ -19,7 +19,6 @@ import android.graphics.Color;
import android.graphics.Matrix; import android.graphics.Matrix;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.Path; import android.graphics.Path;
import android.graphics.Point;
import android.graphics.RectF; import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
...@@ -72,10 +71,8 @@ import org.json.adf.JSONArray; ...@@ -72,10 +71,8 @@ import org.json.adf.JSONArray;
import org.json.adf.JSONException; import org.json.adf.JSONException;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -116,11 +113,9 @@ import jp.agentec.abook.abv.bl.logic.EnqueteLogic; ...@@ -116,11 +113,9 @@ import jp.agentec.abook.abv.bl.logic.EnqueteLogic;
import jp.agentec.abook.abv.bl.websocket.MeetingManager; import jp.agentec.abook.abv.bl.websocket.MeetingManager;
import jp.agentec.abook.abv.cl.environment.DeviceInfo; import jp.agentec.abook.abv.cl.environment.DeviceInfo;
import jp.agentec.abook.abv.cl.helper.ContentMarkingFileHelper; import jp.agentec.abook.abv.cl.helper.ContentMarkingFileHelper;
import jp.agentec.abook.abv.cl.util.AndroidStringUtil;
import jp.agentec.abook.abv.cl.util.BitmapUtil; import jp.agentec.abook.abv.cl.util.BitmapUtil;
import jp.agentec.abook.abv.cl.util.ContentLogUtil; import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.PDFFileProvider;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.launcher.android.R.id; import jp.agentec.abook.abv.launcher.android.R.id;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity; import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
...@@ -140,8 +135,6 @@ import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow; ...@@ -140,8 +135,6 @@ import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.common.vo.Size; import jp.agentec.abook.abv.ui.common.vo.Size;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper; import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper.LinkContentStatus;
import jp.agentec.abook.abv.ui.Interface.MovePageInterface; import jp.agentec.abook.abv.ui.Interface.MovePageInterface;
import jp.agentec.abook.abv.ui.Interface.UnAuthorizedContentListener; import jp.agentec.abook.abv.ui.Interface.UnAuthorizedContentListener;
import jp.agentec.abook.abv.ui.viewer.adapter.ContentBookmarkAdapter; import jp.agentec.abook.abv.ui.viewer.adapter.ContentBookmarkAdapter;
...@@ -156,6 +149,8 @@ import jp.agentec.abook.abv.ui.viewer.view.ABVMediaPlayer; ...@@ -156,6 +149,8 @@ import jp.agentec.abook.abv.ui.viewer.view.ABVMediaPlayer;
import jp.agentec.abook.abv.ui.viewer.view.Action3DImageView; import jp.agentec.abook.abv.ui.viewer.view.Action3DImageView;
import jp.agentec.abook.abv.ui.viewer.view.ActionButton; import jp.agentec.abook.abv.ui.viewer.view.ActionButton;
import jp.agentec.abook.abv.ui.viewer.view.ActionImageView; import jp.agentec.abook.abv.ui.viewer.view.ActionImageView;
import jp.agentec.abook.abv.ui.viewer.view.ActionProjectTaskCode;
import jp.agentec.abook.abv.ui.viewer.view.ActionProjectTaskPin;
import jp.agentec.abook.abv.ui.viewer.view.EnqueteLayout; import jp.agentec.abook.abv.ui.viewer.view.EnqueteLayout;
import jp.agentec.abook.abv.ui.viewer.view.EnqueteWebView; import jp.agentec.abook.abv.ui.viewer.view.EnqueteWebView;
import jp.agentec.abook.abv.ui.viewer.view.FullVideoView; import jp.agentec.abook.abv.ui.viewer.view.FullVideoView;
...@@ -174,8 +169,6 @@ import jp.agentec.abook.abv.ui.viewer.view.action.TapMediaPlayer; ...@@ -174,8 +169,6 @@ import jp.agentec.abook.abv.ui.viewer.view.action.TapMediaPlayer;
import jp.agentec.abook.abv.ui.viewer.view.action.VideoMountAction; import jp.agentec.abook.abv.ui.viewer.view.action.VideoMountAction;
import jp.agentec.adf.net.http.HttpDownloadSimpleNotification; import jp.agentec.adf.net.http.HttpDownloadSimpleNotification;
import jp.agentec.adf.net.http.HttpDownloadState; import jp.agentec.adf.net.http.HttpDownloadState;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.DateTimeUtil.DateUnit;
import jp.agentec.adf.util.FileUtil; import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
...@@ -271,6 +264,8 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -271,6 +264,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
private LinearLayout mScaleZoomLayout; private LinearLayout mScaleZoomLayout;
private boolean isOpenedProjectTask = false; private boolean isOpenedProjectTask = false;
private TaskHotspotJSON mTaskHotspotJSON; private TaskHotspotJSON mTaskHotspotJSON;
// ピンと作業コードの切替ボタン
protected ImageButton btnPinToggleIcon;
protected ImageButton btnHideTaskDirectBtn; protected ImageButton btnHideTaskDirectBtn;
protected ImageButton btnScaleZoomPlus; protected ImageButton btnScaleZoomPlus;
protected ImageButton btnScaleZoom03; protected ImageButton btnScaleZoom03;
...@@ -328,6 +323,8 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -328,6 +323,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
private ProgressBar m_progress; private ProgressBar m_progress;
public ValueCallback<Uri[]> mUploadMessage; public ValueCallback<Uri[]> mUploadMessage;
public boolean mShowPinFlg = true;
/** /**
* スクロールステータス * スクロールステータス
...@@ -1824,14 +1821,16 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -1824,14 +1821,16 @@ public class ContentViewActivity extends ABVContentViewActivity {
Logger.d(TAG, "[singleTapMotion]:isOnClick=false"); Logger.d(TAG, "[singleTapMotion]:isOnClick=false");
if (mPageScrollView.isZooming()) { if (mPageScrollView.isZooming()) {
ZoomRelativeLayout zoomRelativeLayout = mShowPageLayout.get(mCurrentPageNumber); if (!isProjectPdf) {
if (zoomRelativeLayout == null) { ZoomRelativeLayout zoomRelativeLayout = mShowPageLayout.get(mCurrentPageNumber);
Logger.e(TAG, "zoomRelativeLayout is null"); if (zoomRelativeLayout == null) {
return; Logger.e(TAG, "zoomRelativeLayout is null");
return;
}
// 拡大中は拡大率を表示
int scale = (int) (mShowPageLayout.get(mCurrentPageNumber).getScaleFactor() * 100f);
Toast.makeText(getApplicationContext(), String.format("%d%%", scale), Toast.LENGTH_SHORT).show();
} }
// 拡大中は拡大率を表示
int scale = (int) (mShowPageLayout.get(mCurrentPageNumber).getScaleFactor() * 100f);
Toast.makeText(getApplicationContext(), String.format("%d%%", scale), Toast.LENGTH_SHORT).show();
} else { } else {
TranslateAnimation toolBarAnimation; TranslateAnimation toolBarAnimation;
if (mToolBar.getVisibility() == View.GONE) { if (mToolBar.getVisibility() == View.GONE) {
...@@ -5004,11 +5003,6 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5004,11 +5003,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
projectTaskLayout.currentLayout = mShowPageLayout.get(currentPageNum); projectTaskLayout.currentLayout = mShowPageLayout.get(currentPageNum);
} }
@Override
public Point convertToAuthoringPoint(float x, float y) {
return projectTaskLayout.convertToAuthoringPoint(x, y);
}
// 作業のホットスポットJSONを取得 // 作業のホットスポットJSONを取得
private void getTaskHotspotJSON() { private void getTaskHotspotJSON() {
try { try {
...@@ -5041,7 +5035,17 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5041,7 +5035,17 @@ public class ContentViewActivity extends ABVContentViewActivity {
mScaleZoomLayout.setVisibility(View.VISIBLE); mScaleZoomLayout.setVisibility(View.VISIBLE);
mMainLayout.addView(mScaleZoomLayout, params); mMainLayout.addView(mScaleZoomLayout, params);
// ピンと作業コードの切替ボタン
btnPinToggleIcon = (ImageButton) mScaleZoomLayout.findViewById(id.btn_pin_toggle);
btnPinToggleIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mShowPinFlg = !mShowPinFlg;
changeTaskMainIcon(mShowPinFlg);
}
});
btnPinToggleIcon.setVisibility(View.VISIBLE);
btnHideTaskDirectBtn = (ImageButton) mScaleZoomLayout.findViewById(R.id.btn_hide_task_direct); btnHideTaskDirectBtn = (ImageButton) mScaleZoomLayout.findViewById(R.id.btn_hide_task_direct);
btnHideTaskDirectBtn.setOnTouchListener(new View.OnTouchListener() { btnHideTaskDirectBtn.setOnTouchListener(new View.OnTouchListener() {
@Override @Override
...@@ -5094,12 +5098,11 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5094,12 +5098,11 @@ public class ContentViewActivity extends ABVContentViewActivity {
mMainLayout.addView(projectTaskLayout); mMainLayout.addView(projectTaskLayout);
List<ProjectTaskDto> tasks = mTaskHotspotJSON.getPageTasks(pageNumber); List<ProjectTaskDto> tasks = mTaskHotspotJSON.getPageTasks(pageNumber);
projectTaskLayout.addAllProjectTaskIcon(this, rootLayout, tasks); projectTaskLayout.addAllProjectTaskIcon(rootLayout, tasks);
//画面回転の時 //画面回転の時
if (configChangedFlg && !isNormalSize()) { if (configChangedFlg && !isNormalSize()) {
projectTaskLayout.currentLayout = rootLayout; projectTaskLayout.currentLayout = rootLayout;
//setProjectCurrentLayout(mCurrentPageNumber);
RelativeLayout.LayoutParams params; RelativeLayout.LayoutParams params;
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * ProjectTaskLayout.HALF_WIDTH); int halfWidth = (int) (displayMetrics.density * ProjectTaskLayout.HALF_WIDTH);
...@@ -5118,7 +5121,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5118,7 +5121,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
public void showProjectTaskLayout(ZoomRelativeLayout layout, ProjectTaskDto projectTaskDto, float clickX) { public void showProjectTaskLayout(ZoomRelativeLayout layout, ProjectTaskDto projectTaskDto, float clickX) {
//setCurrentProjectTask(layout, currentTaskDto); //setCurrentProjectTask(layout, currentTaskDto);
projectTaskLayout.showTaskForm(this, layout, mXWalkOpenType, projectTaskDto, isNormalSize(), clickX); projectTaskLayout.showTaskForm(layout, mXWalkOpenType, projectTaskDto, isNormalSize(), clickX);
isOpenedProjectTask = true; isOpenedProjectTask = true;
} }
...@@ -5126,6 +5129,9 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5126,6 +5129,9 @@ public class ContentViewActivity extends ABVContentViewActivity {
public void cmdProjectTaskLayout(String cmd, Map<String, String> checkParam) { public void cmdProjectTaskLayout(String cmd, Map<String, String> checkParam) {
String taskKey = checkParam.get(ABookKeys.TASK_KEY); String taskKey = checkParam.get(ABookKeys.TASK_KEY);
String taskCode = ""; String taskCode = "";
// フォームが閉いているフラグをfalseに設定
isOpenedProjectTask = false;
if (projectTaskLayout.currentLayout != null && !StringUtil.isNullOrEmpty(taskKey)) { if (projectTaskLayout.currentLayout != null && !StringUtil.isNullOrEmpty(taskKey)) {
switch(cmd){ switch(cmd){
case ABookKeys.CMD_INSERT_TASK_DIRECTIONS: case ABookKeys.CMD_INSERT_TASK_DIRECTIONS:
...@@ -5136,7 +5142,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5136,7 +5142,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
projectTaskLayout.setIconStatus(taskKey, true); projectTaskLayout.setIconStatus(taskKey, true);
projectTaskLayout.currentTaskDto.taskKey = taskKey; projectTaskLayout.currentTaskDto.taskKey = taskKey;
projectTaskLayout.currentTaskDto.taskCode = taskCode; projectTaskLayout.currentTaskDto.taskCode = taskCode;
projectTaskLayout.addProjectTaskIcon(this, projectTaskLayout.currentLayout, projectTaskLayout.currentTaskDto); projectTaskLayout.addProjectTaskIcon(projectTaskLayout.currentLayout, projectTaskLayout.currentTaskDto);
//hideProjectTaskLayout(); //hideProjectTaskLayout();
break; break;
case ABookKeys.CMD_DELETE_TASK_DIRECTIONS: case ABookKeys.CMD_DELETE_TASK_DIRECTIONS:
...@@ -5193,6 +5199,33 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5193,6 +5199,33 @@ public class ContentViewActivity extends ABVContentViewActivity {
isOpenedProjectTask = isHide; isOpenedProjectTask = isHide;
} }
/**
* 作業のアイコンをピン・作業コードに切替
* @param isShowPin
*/
public void changeTaskMainIcon(boolean isShowPin) {
// mShowPageLayoutに存在するzoomLayoutの子ビューであるActionProjectTaskPin、ActionProjectTaskCodeを全て削除して、新たにアイコンを再描画する
for (int i = 0; i < mShowPageLayout.size(); i++) {
int key = mShowPageLayout.keyAt(i);
ZoomRelativeLayout zoomRelativeLayout = mShowPageLayout.get(key);
for (int j = zoomRelativeLayout.getChildCount() - 1; j >= 0; j--) {
View view = zoomRelativeLayout.getChildAt(j);
if (view instanceof ActionProjectTaskCode) {
((ActionProjectTaskCode) view).stopAnimation();
} else if (view instanceof ActionProjectTaskPin) {
((ActionProjectTaskPin) view).stopAnimation();
}
if (view instanceof ActionProjectTaskCode || view instanceof ActionProjectTaskPin) {
// ピン、作業コードのビューを削除
zoomRelativeLayout.removeView(view);
}
}
List<ProjectTaskDto> tasks = mTaskHotspotJSON.getPageTasks(i);
projectTaskLayout.addAllProjectTaskIcon(zoomRelativeLayout, tasks);
}
}
@Override @Override
public void showTaskList() { public void showTaskList() {
projectTaskLayout.showTaskList(mCurrentPageNumber, isNormalSize()); projectTaskLayout.showTaskList(mCurrentPageNumber, isNormalSize());
...@@ -5245,12 +5278,13 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5245,12 +5278,13 @@ public class ContentViewActivity extends ABVContentViewActivity {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int centerX = displayMetrics.widthPixels / 2; int centerX = displayMetrics.widthPixels / 2;
int centerY = displayMetrics.widthPixels / 2; int centerY = displayMetrics.heightPixels / 2;
ViewMargin margin = zoomLayout.getContentPageMargin(); ViewMargin margin = zoomLayout.getContentPageMargin();
Matrix matrix = new Matrix(); Matrix matrix = new Matrix();
matrix.postScale(scaleFactor, scaleFactor, centerX, centerY); matrix.postScale(scaleFactor, scaleFactor, centerX, centerY);
zoomLayout.setZoomMatrix(matrix); zoomLayout.setZoomMatrix(matrix);
zoomLayout.changeTaskChildView();
setToolbarVisable(false); setToolbarVisable(false);
mShowPageLayout.get(mCurrentPageNumber).setScaleFactorAndMatrix(scaleFactor); mShowPageLayout.get(mCurrentPageNumber).setScaleFactorAndMatrix(scaleFactor);
......
...@@ -10,7 +10,10 @@ import android.view.animation.Animation; ...@@ -10,7 +10,10 @@ import android.view.animation.Animation;
import android.view.animation.LinearInterpolator; import android.view.animation.LinearInterpolator;
import android.widget.TextView; import android.widget.TextView;
import jp.agentec.abook.abv.bl.dto.ProjectTaskDto;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
/** /**
* Created by seo-y on 2018/11/15. * Created by seo-y on 2018/11/15.
...@@ -20,20 +23,22 @@ public class ActionProjectTaskCode extends TextView { ...@@ -20,20 +23,22 @@ public class ActionProjectTaskCode extends TextView {
public String taskKey; public String taskKey;
private boolean isAnimated = false; private boolean isAnimated = false;
private Animation animation; private Animation animation;
private Context mContext;
public ProjectTaskDto mProjectTaskDto;
public ActionProjectTaskCode(final Context context, final String text, boolean isFinished) { public ActionProjectTaskCode(Context context, ProjectTaskDto dto) {
super(context); super(context);
mContext = context;
mProjectTaskDto = dto;
setSingleLine(true); setSingleLine(true);
setEllipsize(TextUtils.TruncateAt.END); setEllipsize(TextUtils.TruncateAt.END);
setText(text); setText(dto.taskCode);
setTextColor(Color.WHITE); setTextColor(Color.WHITE);
setTypeface(null, Typeface.BOLD); setTypeface(null, Typeface.BOLD);
setTextSize(TypedValue.COMPLEX_UNIT_SP, 14); setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
setBackgroundResource(R.drawable.shape_hotspot);
setPadding(15,5,15,5); setPadding(15,5,15,5);
setBackgroundResource(R.drawable.shape_hotspot);
if (isFinished) { if (dto.isFinished) {
setBackgroundColor(ProjectTaskLayout.COLOR_BLUE); setBackgroundColor(ProjectTaskLayout.COLOR_BLUE);
} else { } else {
setBackgroundColor(ProjectTaskLayout.COLOR_ORANGE); setBackgroundColor(ProjectTaskLayout.COLOR_ORANGE);
......
package jp.agentec.abook.abv.ui.viewer.view;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import jp.agentec.abook.abv.bl.dto.ProjectTaskDto;
import jp.agentec.abook.abv.launcher.android.R;
/**
* Created by leej on 2019/02/25.
*/
public class ActionProjectTaskPin extends ImageView {
public String taskKey;
private boolean isAnimated = false;
private Context mContext;
private Animation animation;
public ProjectTaskDto mProjectTaskDto;
public ActionProjectTaskPin(final Context context, final ProjectTaskDto dto) {
super(context);
mContext = context;
mProjectTaskDto = dto;
if (mProjectTaskDto.isFinished) {
setImageResource(R.drawable.s_pin2);
} else {
setImageResource(R.drawable.s_pin1);
}
setBackgroundColor(Color.TRANSPARENT);
}
public void stopAnimation() {
if (this.isAnimated) {
this.clearAnimation();
this.isAnimated = false;
}
}
public void startBlinkAnimation() {
if (animation == null) {
animation = new AlphaAnimation(1, 0);
animation.setDuration(1000);
animation.setInterpolator(new LinearInterpolator());
animation.setRepeatCount(Animation.INFINITE);
animation.setRepeatMode(Animation.REVERSE);
}
this.startAnimation(animation);
this.isAnimated = true;
}
}
...@@ -3,7 +3,7 @@ package jp.agentec.abook.abv.ui.viewer.view; ...@@ -3,7 +3,7 @@ package jp.agentec.abook.abv.ui.viewer.view;
import android.content.ClipData; import android.content.ClipData;
import android.content.Context; import android.content.Context;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Point; import android.graphics.PointF;
import android.net.Uri; import android.net.Uri;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.MotionEvent; import android.view.MotionEvent;
...@@ -28,6 +28,7 @@ import jp.agentec.abook.abv.bl.data.dao.AbstractDao; ...@@ -28,6 +28,7 @@ import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.TaskDao; import jp.agentec.abook.abv.bl.data.dao.TaskDao;
import jp.agentec.abook.abv.bl.dto.ProjectTaskDto; import jp.agentec.abook.abv.bl.dto.ProjectTaskDto;
import jp.agentec.abook.abv.bl.dto.TaskDto; import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVActivity; import jp.agentec.abook.abv.ui.common.activity.ABVActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity; import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.ContentViewActivity; import jp.agentec.abook.abv.ui.viewer.activity.ContentViewActivity;
...@@ -49,6 +50,13 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -49,6 +50,13 @@ public class ProjectTaskLayout extends RelativeLayout {
private static final int ICON_WIDTH = 32; private static final int ICON_WIDTH = 32;
private static final int ICON_HEIGHT = 32; private static final int ICON_HEIGHT = 32;
// 仮)ピンのイメージアイコンのサイズ
private static final int PIN_ICON_WIDTH = 20;
private static final int PIN_ICON_HEIGHT = 40;
// 仮)終了のピンのイメージアイコンのサイズ
private static final int PIN_FINISHED_ICON_WIDTH = 20;
private static final int PIN_FINISHED_ICON_HEIGHT = 40;
private static final int CODE_WIDTH = 46; private static final int CODE_WIDTH = 46;
private static final int CODE_HEIGHT = 26; private static final int CODE_HEIGHT = 26;
...@@ -63,14 +71,14 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -63,14 +71,14 @@ public class ProjectTaskLayout extends RelativeLayout {
public ZoomRelativeLayout currentLayout; public ZoomRelativeLayout currentLayout;
public ProjectTaskDto currentTaskDto; public ProjectTaskDto currentTaskDto;
private ContentViewActivity context; private ContentViewActivity mContext;
private JsInf jsInf = new JsInf(); private JsInf jsInf = new JsInf();
private static TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class); private static TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class);
public ProjectTaskLayout(final Context context, final long contentId, final String linkUrl, boolean isNormalSize) { public ProjectTaskLayout(final Context context, final long contentId, final String linkUrl, boolean isNormalSize) {
super(context); super(context);
this.context = (ContentViewActivity)context; mContext = (ContentViewActivity)context;
if (isNormalSize) { if (isNormalSize) {
setPadding(0, 130, 0, 0); setPadding(0, 130, 0, 0);
...@@ -145,7 +153,7 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -145,7 +153,7 @@ public class ProjectTaskLayout extends RelativeLayout {
final Uri uri = Uri.parse(url); final Uri uri = Uri.parse(url);
if (url.contains(ABookKeys.ABOOK_CHECK_API)) { if (url.contains(ABookKeys.ABOOK_CHECK_API)) {
((ContentViewActivity)context).commonShouldOverrideUrlLoading(uri, currentTaskDto); ((ContentViewActivity)context).commonShouldOverrideUrlLoading(uri, currentTaskDto);
} }
return true; return true;
...@@ -156,69 +164,101 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -156,69 +164,101 @@ public class ProjectTaskLayout extends RelativeLayout {
}); });
} }
public void addProjectTaskIcon(final Context context, final ZoomRelativeLayout rootLayout, final ProjectTaskDto dto) { public void addProjectTaskIcon(final ZoomRelativeLayout rootLayout, final ProjectTaskDto dto) {
RelativeLayout.LayoutParams params; RelativeLayout.LayoutParams params;
final float density = context.getResources().getDisplayMetrics().density; final float density = mContext.getResources().getDisplayMetrics().density;
View taskView; View taskView;
int width;
int height;
if(dto.taskCode == null || dto.taskCode.isEmpty()) { if(dto.taskCode == null || dto.taskCode.isEmpty()) {
// ホットスポットアイコンで表示
Logger.d(TAG, String.format("[ActionProjectTaskIcon] : taskCode=%s, dto.pdfX:%f, dto.pdfY=%f", dto.taskCode, dto.pdfX, dto.pdfY)); Logger.d(TAG, String.format("[ActionProjectTaskIcon] : taskCode=%s, dto.pdfX:%f, dto.pdfY=%f", dto.taskCode, dto.pdfX, dto.pdfY));
final ActionProjectTaskIcon taskIcon = new ActionProjectTaskIcon(context); final ActionProjectTaskIcon taskIcon = new ActionProjectTaskIcon(mContext);
taskIcon.startBlinkAnimation(); taskIcon.startBlinkAnimation();
taskIcon.taskKey = dto.taskKey; taskIcon.taskKey = dto.taskKey;
Point pointView = rootLayout.convertToViewPoint(dto.pdfX, dto.pdfY); PointF pointView = rootLayout.convertToViewPoint(dto.pdfX, dto.pdfY);
int width = (int) (ICON_WIDTH * density); width = (int) (ICON_WIDTH * density);
int height = (int) (ICON_HEIGHT * density); height = (int) (ICON_HEIGHT * density);
int marginLeft = (int)(pointView.x - (width / 2));
int marginTop = (int)(pointView.y - (height / 2));
params = new RelativeLayout.LayoutParams(width, height); params = new RelativeLayout.LayoutParams(width, height);
params.setMargins(marginLeft, marginTop, 0, 0); taskIcon.setTranslationX(pointView.x - (width / 2));
taskIcon.setTranslationY(pointView.y - (height / 2));
rootLayout.addView(taskIcon, params); rootLayout.addView(taskIcon, params);
taskView = taskIcon; taskView = taskIcon;
} else { } else {
final ActionProjectTaskCode taskCode = new ActionProjectTaskCode(context, dto.taskCode, dto.isFinished); final PointF pointView = rootLayout.convertToViewPoint(dto.pdfX, dto.pdfY);
//taskCode.startBlinkAnimation(); if (mContext.mShowPinFlg) {
taskCode.taskKey = dto.taskKey; // ピンで表示
final ActionProjectTaskPin taskPin = new ActionProjectTaskPin(mContext, dto);
final Point pointView = rootLayout.convertToViewPoint(dto.pdfX, dto.pdfY); taskPin.taskKey = dto.taskKey;
if (dto.isFinished) {
final int width = (int) (CODE_WIDTH * density); width = (int) (PIN_FINISHED_ICON_WIDTH * density);
final int height = (int) (CODE_HEIGHT * density); height = (int) (PIN_FINISHED_ICON_HEIGHT * density);
} else {
params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, height); width = (int) (PIN_ICON_WIDTH * density);
taskCode.setLayoutParams(params); height = (int) (PIN_ICON_HEIGHT * density);
taskCode.setVisibility(View.INVISIBLE); }
rootLayout.addView(taskCode, params);
taskView = taskCode;
taskCode.post(new Runnable() { params = new RelativeLayout.LayoutParams(width, height);
@Override taskPin.setVisibility(View.INVISIBLE);
public void run() { rootLayout.addView(taskPin, params);
Logger.d(TAG, String.format("[ActionProjectTaskCode] : taskCode=%s, CODE_WIDTH=%d, fX=%d, fY=%d", dto.taskCode, CODE_WIDTH, pointView.x, pointView.y)); // 座標x,yのセット
int realWidth = taskCode.getWidth(); //height is ready, sometimes realWidth = 0 taskPin.setTranslationX(pointView.x - (width / 2));
ViewGroup.MarginLayoutParams margin = (ViewGroup.MarginLayoutParams)taskCode.getLayoutParams(); taskPin.setTranslationY(pointView.y - height);
margin.leftMargin = (int)(pointView.x - ((realWidth > 0 ? realWidth : width) / 2)); if (currentTaskDto != null && currentTaskDto.taskKey.equals(taskPin.taskKey) && mContext.getOpenedProjestTask()) {
margin.topMargin = (int)(pointView.y - (height / 2)); taskPin.startBlinkAnimation();
taskCode.setLayoutParams(new RelativeLayout.LayoutParams(margin)); } else {
taskCode.setVisibility(View.VISIBLE); taskPin.stopAnimation();
} }
}); taskPin.setVisibility(View.VISIBLE);
taskView = taskPin;
} else {
// 作業コードで表示
final ActionProjectTaskCode taskCode = new ActionProjectTaskCode(mContext, dto);
//taskCode.startBlinkAnimation();
taskCode.taskKey = dto.taskKey;
final int postWidth = (int) (CODE_WIDTH * density);
final int postHeight = (int) (CODE_HEIGHT * density);
params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, postHeight);
taskCode.setLayoutParams(params);
taskCode.setVisibility(View.INVISIBLE);
rootLayout.addView(taskCode, params);
taskView = taskCode;
taskCode.post(new Runnable() {
@Override
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));
if (currentTaskDto != null && currentTaskDto.taskKey.equals(taskCode.taskKey) && mContext.getOpenedProjestTask()) {
taskCode.startBlinkAnimation();
} else {
taskCode.stopAnimation();
}
taskCode.setVisibility(View.VISIBLE);
}
});
}
} }
if (rootLayout.isEnableProjectTaskNewOrMove()) { if (rootLayout.isEnableProjectTaskNewOrMove()) {
taskView.setOnTouchListener(new View.OnTouchListener() { taskView.setOnTouchListener(new View.OnTouchListener() {
@Override @Override
public boolean onTouch(View view, MotionEvent event) { public boolean onTouch(View view, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN && rootLayout.isEnableProjectTaskClickOrMove()) { if (event.getAction() == MotionEvent.ACTION_DOWN) {
ClipData data = ClipData.newPlainText("", ""); ClipData data = ClipData.newPlainText("", "");
View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view); View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
view.startDrag(data, shadowBuilder, view, 0); view.startDrag(data, shadowBuilder, view, 0);
((ContentViewActivity) context).setCurrentProjectTask(dto); mContext.setCurrentProjectTask(dto);
} }
//rootLayout.invalidate(); //rootLayout.invalidate();
return true; return true;
...@@ -230,22 +270,22 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -230,22 +270,22 @@ public class ProjectTaskLayout extends RelativeLayout {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
Logger.d(TAG, "[taskView.setOnClickListener]:taskCode=" + dto.taskCode); Logger.d(TAG, "[taskView.setOnClickListener]:taskCode=" + dto.taskCode);
if (!((ContentViewActivity)context).getOpenedProjestTask() && rootLayout.isEnableProjectTaskClickOrMove()) { if (!mContext.getOpenedProjestTask()) {
((ContentViewActivity)context).showProjectTaskLayout(rootLayout, dto, view.getX()); mContext.showProjectTaskLayout(rootLayout, dto, view.getX());
} }
} }
}); });
} }
public void addAllProjectTaskIcon(Context context, final ZoomRelativeLayout rootLayout, final List<ProjectTaskDto> dto) { public void addAllProjectTaskIcon(final ZoomRelativeLayout rootLayout, final List<ProjectTaskDto> dto) {
for (ProjectTaskDto task : dto) { for (ProjectTaskDto task : dto) {
task.isFinished = isTaskFinished(task.taskKey); task.isFinished = isTaskFinished(task.taskKey);
addProjectTaskIcon(context, rootLayout, task); addProjectTaskIcon(rootLayout, task);
} }
} }
private boolean isTaskFinished(String taskKey) { private boolean isTaskFinished(String taskKey) {
if(context.getProjectReportUpdateType() == Constant.ProjectUpdateType.HISTORY_ADD) { if(mContext.getProjectReportUpdateType() == Constant.ProjectUpdateType.HISTORY_ADD) {
return false; return false;
} else { } else {
return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS; return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS;
...@@ -276,9 +316,9 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -276,9 +316,9 @@ public class ProjectTaskLayout extends RelativeLayout {
}); });
} }
public void showTaskForm(final Context context, ZoomRelativeLayout layout, int mXWalkOpenType, ProjectTaskDto projectTaskDto, boolean isNormalSize, float clickX) { public void showTaskForm(ZoomRelativeLayout layout, int mXWalkOpenType, ProjectTaskDto projectTaskDto, boolean isNormalSize, float clickX) {
if (projectTaskDto.taskKey.equals(TEMP_TASK_KEY)) { if (projectTaskDto.taskKey.equals(TEMP_TASK_KEY)) {
addProjectTaskIcon(context, layout, projectTaskDto); addProjectTaskIcon(layout, projectTaskDto);
setTaskFormPosition(clickX, isNormalSize); setTaskFormPosition(clickX, isNormalSize);
} }
...@@ -303,7 +343,7 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -303,7 +343,7 @@ public class ProjectTaskLayout extends RelativeLayout {
public void showProjectTaskLayout() { public void showProjectTaskLayout() {
if (getVisibility() != View.VISIBLE) { if (getVisibility() != View.VISIBLE) {
setVisibility(View.VISIBLE); setVisibility(View.VISIBLE);
context.setProjectTaskViewStatus(true); mContext.setProjectTaskViewStatus(true);
} }
} }
...@@ -401,9 +441,9 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -401,9 +441,9 @@ public class ProjectTaskLayout extends RelativeLayout {
if (currentTaskDto != null && !StringUtil.isNullOrEmpty(currentTaskDto.taskKey)) { if (currentTaskDto != null && !StringUtil.isNullOrEmpty(currentTaskDto.taskKey)) {
if (currentTaskDto.taskKey.equals(TEMP_TASK_KEY)) { if (currentTaskDto.taskKey.equals(TEMP_TASK_KEY)) {
addProjectTaskIcon(context, currentLayout, currentTaskDto); addProjectTaskIcon(currentLayout, currentTaskDto);
} else { } else {
if (context.getOpenedProjestTask()) { if (mContext.getOpenedProjestTask()) {
setTaskCodeBlinkAnimation(currentTaskDto.taskKey, true); setTaskCodeBlinkAnimation(currentTaskDto.taskKey, true);
} }
} }
...@@ -423,6 +463,16 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -423,6 +463,16 @@ public class ProjectTaskLayout extends RelativeLayout {
} }
break; break;
} }
} else if (v instanceof ActionProjectTaskPin) {
ActionProjectTaskPin code = (ActionProjectTaskPin) v;
if (code.taskKey.equals(taskKey)) {
if (isBlink) {
code.startBlinkAnimation();
} else {
code.stopAnimation();
}
break;
}
} }
} }
} }
...@@ -453,6 +503,20 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -453,6 +503,20 @@ public class ProjectTaskLayout extends RelativeLayout {
} }
break; break;
} }
} else if (v instanceof ActionProjectTaskPin) {
ActionProjectTaskPin icon = (ActionProjectTaskPin) v;
if (icon.taskKey.equals(TEMP_TASK_KEY) || icon.taskKey.equals(taskKey)) {
icon.stopAnimation();
if (isTaskFinished(taskKey)) {
icon.setImageResource(R.drawable.s_pin2);
} else {
icon.setImageResource(R.drawable.s_pin1);
}
if (isDelete || icon.taskKey.equals(TEMP_TASK_KEY)) {
currentLayout.removeView(v);
}
break;
}
} }
} }
} }
...@@ -466,22 +530,16 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -466,22 +530,16 @@ public class ProjectTaskLayout extends RelativeLayout {
} else { } else {
view.setVisibility(View.VISIBLE); view.setVisibility(View.VISIBLE);
} }
} else if (view instanceof ActionProjectTaskPin) {
if (isHide) {
view.setVisibility(View.INVISIBLE);
} else {
view.setVisibility(View.VISIBLE);
}
} }
} }
} }
public Point convertToAuthoringPoint(float x, float y) {
return currentLayout.convertToAuthoringPoint(x, y);
}
public static int getIconWidth() {
return ICON_WIDTH;
}
public static int getIconHeight() {
return ICON_HEIGHT;
}
public static String getTempTaskKey() { public static String getTempTaskKey() {
return TEMP_TASK_KEY; return TEMP_TASK_KEY;
} }
...@@ -489,7 +547,7 @@ public class ProjectTaskLayout extends RelativeLayout { ...@@ -489,7 +547,7 @@ public class ProjectTaskLayout extends RelativeLayout {
private class JsInf { private class JsInf {
@JavascriptInterface @JavascriptInterface
public void getAttachedDataUrl(String data) { public void getAttachedDataUrl(String data) {
((ABVContentViewActivity)ProjectTaskLayout.this.context).commonAttachedDataUrl(data); ((ABVContentViewActivity)ProjectTaskLayout.this.mContext).commonAttachedDataUrl(data);
} }
} }
} }
...@@ -5,6 +5,7 @@ import android.content.res.Configuration; ...@@ -5,6 +5,7 @@ import android.content.res.Configuration;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Matrix; import android.graphics.Matrix;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.PointF;
import android.view.DragEvent; import android.view.DragEvent;
import android.view.GestureDetector; import android.view.GestureDetector;
import android.view.GestureDetector.OnDoubleTapListener; import android.view.GestureDetector.OnDoubleTapListener;
...@@ -30,10 +31,7 @@ import jp.agentec.abook.abv.bl.dto.ProjectTaskDto; ...@@ -30,10 +31,7 @@ import jp.agentec.abook.abv.bl.dto.ProjectTaskDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.MemoLogic; import jp.agentec.abook.abv.bl.logic.MemoLogic;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.options.Options;
import jp.agentec.abook.abv.ui.common.constant.IFPDFConst; import jp.agentec.abook.abv.ui.common.constant.IFPDFConst;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.ClipboardUtil; import jp.agentec.abook.abv.ui.common.util.ClipboardUtil;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow; import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.common.vo.Size; import jp.agentec.abook.abv.ui.common.vo.Size;
...@@ -91,77 +89,79 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -91,77 +89,79 @@ public class ZoomRelativeLayout extends RelativeLayout {
private float fX; private float fX;
private float fY; private float fY;
class MyDragListener implements OnDragListener { class MyDragListener implements OnDragListener {
@Override @Override
public boolean onDrag(View v, DragEvent event) { public boolean onDrag(View v, DragEvent event) {
switch (event.getAction()) { switch (event.getAction()) {
case DragEvent.ACTION_DRAG_STARTED: case DragEvent.ACTION_DRAG_STARTED:
//理由不明、イベントが二回くる、二回目でgetX()だけがマイナス //理由不明、イベントが二回くる、二回目でgetX()だけがマイナス
if (event.getX() > 0) { if (event.getX() > 0) {
fX = event.getX(); fX = event.getX();
fY = event.getY(); fY = event.getY();
} }
break; break;
case DragEvent.ACTION_DRAG_ENTERED: case DragEvent.ACTION_DRAG_ENTERED:
break; break;
case DragEvent.ACTION_DRAG_EXITED: case DragEvent.ACTION_DRAG_EXITED:
break; break;
case DragEvent.ACTION_DROP: case DragEvent.ACTION_DROP:
View view = (View) event.getLocalState(); View view = (View) event.getLocalState();
float mX = event.getX(); float mX = event.getX();
float mY = event.getY(); float mY = event.getY();
int width = view.getWidth(); // 作業コード、ピンの動きが上下左右10pxの差分がなければ、クリックイベントとして見做す。
int height = view.getHeight(); if (Math.abs(mX - fX) < 10 && Math.abs(mY - fY) < 10) {
view.performClick();
if (Math.abs(mX - fX) < ProjectTaskLayout.getIconWidth() / 2 && Math.abs(mY - fY) < ProjectTaskLayout.getIconHeight() / 2) { return true;
view.performClick(); }
return true; float[] pdfMatrix = getMatrixValue(getPageView().imgMatrix);
} float scaledWidth = getScaledPDFWidth(pdfMatrix[Matrix.MSCALE_X]);
float scaledHeight = getScaledPDFHeight(pdfMatrix[Matrix.MSCALE_Y]);
float[] pdfMatrix = getMatrixValue(imgMatrix); float pdfX = pdfMatrix[Matrix.MTRANS_X];
float scaledWidth = getScaledPDFWidth(pdfMatrix[Matrix.MSCALE_X]); float pdfY = pdfMatrix[Matrix.MTRANS_Y];
float scaledHeight = getScaledPDFHeight(pdfMatrix[Matrix.MSCALE_Y]);
float pdfX = pdfMatrix[Matrix.MTRANS_X]/2;
float pdfY = pdfMatrix[Matrix.MTRANS_Y]/2;
// If left-out or right-out of PDF
if ((mX-(margin.left+pdfX)) < 0) {
mX = margin.left;
} else if ((((margin.left+pdfX)+scaledWidth)-mX)<0) {
mX = margin.left + getDefaultPDFWidth();
}
// If top-out or bottom-out of PDF
if ((mY-(margin.top+pdfY)) < 0) {
mY = margin.top;
} else if ((((margin.top+pdfY)+scaledHeight)-mY)<0) {
mY = margin.top + getDefaultPDFHeight();
}
ViewGroup.MarginLayoutParams marginDrop = (ViewGroup.MarginLayoutParams)view.getLayoutParams();
marginDrop.leftMargin = (int) (mX - width / 2);
marginDrop.topMargin = (int) (mY - height / 2);
view.setLayoutParams(marginDrop);
Point pdfPoint = convertToAuthoringPoint(mX, mY); // If left-out or right-out of PDF
((ContentViewActivity) mContext).updateProjectTaskPosition(pdfPoint.x, pdfPoint.y); if ((mX - pdfX) < 0) {
mX = pdfX;
} else if (((pdfX + scaledWidth) - mX) < 0) {
mX = pdfX + scaledWidth;
}
// Yの座標がPDF範囲を超えたか判定フラグ
boolean isOutTranslation = false;
// If top-out or bottom-out of PDF
// PDFの端上の基準値をピンとコードで分ける
float checkTopY = (view instanceof ActionProjectTaskPin ? (mY + view.getHeight() / 2) : mY);
if (checkTopY - pdfY < 0) {
isOutTranslation = true;
mY = pdfY;
} else if (((pdfY + scaledHeight) - mY) < 0) {
isOutTranslation = true;
mY = pdfY + scaledHeight;
}
// 作業のx座標をセット
view.setTranslationX(mX - view.getWidth() / 2);
// 作業のy座標をセット(作業アイコンがピンで且つ、PDF範囲を超えたフラグ(isOutTranslation)がtrueの場合、(mY - アイコンの縦サイズ)で縦をセットする)
view.setTranslationY(mY - (isOutTranslation && view instanceof ActionProjectTaskPin ? view.getHeight() : view.getHeight() / 2));
// タップした座標をPDF用の座標に変換する
PointF pdfPoint = convertToTapPoint(mX, view instanceof ActionProjectTaskPin && !isOutTranslation ? mY + view.getHeight() / 2 : mY);
if (view instanceof ActionProjectTaskCode) { // 座標を更新する
((ContentViewActivity) mContext).updateProjectTaskPosition(); ((ContentViewActivity) mContext).updateProjectTaskPosition(pdfPoint.x, pdfPoint.y);
} if (view instanceof ActionProjectTaskCode || view instanceof ActionProjectTaskPin) {
((ContentViewActivity) mContext).updateProjectTaskPosition();
}
if (view.getVisibility() == View.INVISIBLE) { if (view.getVisibility() == View.INVISIBLE) {
view.setVisibility(View.VISIBLE); view.setVisibility(View.VISIBLE);
} }
break; break;
case DragEvent.ACTION_DRAG_ENDED: case DragEvent.ACTION_DRAG_ENDED:
default: default:
break; break;
} }
return true; return true;
} }
} }
public ZoomRelativeLayout(Context context) { public ZoomRelativeLayout(Context context) {
super(context); super(context);
...@@ -184,8 +184,11 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -184,8 +184,11 @@ public class ZoomRelativeLayout extends RelativeLayout {
@Override @Override
protected void dispatchDraw(Canvas canvas) { protected void dispatchDraw(Canvas canvas) {
canvas.save(Canvas.MATRIX_SAVE_FLAG); canvas.save(Canvas.MATRIX_SAVE_FLAG);
canvas.concat(imgMatrix); if (!isProjectPdf) {
canvas.concat(imgMatrix);
}
super.dispatchDraw(canvas); super.dispatchDraw(canvas);
invalidate();
canvas.restore(); canvas.restore();
} }
...@@ -271,7 +274,8 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -271,7 +274,8 @@ public class ZoomRelativeLayout extends RelativeLayout {
mLastTouchX = x; mLastTouchX = x;
mLastTouchY = y; mLastTouchY = y;
// 作業の座標をすべて調整する
changeTaskChildView();
break; break;
} }
...@@ -316,7 +320,7 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -316,7 +320,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
private PageView getPageView() { private PageView getPageView() {
ViewGroup parenGroup = (ViewGroup) getParent(); ViewGroup parenGroup = (ViewGroup) getParent();
if (mPageView == null) { if (mPageView == null && parenGroup != null) {
for (int i = 0; i < parenGroup.getChildCount(); i++) { for (int i = 0; i < parenGroup.getChildCount(); i++) {
View view = parenGroup.getChildAt(i); View view = parenGroup.getChildAt(i);
if (!view.equals(this) && view instanceof PageView) { if (!view.equals(this) && view instanceof PageView) {
...@@ -327,7 +331,44 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -327,7 +331,44 @@ public class ZoomRelativeLayout extends RelativeLayout {
} }
} }
return mPageView; return mPageView;
}
/**
* 作業の座標をすべて調整する
*/
public void changeTaskChildView() {
if (getChildCount() > 0) {
for (int i = 0; i < getChildCount(); i++) {
View view = getChildAt(i);
if (view instanceof ActionProjectTaskCode) {
setTaskTranslationCode((ActionProjectTaskCode) view);
} else if (view instanceof ActionProjectTaskPin) {
setTaskTranslationPin((ActionProjectTaskPin) view);
}
}
}
}
/**
* ActionProjectTaskCodeのx,y座標をセット
* @param view
*/
private void setTaskTranslationCode(ActionProjectTaskCode view) {
ProjectTaskDto dto = view.mProjectTaskDto;
PointF point = convertToScalePoint(dto.pdfX, dto.pdfY);
view.setTranslationX(point.x - (view.getWidth() / 2));
view.setTranslationY(point.y - (view.getHeight() / 2));
}
/**
* ActionProjectTaskPinのx,y座標をセット
* @param view
*/
private void setTaskTranslationPin(ActionProjectTaskPin view) {
ProjectTaskDto dto = view.mProjectTaskDto;
PointF point = convertToScalePoint(dto.pdfX, dto.pdfY);
view.setTranslationX(point.x - (view.getWidth() / 2));
view.setTranslationY(point.y - view.getHeight());
} }
@Override @Override
...@@ -455,6 +496,8 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -455,6 +496,8 @@ public class ZoomRelativeLayout extends RelativeLayout {
mScaleFactor = matrixScale; mScaleFactor = matrixScale;
invalidate(); invalidate();
} }
// 作業の座標をすべて調整する
changeTaskChildView();
Logger.v(TAG, "SimpleOnScaleGestureListener:[onScale]:scaleFactor=%s", mScaleFactor); Logger.v(TAG, "SimpleOnScaleGestureListener:[onScale]:scaleFactor=%s", mScaleFactor);
return super.onScale(detector); return super.onScale(detector);
...@@ -481,10 +524,6 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -481,10 +524,6 @@ public class ZoomRelativeLayout extends RelativeLayout {
@Override @Override
public void onScaleEnd(ScaleGestureDetector detector) { public void onScaleEnd(ScaleGestureDetector detector) {
fixPosition(); fixPosition();
// if (mScaleFactor == 1.0f) {
// // 通常はonTouchUpのMotionEvent.ACTION_UPからCallする
// callZoomAction(imgMatrix);
// }
mPageScrollView.requestDisallowInterceptTouchEvent(false); mPageScrollView.requestDisallowInterceptTouchEvent(false);
if (isProjectPdf) { if (isProjectPdf) {
...@@ -493,12 +532,7 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -493,12 +532,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
} }
}; };
// private void callZoomAction(Matrix matrix) {
// float[] matrixValue = getMatrixValue(matrix);
// ((ContentViewActivity)mContext).callZoomAction(matrixValue[Matrix.MTRANS_X], matrixValue[Matrix.MTRANS_Y], matrixValue[Matrix.MSCALE_X]);
// }
/** /**
* 指を離したあとの座標を補正する * 指を離したあとの座標を補正する
*/ */
...@@ -517,6 +551,8 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -517,6 +551,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;
...@@ -579,6 +615,8 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -579,6 +615,8 @@ public class ZoomRelativeLayout extends RelativeLayout {
matrixValue[Matrix.MTRANS_Y] = matrixY; matrixValue[Matrix.MTRANS_Y] = matrixY;
imgMatrix.setValues(matrixValue); imgMatrix.setValues(matrixValue);
invalidate(); invalidate();
// 作業の座標をすべて調整する
changeTaskChildView();
Logger.v(TAG, "[fixPosition]invalidate"); Logger.v(TAG, "[fixPosition]invalidate");
} }
Logger.v(TAG, "[fixPosition][after]x=%s, y=%s", matrixValue[Matrix.MTRANS_X], matrixValue[Matrix.MTRANS_Y]); Logger.v(TAG, "[fixPosition][after]x=%s, y=%s", matrixValue[Matrix.MTRANS_X], matrixValue[Matrix.MTRANS_Y]);
...@@ -598,52 +636,110 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -598,52 +636,110 @@ public class ZoomRelativeLayout extends RelativeLayout {
for (int i = 0; i < listMemo.size(); i++) { for (int i = 0; i < listMemo.size(); i++) {
// アイコン追加 // アイコン追加
ContentMemoDto dto = listMemo.get(i); ContentMemoDto dto = listMemo.get(i);
Point point = convertToViewPoint(dto.axisX, dto.axisY); Point point = convertToMemoViewPoint(dto.axisX, dto.axisY);
dto.viewX = point.x; dto.viewX = point.x;
dto.viewY = point.y; dto.viewY = point.y;
MemoManager.addMemoIcon(this, dto); MemoManager.addMemoIcon(this, dto);
} }
} }
public Point convertToAuthoringPoint(float x, float y) { /**
Logger.d(TAG, "convertToAuthoringPoint:x=%s, y=%s", x, y); * ドロップ&ドラッグ・ダブルタップ時のx,y座標をPDFに合わせて変換
// タッチ座標からPDF座標に変換 * @param x
mPdfScale = Math.min(getWidth() / (float)mPdfSize.width, getHeight() / (float)mPdfSize.height); * @param y
float marginX = getMarginX(mPdfScale); * @return
float marginY = getMarginY(mPdfScale); */
float pdfX = x - marginX; public PointF convertToTapPoint(float x, float y) {
float pdfY = y - marginY; float[] pdfMatrix = getMatrixValue(getPageView().imgMatrix);
Logger.d(TAG, "convertToAuthoringPoint:marginX=%s, marginY=%s, mPdfScale=%s pdfX=%s, pdfY=%s", margin.left, margin.top, mPdfScale, pdfX, pdfY);
float scaleX = (float)mAuthoringPageSize.width / getScaledPDFWidth(pdfMatrix[Matrix.MSCALE_X]);
// 変換PDF基準座標からオーサリング基準座標に変換 float scaleY = (float)mAuthoringPageSize.height / getScaledPDFHeight(pdfMatrix[Matrix.MSCALE_Y]);
float scale = Math.min((float)mAuthoringPageSize.width / getDefaultPDFWidth(), (float)mAuthoringPageSize.height / getDefaultPDFHeight()); float pdfX = (x - pdfMatrix[Matrix.MTRANS_X]) * scaleX;
Point point = new Point((int)(pdfX * scale), (int)(pdfY * scale)); float pdfY = (y - pdfMatrix[Matrix.MTRANS_Y]) * scaleY;
Logger.d(TAG, "convertToAuthoringPoint:scale=%s scaledWidth=%s, scaledHeight=%s authX=%s, auyhY=%s", scale, getDefaultPDFWidth(), getDefaultPDFHeight(), (pdfX * scale), (pdfY * scale));
return point; return new PointF(pdfX, pdfY);
}
/**
* 作業の位置調整
* @param x
* @param y
* @return
*/
public PointF convertToScalePoint(float x, float y) {
float[] pdfMatrix = getMatrixValue(getPageView().imgMatrix);
float scaleX = getScaledPDFWidth(pdfMatrix[Matrix.MSCALE_X]) / (float)mAuthoringPageSize.width;
float scaleY = getScaledPDFHeight(pdfMatrix[Matrix.MSCALE_Y]) / (float)mAuthoringPageSize.height;
float pdfX = (x * scaleX) + pdfMatrix[Matrix.MTRANS_X];
float pdfY = (y * scaleY) + pdfMatrix[Matrix.MTRANS_Y];
return new PointF(pdfX, pdfY);
}
/**
* 作業の生成時、座標をPDFサイズによる変換処理
* @param x
* @param y
* @return
*/
public PointF convertToViewPoint(float x, float y) {
Logger.d(TAG, "convertToViewPoint:x=%s, y=%s", x, y);
// 初期表示時、getPageView()がnullの場合があるので、初期情報を元にx, y座標を変換する
if (getPageView() != null) {
return convertToScalePoint(x, y);
}
// 初期表示の場合は、PDFPageビューが存在しないので、初期表示のみ以下の処理で行われる
// オーサリング基準座標から変換PDF基準座標に変換
float scaleX = getDefaultPDFWidth() / (float) mAuthoringPageSize.width;
float scaleY = getDefaultPDFHeight() / (float) mAuthoringPageSize.height;
// PDF座標からタッチ座標に変換
float viewX = (x * scaleX) + margin.left;
float viewY = (y * scaleY) + margin.top;
Logger.d(TAG, "convertToViewPoint:marginX=%s, marginY=%s, mPdfScale=%s viewX=%s, viewY=%s", margin.left, margin.top, mPdfScale, viewX, viewY);
return new PointF(viewX, viewY);
} }
public Point convertToViewPoint(float x, float y) { public Point convertToMemoViewPoint(float x, float y) {
Logger.d(TAG, "convertToViewPoint:x=%s, y=%s", x, y); Logger.d(TAG, "convertToViewPoint:x=%s, y=%s", x, y);
// オーサリング基準座標から変換PDF基準座標に変換 // オーサリング基準座標から変換PDF基準座標に変換
float scale = Math.min(getDefaultPDFWidth() / (float)mAuthoringPageSize.width, getDefaultPDFHeight() / (float)mAuthoringPageSize.height); float scale = Math.min(getDefaultPDFWidth() / (float)mAuthoringPageSize.width, getDefaultPDFHeight() / (float)mAuthoringPageSize.height);
float pdfX = x * scale; float pdfX = x * scale;
float pdfY = y * scale; float pdfY = y * scale;
Logger.d(TAG, "convertToViewPoint:scale=%s scaledWidth=%s, scaledHeight=%s pdfX=%s, pdfY=%s", scale, getDefaultPDFWidth(), getDefaultPDFHeight(), pdfX, pdfY); Logger.d(TAG, "convertToMemoViewPoint:scale=%s scaledWidth=%s, scaledHeight=%s pdfX=%s, pdfY=%s", scale, getDefaultPDFWidth(), getDefaultPDFHeight(), pdfX, pdfY);
// PDF座標からタッチ座標に変換 // PDF座標からタッチ座標に変換
float viewX = pdfX + margin.left; float viewX = pdfX + margin.left;
float viewY = pdfY + margin.top; float viewY = pdfY + margin.top;
Logger.d(TAG, "convertToViewPoint:marginX=%s, marginY=%s, mPdfScale=%s viewX=%s, viewY=%s", margin.left, margin.top, mPdfScale, viewX, viewY); Logger.d(TAG, "convertToMemoViewPoint:marginX=%s, marginY=%s, mPdfScale=%s viewX=%s, viewY=%s", margin.left, margin.top, mPdfScale, viewX, viewY);
Point point = new Point((int)viewX, (int)viewY); Point point = new Point((int)viewX, (int)viewY);
return point; return point;
} }
public Point convertToMemoAuthoringPoint(float x, float y) {
Logger.d(TAG, "convertToMemoAuthoringPoint:x=%s, y=%s", x, y);
// タッチ座標からPDF座標に変換
mPdfScale = Math.min(getWidth() / (float)mPdfSize.width, getHeight() / (float)mPdfSize.height);
float marginX = getMarginX(mPdfScale);
float marginY = getMarginY(mPdfScale);
float pdfX = x - marginX;
float pdfY = y - marginY;
Logger.d(TAG, "convertToMemoAuthoringPoint:marginX=%s, marginY=%s, mPdfScale=%s pdfX=%s, pdfY=%s", margin.left, margin.top, mPdfScale, pdfX, pdfY);
// 変換PDF基準座標からオーサリング基準座標に変換
float scale = Math.min((float)mAuthoringPageSize.width / getDefaultPDFWidth(), (float)mAuthoringPageSize.height / getDefaultPDFHeight());
Point point = new Point((int)(pdfX * scale), (int)(pdfY * scale));
Logger.d(TAG, "convertToScalePoint:scale=%s scaledWidth=%s, scaledHeight=%s authX=%s, auyhY=%s", scale, getDefaultPDFWidth(), getDefaultPDFHeight(), (pdfX * scale), (pdfY * scale));
return point;
}
public boolean isLeftSideOfPdf(int x) { public boolean isLeftSideOfPdf(int x) {
return x < mAuthoringPageSize.width / 2; return x < mAuthoringPageSize.width / 2;
} }
private void showMemoMenu(final float x, final float y) { private void showMemoMenu(final float x, final float y) {
final Point convertedPoint = convertToAuthoringPoint(x, y); final Point convertedPoint = convertToMemoAuthoringPoint(x, y);
if (contentMemoDao.getCopiedMemo() != null) { if (contentMemoDao.getCopiedMemo() != null) {
// メモのコピーまたは切り取り中 // メモのコピーまたは切り取り中
final ABVPopupListWindow memoPopupWindow = createSimplePopupWindow(); final ABVPopupListWindow memoPopupWindow = createSimplePopupWindow();
...@@ -812,7 +908,6 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -812,7 +908,6 @@ public class ZoomRelativeLayout extends RelativeLayout {
} else { } else {
((GuideViewActivity) mContext).singleTapMotion(); ((GuideViewActivity) mContext).singleTapMotion();
} }
return false; return false;
} }
...@@ -837,36 +932,27 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -837,36 +932,27 @@ public class ZoomRelativeLayout extends RelativeLayout {
return true; return true;
} }
if (!isEnableProjectTaskNewOrMove()) {
if (((ContentViewActivity)mContext).isDirector()) {
ABookAlertDialog dialog = AlertDialogUtil.createAlertDialog(getContext(), " ", getResources().getString(R.string.msg_task_doubletap_failed));
dialog.setPositiveButton(R.string.ok, null);
dialog.show();
}
return true;
}
final float x = e.getX(); final float x = e.getX();
final float y = e.getY(); final float y = e.getY();
// PDF画面外側をタッチしているかチェック float[] pdfMatrix = getMatrixValue(getPageView().imgMatrix);
float[] pdfMatrix = getMatrixValue(imgMatrix); float scaledWidth = getScaledPDFWidth(pdfMatrix[Matrix.MSCALE_X]);
float scaledWidth = getScaledPDFWidth(pdfMatrix[Matrix.MSCALE_X]); float scaledHeight = getScaledPDFHeight(pdfMatrix[Matrix.MSCALE_Y]);
float scaledHeight = getScaledPDFHeight(pdfMatrix[Matrix.MSCALE_Y]); float pdfX = pdfMatrix[Matrix.MTRANS_X];
float pdfX = pdfMatrix[Matrix.MTRANS_X]/2; float pdfY = pdfMatrix[Matrix.MTRANS_Y];
float pdfY = pdfMatrix[Matrix.MTRANS_Y]/2;
// If left-out or right-out of PDF // ダブルタップがPDF表示の横領域を超えた場合は、以下の処理を行わない
if ((x-(margin.left+pdfX)) < 0 || (((margin.left+pdfX)+scaledWidth)-x)<0) { if ((x - pdfX) < 0 || ((pdfX + scaledWidth) - x) < 0) {
return true; return true;
} }
// If top-out or bottom-out of PDF // ダブルタップがPDF表示の縦領域を超えた場合は、以下の処理を行わない
if ((y-(margin.top+pdfY)) < 0 || (((margin.top+pdfY)+scaledHeight)-y)<0) { if ((y - pdfY) < 0 || ((pdfY + scaledHeight) - y) < 0) {
return true; return true;
} }
Point pointPdf = convertToAuthoringPoint(x, y); // タップしたx, yをPDF用の座標に変換
PointF pointPdf = convertToTapPoint(x, y);
ProjectTaskDto dto = new ProjectTaskDto(); ProjectTaskDto dto = new ProjectTaskDto();
dto.projectId = ((ContentViewActivity) mContext).getProjectId(); dto.projectId = ((ContentViewActivity) mContext).getProjectId();
...@@ -874,7 +960,7 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -874,7 +960,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
dto.pdfX = pointPdf.x; dto.pdfX = pointPdf.x;
dto.pdfY = pointPdf.y; dto.pdfY = pointPdf.y;
dto.pageNum = mPageNumber; dto.pageNum = mPageNumber;
//dto.contentId = mContentDto.contentId; // 作業登録画面の表示
((ContentViewActivity) mContext).showProjectTaskLayout(ZoomRelativeLayout.this, dto, x); ((ContentViewActivity) mContext).showProjectTaskLayout(ZoomRelativeLayout.this, dto, x);
} else { } else {
float[] matrixValue = getMatrixValue(imgMatrix); float[] matrixValue = getMatrixValue(imgMatrix);
...@@ -918,14 +1004,9 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -918,14 +1004,9 @@ public class ZoomRelativeLayout extends RelativeLayout {
}; };
public boolean isEnableProjectTaskNewOrMove() { public boolean isEnableProjectTaskNewOrMove() {
return mScaleFactor == 1.0f && ((ContentViewActivity)mContext).isDirector(); return ((ContentViewActivity)mContext).isDirector();
//return !mScaleDetector.isInProgress() && mPageScrollView.isMemocheck();
} }
public boolean isEnableProjectTaskClickOrMove() {
return mScaleFactor == 1.0f;
}
public boolean isZooming() { public boolean isZooming() {
return mScaleFactor > 1.0f; return mScaleFactor > 1.0f;
} }
......
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