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
479d019d
Commit
479d019d
authored
Feb 27, 2019
by
Lee Jaebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
作業コードが更新できない問題・作業登録ホットスポットでドラッグ&ドロップの修正
parent
ff95d636
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
69 deletions
+70
-69
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ProjectLogic.java
+1
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/ZoomRelativeLayout.java
+69
-68
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ProjectLogic.java
View file @
479d019d
...
...
@@ -316,7 +316,7 @@ public class ProjectLogic extends AbstractLogic {
if
(!
newValue
.
equals
(
taskDirectionsItemsDto
.
inputValue
))
{
// 値が異なる場合のみ、更新する
taskDirectionsItemsDto
.
inputValue
=
newValue
;
if
(
taskDirectionsItemsDto
.
i
nputValue
.
startsWith
(
"q_1_"
))
{
if
(
taskDirectionsItemsDto
.
i
temKey
.
startsWith
(
"q_1_"
))
{
// 値が異なるため、作業コードの入力値を変更する
taskDto
.
taskCode
=
taskDirectionsItemsDto
.
inputValue
;
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/ZoomRelativeLayout.java
View file @
479d019d
...
...
@@ -88,79 +88,80 @@ public class ZoomRelativeLayout extends RelativeLayout {
private
float
fX
;
private
float
fY
;
class
MyDragListener
implements
OnDragListener
{
@Override
public
boolean
onDrag
(
View
v
,
DragEvent
event
)
{
class
MyDragListener
implements
OnDragListener
{
@Override
public
boolean
onDrag
(
View
v
,
DragEvent
event
)
{
View
view
=
(
View
)
event
.
getLocalState
();
if
(
view
instanceof
ActionProjectTaskCode
||
view
instanceof
ActionProjectTaskPin
)
{
switch
(
event
.
getAction
())
{
case
DragEvent
.
ACTION_DRAG_STARTED
:
//理由不明、イベントが二回くる、二回目でgetX()だけがマイナス
if
(
event
.
getX
()
>
0
)
{
fX
=
event
.
getX
();
fY
=
event
.
getY
();
}
break
;
case
DragEvent
.
ACTION_DRAG_ENTERED
:
break
;
case
DragEvent
.
ACTION_DRAG_EXITED
:
break
;
case
DragEvent
.
ACTION_DROP
:
float
mX
=
event
.
getX
();
float
mY
=
event
.
getY
();
if
(
Math
.
abs
(
mX
-
fX
)
<
view
.
getWidth
()
/
2
&&
Math
.
abs
(
mY
-
fY
)
<
view
.
getHeight
()
/
2
)
{
view
.
performClick
();
return
true
;
}
float
[]
pdfMatrix
=
getMatrixValue
(
getPageView
().
imgMatrix
);
float
scaledWidth
=
getScaledPDFWidth
(
pdfMatrix
[
Matrix
.
MSCALE_X
]);
float
scaledHeight
=
getScaledPDFHeight
(
pdfMatrix
[
Matrix
.
MSCALE_Y
]);
float
pdfX
=
pdfMatrix
[
Matrix
.
MTRANS_X
];
float
pdfY
=
pdfMatrix
[
Matrix
.
MTRANS_Y
];
// If left-out or right-out of PDF
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
=
tapConvertToAuthoringPoint
(
mX
,
view
instanceof
ActionProjectTaskPin
&&
!
isOutTranslation
?
mY
+
view
.
getHeight
()
/
2
:
mY
);
// 座標を更新する
((
ContentViewActivity
)
mContext
).
updateProjectTaskPosition
(
pdfPoint
.
x
,
pdfPoint
.
y
);
switch
(
event
.
getAction
())
{
case
DragEvent
.
ACTION_DRAG_STARTED
:
//理由不明、イベントが二回くる、二回目でgetX()だけがマイナス
if
(
event
.
getX
()
>
0
)
{
fX
=
event
.
getX
();
fY
=
event
.
getY
();
}
break
;
case
DragEvent
.
ACTION_DRAG_ENTERED
:
break
;
case
DragEvent
.
ACTION_DRAG_EXITED
:
break
;
case
DragEvent
.
ACTION_DROP
:
float
mX
=
event
.
getX
();
float
mY
=
event
.
getY
();
if
(
Math
.
abs
(
mX
-
fX
)
<
view
.
getWidth
()
/
2
&&
Math
.
abs
(
mY
-
fY
)
<
view
.
getHeight
()
/
2
)
{
view
.
performClick
();
return
true
;
}
float
[]
pdfMatrix
=
getMatrixValue
(
getPageView
().
imgMatrix
);
float
scaledWidth
=
getScaledPDFWidth
(
pdfMatrix
[
Matrix
.
MSCALE_X
]);
float
scaledHeight
=
getScaledPDFHeight
(
pdfMatrix
[
Matrix
.
MSCALE_Y
]);
float
pdfX
=
pdfMatrix
[
Matrix
.
MTRANS_X
];
float
pdfY
=
pdfMatrix
[
Matrix
.
MTRANS_Y
];
// If left-out or right-out of PDF
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
=
tapConvertToAuthoringPoint
(
mX
,
view
instanceof
ActionProjectTaskPin
&&
!
isOutTranslation
?
mY
+
view
.
getHeight
()
/
2
:
mY
);
// 座標を更新する
((
ContentViewActivity
)
mContext
).
updateProjectTaskPosition
(
pdfPoint
.
x
,
pdfPoint
.
y
);
if
(
view
instanceof
ActionProjectTaskCode
||
view
instanceof
ActionProjectTaskPin
)
{
((
ContentViewActivity
)
mContext
).
updateProjectTaskPosition
();
}
if
(
view
.
getVisibility
()
==
View
.
INVISIBLE
)
{
view
.
setVisibility
(
View
.
VISIBLE
);
}
if
(
view
.
getVisibility
()
==
View
.
INVISIBLE
)
{
view
.
setVisibility
(
View
.
VISIBLE
);
}
break
;
case
DragEvent
.
ACTION_DRAG_ENDED
:
default
:
break
;
}
break
;
case
DragEvent
.
ACTION_DRAG_ENDED
:
default
:
break
;
}
return
true
;
}
}
return
true
;
}
}
public
ZoomRelativeLayout
(
Context
context
)
{
super
(
context
);
...
...
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