Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
d6f01a25
Commit
d6f01a25
authored
Feb 21, 2019
by
Lee Jaebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PDFプロジェクトの拡大時、ダブルタップで作業指示を追加
parent
abf5752a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
52 deletions
+61
-52
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+4
-4
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ContentViewActivity.java
+1
-10
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/ProjectTaskLayout.java
+2
-2
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/ZoomRelativeLayout.java
+54
-36
No files found.
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
View file @
d6f01a25
...
@@ -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
);
}
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ContentViewActivity.java
View file @
d6f01a25
...
@@ -1823,16 +1823,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
...
@@ -1823,16 +1823,7 @@ 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
(
zoomRelativeLayout
==
null
)
{
Logger
.
e
(
TAG
,
"zoomRelativeLayout is null"
);
return
;
}
// 拡大中は拡大率を表示
int
scale
=
(
int
)
(
mShowPageLayout
.
get
(
mCurrentPageNumber
).
getScaleFactor
()
*
100
f
);
Toast
.
makeText
(
getApplicationContext
(),
String
.
format
(
"%d%%"
,
scale
),
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
TranslateAnimation
toolBarAnimation
;
TranslateAnimation
toolBarAnimation
;
if
(
mToolBar
.
getVisibility
()
==
View
.
GONE
)
{
if
(
mToolBar
.
getVisibility
()
==
View
.
GONE
)
{
setToolbarVisable
(
true
);
setToolbarVisable
(
true
);
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/ProjectTaskLayout.java
View file @
d6f01a25
...
@@ -214,7 +214,7 @@ public class ProjectTaskLayout extends RelativeLayout {
...
@@ -214,7 +214,7 @@ public class ProjectTaskLayout extends RelativeLayout {
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
);
...
@@ -230,7 +230,7 @@ public class ProjectTaskLayout extends RelativeLayout {
...
@@ -230,7 +230,7 @@ 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
(!((
ContentViewActivity
)
context
).
getOpenedProjestTask
())
{
((
ContentViewActivity
)
context
).
showProjectTaskLayout
(
rootLayout
,
dto
,
view
.
getX
());
((
ContentViewActivity
)
context
).
showProjectTaskLayout
(
rootLayout
,
dto
,
view
.
getX
());
}
}
}
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/ZoomRelativeLayout.java
View file @
d6f01a25
...
@@ -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
;
...
@@ -598,27 +599,49 @@ public class ZoomRelativeLayout extends RelativeLayout {
...
@@ -598,27 +599,49 @@ 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
=
convertTo
View
Point
(
dto
.
axisX
,
dto
.
axisY
);
Point
point
=
convertTo
Authoring
Point
(
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);
// // タッチ座標から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, "convertToAuthoringPoint: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, "convertToAuthoringPoint:scale=%s scaledWidth=%s, scaledHeight=%s authX=%s, auyhY=%s", scale, getDefaultPDFWidth(), getDefaultPDFHeight(), (pdfX * scale), (pdfY * scale));
// return point;
// }
/**
* オブジェクトの位置調整
* @param x
* @param y
* @return
*/
public
Point
convertToAuthoringPoint
(
float
x
,
float
y
)
{
public
Point
convertToAuthoringPoint
(
float
x
,
float
y
)
{
Logger
.
d
(
TAG
,
"convertToAuthoringPoint:x=%s, y=%s"
,
x
,
y
);
float
[]
pdfMatrix
=
getMatrixValue
(
getPageView
().
imgMatrix
);
// タッチ座標からPDF座標に変換
float
pdfScale
=
pdfMatrix
[
0
];
mPdfScale
=
Math
.
min
(
getWidth
()
/
(
float
)
mPdfSize
.
width
,
getHeight
()
/
(
float
)
mPdfSize
.
height
);
float
marginX
=
getMarginX
(
mPdfScale
);
float
matrixX
=
pdfMatrix
[
Matrix
.
MTRANS_X
];
float
marginY
=
getMarginY
(
mPdfScale
);
float
matrixY
=
pdfMatrix
[
Matrix
.
MTRANS_Y
];
float
pdfX
=
x
-
marginX
;
float
pdfY
=
y
-
marginY
;
float
scaleX
=
(
float
)
mAuthoringPageSize
.
width
/
getScaledPDFWidth
(
pdfScale
);
Logger
.
d
(
TAG
,
"convertToAuthoringPoint:marginX=%s, marginY=%s, mPdfScale=%s pdfX=%s, pdfY=%s"
,
margin
.
left
,
margin
.
top
,
mPdfScale
,
pdfX
,
pdfY
);
float
scaleY
=
(
float
)
mAuthoringPageSize
.
height
/
getScaledPDFHeight
(
pdfScale
);
float
pdfX
=
(
x
*
scaleX
)
-
(
matrixX
*
scaleX
);
// 変換PDF基準座標からオーサリング基準座標に変換
float
pdfY
=
(
y
*
scaleY
)
-
(
matrixY
*
scaleY
);
float
scale
=
Math
.
min
((
float
)
mAuthoringPageSize
.
width
/
getDefaultPDFWidth
(),
(
float
)
mAuthoringPageSize
.
height
/
getDefaultPDFHeight
());
Point
point
=
new
Point
((
int
)(
pdfX
*
scale
),
(
int
)(
pdfY
*
scale
));
Point
point
=
new
Point
((
int
)
pdfX
,
(
int
)
pdfY
);
Logger
.
d
(
TAG
,
"convertToAuthoringPoint:scale=%s scaledWidth=%s, scaledHeight=%s authX=%s, auyhY=%s"
,
scale
,
getDefaultPDFWidth
(),
getDefaultPDFHeight
(),
(
pdfX
*
scale
),
(
pdfY
*
scale
));
return
point
;
return
point
;
}
}
...
@@ -837,14 +860,14 @@ public class ZoomRelativeLayout extends RelativeLayout {
...
@@ -837,14 +860,14 @@ public class ZoomRelativeLayout extends RelativeLayout {
return
true
;
return
true
;
}
}
if
(!
isEnableProjectTaskNewOrMove
())
{
//
if (!isEnableProjectTaskNewOrMove()) {
if
(((
ContentViewActivity
)
mContext
).
isDirector
())
{
//
if (((ContentViewActivity)mContext).isDirector()) {
ABookAlertDialog
dialog
=
AlertDialogUtil
.
createAlertDialog
(
getContext
(),
" "
,
getResources
().
getString
(
R
.
string
.
msg_task_doubletap_failed
));
//
ABookAlertDialog dialog = AlertDialogUtil.createAlertDialog(getContext(), " ", getResources().getString(R.string.msg_task_doubletap_failed));
dialog
.
setPositiveButton
(
R
.
string
.
ok
,
null
);
//
dialog.setPositiveButton(R.string.ok, null);
dialog
.
show
();
//
dialog.show();
}
//
}
return
true
;
//
return true;
}
//
}
final
float
x
=
e
.
getX
();
final
float
x
=
e
.
getX
();
final
float
y
=
e
.
getY
();
final
float
y
=
e
.
getY
();
...
@@ -857,14 +880,14 @@ public class ZoomRelativeLayout extends RelativeLayout {
...
@@ -857,14 +880,14 @@ public class ZoomRelativeLayout extends RelativeLayout {
float
pdfY
=
pdfMatrix
[
Matrix
.
MTRANS_Y
]/
2
;
float
pdfY
=
pdfMatrix
[
Matrix
.
MTRANS_Y
]/
2
;
// If left-out or right-out of PDF
// If left-out or right-out of PDF
if
((
x
-(
margin
.
left
+
pdfX
))
<
0
||
(((
margin
.
left
+
pdfX
)+
scaledWidth
)-
x
)<
0
)
{
//
if ((x-(margin.left+pdfX)) < 0 || (((margin.left+pdfX)+scaledWidth)-x)<0) {
return
true
;
//
return true;
}
//
}
//
// If top-out or bottom-out of PDF
//
// If top-out or bottom-out of PDF
if
((
y
-(
margin
.
top
+
pdfY
))
<
0
||
(((
margin
.
top
+
pdfY
)+
scaledHeight
)-
y
)<
0
)
{
//
if ((y-(margin.top+pdfY)) < 0 || (((margin.top+pdfY)+scaledHeight)-y)<0) {
return
true
;
//
return true;
}
//
}
Point
pointPdf
=
convertToAuthoringPoint
(
x
,
y
);
Point
pointPdf
=
convertToAuthoringPoint
(
x
,
y
);
...
@@ -918,12 +941,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
...
@@ -918,12 +941,7 @@ 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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment