Commit fd158993 by Lee Jaebin

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

#32574 拡大状態でも作業指示・報告画面表示
parent d6f01a25
...@@ -7,6 +7,16 @@ ...@@ -7,6 +7,16 @@
android:background="@color/transparent"> android:background="@color/transparent">
<ImageButton <ImageButton
android:id="@+id/btn_pin"
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"
......
...@@ -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) {
......
...@@ -20,6 +20,7 @@ import android.graphics.Matrix; ...@@ -20,6 +20,7 @@ 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.Point;
import android.graphics.PointF;
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;
...@@ -156,6 +157,8 @@ import jp.agentec.abook.abv.ui.viewer.view.ABVMediaPlayer; ...@@ -156,6 +157,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;
...@@ -271,6 +274,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -271,6 +274,7 @@ 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 btnChangePin;
protected ImageButton btnHideTaskDirectBtn; protected ImageButton btnHideTaskDirectBtn;
protected ImageButton btnScaleZoomPlus; protected ImageButton btnScaleZoomPlus;
protected ImageButton btnScaleZoom03; protected ImageButton btnScaleZoom03;
...@@ -328,6 +332,8 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -328,6 +332,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;
/** /**
* スクロールステータス * スクロールステータス
...@@ -4995,11 +5001,6 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -4995,11 +5001,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 {
...@@ -5032,7 +5033,16 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5032,7 +5033,16 @@ public class ContentViewActivity extends ABVContentViewActivity {
mScaleZoomLayout.setVisibility(View.VISIBLE); mScaleZoomLayout.setVisibility(View.VISIBLE);
mMainLayout.addView(mScaleZoomLayout, params); mMainLayout.addView(mScaleZoomLayout, params);
btnChangePin = (ImageButton) mScaleZoomLayout.findViewById(id.btn_pin);
btnChangePin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mShowPinFlg = !mShowPinFlg;
changeTaskPinOrCode(mShowPinFlg);
}
});
btnChangePin.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
...@@ -5127,7 +5137,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5127,7 +5137,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(this, projectTaskLayout.currentLayout, projectTaskLayout.currentTaskDto, mShowPinFlg);
//hideProjectTaskLayout(); //hideProjectTaskLayout();
break; break;
case ABookKeys.CMD_DELETE_TASK_DIRECTIONS: case ABookKeys.CMD_DELETE_TASK_DIRECTIONS:
...@@ -5184,6 +5194,25 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5184,6 +5194,25 @@ public class ContentViewActivity extends ABVContentViewActivity {
isOpenedProjectTask = isHide; isOpenedProjectTask = isHide;
} }
/**
* 作業のアイコンをピン・作業コードに切替
* @param isShowPin
*/
public void changeTaskPinOrCode(boolean isShowPin) {
for (int i = 0; i < mShowPageLayout.size(); i++) {
int key = mShowPageLayout.keyAt(i);
ZoomRelativeLayout zoomRelativeLayout = mShowPageLayout.get(key);
for (int j = 0; j < zoomRelativeLayout.getChildCount(); j++) {
View view = zoomRelativeLayout.getChildAt(j);
if (view instanceof ActionProjectTaskCode || view instanceof ActionProjectTaskPin) {
zoomRelativeLayout.removeView(view);
}
}
List<ProjectTaskDto> tasks = mTaskHotspotJSON.getPageTasks(i);
projectTaskLayout.addAllProjectTaskIcon(this, zoomRelativeLayout, tasks);
}
}
@Override @Override
public void showTaskList() { public void showTaskList() {
projectTaskLayout.showTaskList(mCurrentPageNumber, isNormalSize()); projectTaskLayout.showTaskList(mCurrentPageNumber, isNormalSize());
...@@ -5236,7 +5265,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5236,7 +5265,7 @@ 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();
......
...@@ -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(final Context context, final 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);
setAdjustViewBounds(true);
setScaleType(ScaleType.FIT_START);
}
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;
}
}
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