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
7b36ca87
Commit
7b36ca87
authored
Aug 29, 2019
by
Jeong Gilmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#34467 対応
parent
219773dc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
7 deletions
+23
-7
ABVJE_Launcher_Android/assets/Drawing/css/drawingboard.css
+1
-1
ABVJE_Launcher_Android/assets/Drawing/index.html
+2
-2
ABVJE_Launcher_Android/assets/Drawing/js/drawingboard.js
+10
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/PhotoEditActivity.java
+10
-3
No files found.
ABVJE_Launcher_Android/assets/Drawing/css/drawingboard.css
View file @
7b36ca87
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
.drawing-board
{
position
:
relative
;
display
:
block
;
}
.drawing-board
{
position
:
relative
;
display
:
block
;
}
.drawing-board-canvas-wrapper
{
position
:
relative
;
margin
:
0
;
border
:
1px
solid
#ddd
;
}
.drawing-board-canvas-wrapper
{
position
:
relative
;
margin
:
auto
;
border
:
1px
solid
#ddd
;
}
.drawing-board-canvas
{
position
:
absolute
;
top
:
0
;
left
:
0
;
z-index
:
10
;
width
:
auto
;
}
.drawing-board-canvas
{
position
:
absolute
;
top
:
0
;
left
:
0
;
z-index
:
10
;
width
:
auto
;
}
...
...
ABVJE_Launcher_Android/assets/Drawing/index.html
View file @
7b36ca87
...
@@ -76,8 +76,8 @@
...
@@ -76,8 +76,8 @@
});
});
//Canvasのサイズを写真の横縦割合に合わせて変更
//Canvasのサイズを写真の横縦割合に合わせて変更
function
resizeCanvasToRatio
(
ratio
){
function
resizeCanvasToRatio
(
ratio
,
maxHeight
){
aisEditTool
.
resizeCanvasToRatio
(
ratio
);
aisEditTool
.
resizeCanvasToRatio
(
ratio
,
maxHeight
);
}
}
//CanvasのBackgroundをイメージファイルのurlに設定
//CanvasのBackgroundをイメージファイルのurlに設定
...
...
ABVJE_Launcher_Android/assets/Drawing/js/drawingboard.js
View file @
7b36ca87
...
@@ -971,7 +971,9 @@ DrawingBoard.Board.prototype = {
...
@@ -971,7 +971,9 @@ DrawingBoard.Board.prototype = {
},
},
//Canvasのサイズを写真の横縦割合に合わせて変更
//Canvasのサイズを写真の横縦割合に合わせて変更
resizeCanvasToRatio
:
function
(
ratio
){
resizeCanvasToRatio
:
function
(
ratio
,
maxHeight
){
var
minWidth
=
240
;
//上位クラスの横幅と縦幅を修正
//上位クラスの横幅と縦幅を修正
this
.
$el
.
width
(
'100%'
);
this
.
$el
.
width
(
'100%'
);
this
.
$el
.
height
(
'100%'
);
this
.
$el
.
height
(
'100%'
);
...
@@ -979,6 +981,13 @@ DrawingBoard.Board.prototype = {
...
@@ -979,6 +981,13 @@ DrawingBoard.Board.prototype = {
var
w
=
this
.
$el
.
width
();
var
w
=
this
.
$el
.
width
();
var
h
=
w
*
ratio
;
//横幅によって縦幅を決める。
var
h
=
w
*
ratio
;
//横幅によって縦幅を決める。
if
(
w
<
minWidth
){
h
=
maxHeight
w
=
h
/
ratio
;
}
this
.
dom
.
$controls
.
width
(
188
);
//Canvasの縁のサイズを設定
//Canvasの縁のサイズを設定
this
.
dom
.
$canvasWrapper
.
css
(
'width'
,
w
+
'px'
);
this
.
dom
.
$canvasWrapper
.
css
(
'width'
,
w
+
'px'
);
this
.
dom
.
$canvasWrapper
.
css
(
'height'
,
h
+
'px'
);
this
.
dom
.
$canvasWrapper
.
css
(
'height'
,
h
+
'px'
);
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/PhotoEditActivity.java
View file @
7b36ca87
...
@@ -37,10 +37,13 @@ public class PhotoEditActivity extends Dialog {
...
@@ -37,10 +37,13 @@ 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
int
dialogMinWidthWeb
=
280
;
//ダイアローグの最小の横幅
private
WebView
editPageWebView
;
//ダイアローグの上に編集画面をロード
private
WebView
editPageWebView
;
//ダイアローグの上に編集画面をロード
private
Bitmap
bitmapOfPhoto
;
//写真のBitmap情報
private
Bitmap
bitmapOfPhoto
;
//写真のBitmap情報
private
float
photoWidth
;
private
float
photoWidth
;
private
float
photoHeight
;
private
float
photoHeight
;
private
float
displayHeight
;
private
float
displayDensity
;
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,7 +82,8 @@ public class PhotoEditActivity extends Dialog {
...
@@ -79,7 +82,8 @@ public class PhotoEditActivity extends Dialog {
Window
window
=
((
Activity
)
context
).
getWindow
();
Window
window
=
((
Activity
)
context
).
getWindow
();
window
.
getDecorView
().
getWindowVisibleDisplayFrame
(
displayRectangle
);
window
.
getDecorView
().
getWindowVisibleDisplayFrame
(
displayRectangle
);
float
photoRatio
=
photoWidth
/
photoHeight
;
//画面の横と縦の割合
float
photoRatio
=
photoWidth
/
photoHeight
;
//画面の横と縦の割合
float
displayHeight
=
(
float
)
displayRectangle
.
height
();
//画面の縦幅
displayHeight
=
(
float
)
displayRectangle
.
height
();
//画面の縦幅
displayDensity
=
getContext
().
getResources
().
getDisplayMetrics
().
density
;
float
displayWidth
=
(
float
)
displayRectangle
.
width
();
//画面の横幅
float
displayWidth
=
(
float
)
displayRectangle
.
width
();
//画面の横幅
int
dialogWidth
=
(
int
)
(
displayHeight
*
photoRatio
);
//ダイアローグの横幅を縦幅について計算
int
dialogWidth
=
(
int
)
(
displayHeight
*
photoRatio
);
//ダイアローグの横幅を縦幅について計算
...
@@ -89,10 +93,13 @@ public class PhotoEditActivity extends Dialog {
...
@@ -89,10 +93,13 @@ public class PhotoEditActivity extends Dialog {
if
(
getWindow
()
!=
null
)
{
if
(
getWindow
()
!=
null
)
{
if
(
dialogWidth
<
displayWidth
)
{
if
(
dialogWidth
<
displayWidth
)
{
//計算した横幅が画面より小さい場合はそのまま設定
//計算した横幅が画面より小さい場合はそのまま設定
if
(
dialogWidth
<
dialogMinWidthWeb
*
displayDensity
){
dialogWidth
=
(
int
)
(
dialogMinWidthWeb
*
displayDensity
);
}
getWindow
().
setLayout
(
dialogWidth
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
getWindow
().
setLayout
(
dialogWidth
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
}
else
{
}
else
{
//計算した横幅が画面より大き場合は画面の横幅に反映
//計算した横幅が画面より大き場合は画面の横幅に反映
getWindow
().
setLayout
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
getWindow
().
setLayout
(
(
int
)
displayWidth
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
}
}
}
}
...
@@ -130,7 +137,7 @@ public class PhotoEditActivity extends Dialog {
...
@@ -130,7 +137,7 @@ public class PhotoEditActivity extends Dialog {
//最初ページロードの場合
//最初ページロードの場合
//ページロードの終了後のCanvas設定
//ページロードの終了後のCanvas設定
float
photoRatio
=
photoHeight
/
photoWidth
;
//写真の割合を計算
float
photoRatio
=
photoHeight
/
photoWidth
;
//写真の割合を計算
view
.
loadUrl
(
String
.
format
(
"javascript:resizeCanvasToRatio(%f
);"
,
photoRatio
));
//写真の割合によってCanvasのサイズを決める。
view
.
loadUrl
(
String
.
format
(
"javascript:resizeCanvasToRatio(%f
, %f);"
,
photoRatio
,
(
displayHeight
/
displayDensity
*
0.7f
)
));
//写真の割合によって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