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
aaac55c7
Commit
aaac55c7
authored
Jul 12, 2019
by
Kim Jinsung
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'features/1.0.500_#33721' into 'feature/1.1.0'
#33721 手書きパレット機能の追加 See merge request
!22
parents
3e285555
1658176d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
28 deletions
+22
-28
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+6
-2
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ParentWebViewActivity.java
+0
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/PhotoEditActivity.java
+16
-25
No files found.
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
View file @
aaac55c7
...
@@ -1367,7 +1367,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
...
@@ -1367,7 +1367,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
}
if
(
FileUtil
.
exists
(
tempImagePath
)){
//Tempパスにファイルがある場合、編集を実行
if
(
FileUtil
.
exists
(
tempImagePath
)){
//Tempパスにファイルがある場合、編集を実行
//編集画面をコール
//編集画面をコール
setFixedOrientation
(
true
);
//回転固定
if
(
isRotatable
())
{
setFixedOrientation
(
true
);
//回転固定
}
PhotoEditActivity
dialog
=
new
PhotoEditActivity
(
ABVContentViewActivity
.
this
,
tempImagePath
);
//ロードして編集するイメージのパスを設定
PhotoEditActivity
dialog
=
new
PhotoEditActivity
(
ABVContentViewActivity
.
this
,
tempImagePath
);
//ロードして編集するイメージのパスを設定
showPhotoEditDialog
(
dialog
);
showPhotoEditDialog
(
dialog
);
dialog
.
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
dialog
.
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
...
@@ -1377,7 +1379,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
...
@@ -1377,7 +1379,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
webViewLoadUrl
(
String
.
format
(
"javascript:document.getElementById('reportForm').contentWindow.changeThumbnailTagForAnd('%s','%s')"
,
attachedFilename
,
tempImagePath
));
webViewLoadUrl
(
String
.
format
(
"javascript:document.getElementById('reportForm').contentWindow.changeThumbnailTagForAnd('%s','%s')"
,
attachedFilename
,
tempImagePath
));
afterABookCheckApi
(
cmd
,
taskKey
,
0
,
""
,
null
);
afterABookCheckApi
(
cmd
,
taskKey
,
0
,
""
,
null
);
mPhotoEditDialog
=
null
;
mPhotoEditDialog
=
null
;
setFixedOrientation
(
false
);
////回転可能
if
(
isRotatable
())
{
setFixedOrientation
(
false
);
////回転可能
}
}
}
});
});
}
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ParentWebViewActivity.java
View file @
aaac55c7
...
@@ -120,7 +120,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
...
@@ -120,7 +120,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
mLocalFile
=
null
;
mLocalFile
=
null
;
//編集可能可否をチェックする。
//編集可能可否をチェックする。
if
(
mEnablePhotoEdit
.
equals
(
"1"
))
{
//編集の場合、編集画面を開ける。
if
(
mEnablePhotoEdit
.
equals
(
"1"
))
{
//編集の場合、編集画面を開ける。
setFixedOrientation
(
true
);
commonOpenEditPage
();
commonOpenEditPage
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/PhotoEditActivity.java
View file @
aaac55c7
...
@@ -37,11 +37,10 @@ public class PhotoEditActivity extends Dialog {
...
@@ -37,11 +37,10 @@ public class PhotoEditActivity extends Dialog {
private
final
String
TAG
=
"PhotoEditActivity"
;
private
final
String
TAG
=
"PhotoEditActivity"
;
private
final
String
editToolPath
=
"file:///android_asset/Drawing/index.html"
;
//EditToolのパス。
private
final
String
editToolPath
=
"file:///android_asset/Drawing/index.html"
;
//EditToolのパス。
private
final
String
editToolName
=
"Drawing"
;
//EditToolの名
private
final
String
editToolName
=
"Drawing"
;
//EditToolの名
private
final
float
screenToDialogRatio
=
0.8f
;
// 編集画面のタイアローグに表示するイメージの比率
private
WebView
editPageWebView
;
//ダイアローグの上に編集画面をロード
private
WebView
editPageWebView
;
//ダイアローグの上に編集画面をロード
private
Bitmap
bitmapOfPhoto
;
//写真のBitmap情報
private
Bitmap
bitmapOfPhoto
;
//写真のBitmap情報
private
in
t
photoWidth
;
private
floa
t
photoWidth
;
private
in
t
photoHeight
;
private
floa
t
photoHeight
;
private
String
photoFilePath
;
//ロードして修正するファイルのパス
private
String
photoFilePath
;
//ロードして修正するファイルのパス
private
JsInf
jsInf
=
new
JsInf
();
//Javascript Interface
private
JsInf
jsInf
=
new
JsInf
();
//Javascript Interface
private
Context
context
;
private
Context
context
;
...
@@ -79,29 +78,21 @@ public class PhotoEditActivity extends Dialog {
...
@@ -79,29 +78,21 @@ public class PhotoEditActivity extends Dialog {
Rect
displayRectangle
=
new
Rect
();
Rect
displayRectangle
=
new
Rect
();
Window
window
=
((
Activity
)
context
).
getWindow
();
Window
window
=
((
Activity
)
context
).
getWindow
();
window
.
getDecorView
().
getWindowVisibleDisplayFrame
(
displayRectangle
);
window
.
getDecorView
().
getWindowVisibleDisplayFrame
(
displayRectangle
);
float
photoRatio
=
photoWidth
/
photoHeight
;
//画面の横と縦の割合
float
displayHeight
=
(
float
)
displayRectangle
.
height
();
//画面の縦幅
float
displayWidth
=
(
float
)
displayRectangle
.
width
();
//画面の横幅
int
dialogWidth
=
(
int
)
(
displayHeight
*
photoRatio
);
//ダイアローグの横幅を縦幅について計算
if
(
photoRatio
>
1
){
dialogWidth
=
(
int
)
(
dialogWidth
*
0.75f
);
}
//横の写真はダイアローグの横幅を75パーセントに計算
else
{
dialogWidth
=
(
int
)
(
dialogWidth
*
0.9f
);
}
//縦の写真はダイアローグの横幅を90パーセントに計算
if
(
getWindow
()
!=
null
)
{
if
(
getWindow
()
!=
null
)
{
//画面の方向によってダイアローグのサイズを決定
if
(
dialogWidth
<
displayWidth
)
{
int
screenOrientation
=
context
.
getResources
().
getConfiguration
().
orientation
;
//画面の方向
//計算した横幅が画面より小さい場合はそのまま設定
switch
(
screenOrientation
)
{
getWindow
().
setLayout
(
dialogWidth
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
case
Surface
.
ROTATION_0
:
}
else
{
case
Surface
.
ROTATION_180
:
//横
//計算した横幅が画面より大き場合は画面の横幅に反映
float
photoRatio
=
(
float
)
photoWidth
/
(
float
)
photoHeight
;
//画面の横と縦の割合
getWindow
().
setLayout
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
float
displayHeight
=
(
float
)
displayRectangle
.
height
()
*
screenToDialogRatio
;
//画面の縦幅の90パーセント
float
displayWidth
=
(
float
)
displayRectangle
.
width
()
*
screenToDialogRatio
;
//画面の横幅の90パーセント
int
dialogWidth
=
(
int
)
(
displayHeight
*
photoRatio
);
//ダイアローグの横幅を計算
if
(
dialogWidth
<
displayWidth
)
{
//計算した横幅が画面より小さい場合はそのまま設定
getWindow
().
setLayout
(
dialogWidth
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
//ViewGroup.LayoutParams.WRAP_CONTENT);
}
else
{
//計算した横幅が画面より大き場合は画面の横幅に設定
getWindow
().
setLayout
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
}
break
;
case
Surface
.
ROTATION_90
:
case
Surface
.
ROTATION_270
:
//縦
//画面方向が縦の場合、画面の横幅に設定
getWindow
().
setLayout
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
break
;
}
}
}
}
...
@@ -138,7 +129,7 @@ public class PhotoEditActivity extends Dialog {
...
@@ -138,7 +129,7 @@ public class PhotoEditActivity extends Dialog {
if
(
url
.
contains
(
editToolName
))
{
if
(
url
.
contains
(
editToolName
))
{
//最初ページロードの場合
//最初ページロードの場合
//ページロードの終了後のCanvas設定
//ページロードの終了後のCanvas設定
float
photoRatio
=
(
float
)
photoHeight
/
(
float
)
photoWidth
;
//写真の割合を計算
float
photoRatio
=
photoHeight
/
photoWidth
;
//写真の割合を計算
view
.
loadUrl
(
String
.
format
(
"javascript:resizeCanvasToRatio(%f);"
,
photoRatio
));
//写真の割合によってCanvasのサイズを決める。
view
.
loadUrl
(
String
.
format
(
"javascript:resizeCanvasToRatio(%f);"
,
photoRatio
));
//写真の割合によってCanvasのサイズを決める。
view
.
loadUrl
(
String
.
format
(
"javascript:setBackground('%s');"
,
photoFilePath
));
//Canvasの背景をイメージにする
view
.
loadUrl
(
String
.
format
(
"javascript:setBackground('%s');"
,
photoFilePath
));
//Canvasの背景をイメージにする
}
}
...
...
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