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
0c422efa
Commit
0c422efa
authored
Apr 16, 2021
by
onuma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #42130 巨大な画像を含む差替え画像のコンテンツを開くことができない
build.gradle にエミュレーターのビルドを追加
parent
61a5de98
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
6 deletions
+61
-6
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/content/MediaInfoJSON.java
+2
-2
ABVJE_Launcher_Android/build.gradle
+13
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/BitmapUtil.java
+35
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/action/ImageChangeAction.java
+11
-4
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/content/MediaInfoJSON.java
View file @
0c422efa
...
...
@@ -16,8 +16,8 @@ public class MediaInfoJSON extends AbstractJSON {
public
static
final
int
BUTTON_TYPE
=
1
;
public
static
final
int
VIDEO_TYPE
=
2
;
public
static
final
int
MUSIC_TYPE
=
3
;
public
static
final
int
CHANGE_IMAGE_TYPE
=
4
;
public
static
final
int
CHANGE_VIDEO_TYPE
=
5
;
public
static
final
int
CHANGE_IMAGE_TYPE
=
4
;
// 差し替え画像
public
static
final
int
CHANGE_VIDEO_TYPE
=
5
;
// 差し替え動画
public
static
final
int
TRIGGER_TYPE
=
6
;
public
static
final
int
RICH_TEXT_TYPE
=
7
;
public
static
final
int
VIEW3D_TYPE
=
8
;
...
...
ABVJE_Launcher_Android/build.gradle
View file @
0c422efa
...
...
@@ -133,6 +133,19 @@ android {
abiFilters
"arm64-v8a"
,
""
}
}
x86
{
versionCode
defaultConfig
.
versionCode
+
2
ndk
{
abiFilters
"x86"
,
""
}
}
x86_64
{
versionCode
defaultConfig
.
versionCode
+
3
ndk
{
abiFilters
"x86_64"
,
""
}
}
}
}
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/BitmapUtil.java
View file @
0c422efa
...
...
@@ -433,4 +433,39 @@ public class BitmapUtil {
return
bitmapList
;
}
/**
* アスペクト比を維持して、横に引き延ばしたBitmapを作成する
* @param filePath ファイルパス
* @param dispWidth 画面の幅
* @param dispHeight 画面の高さ
* @return リサイズしたBitmap
*/
public
static
Bitmap
getResizedBitmap
(
String
filePath
,
int
dispWidth
,
int
dispHeight
)
{
// Bitmap情報取得
BitmapFactory
.
Options
options
=
BitmapUtil
.
getBitmapDimensions
(
filePath
);
int
bitmapWidth
=
options
.
outWidth
;
int
bitmpaHeight
=
options
.
outHeight
;
// 変更するサイズを計算
int
targetW
;
int
targetH
;
if
(
bitmapWidth
>
bitmpaHeight
)
{
targetW
=
dispWidth
;
targetH
=
(
int
)
((
float
)
bitmpaHeight
*
(
float
)
dispWidth
/
(
float
)
bitmapWidth
);
if
(
targetH
>
dispHeight
)
{
targetH
=
dispHeight
;
targetW
=
(
int
)
((
float
)
bitmapWidth
*
(
float
)
dispHeight
/
(
float
)
bitmpaHeight
);
}
}
else
{
targetH
=
dispHeight
;
targetW
=
(
int
)
((
float
)
bitmapWidth
*
(
float
)
dispHeight
/
(
float
)
bitmpaHeight
);
if
(
targetW
>
dispWidth
)
{
targetW
=
dispWidth
;
targetH
=
(
int
)
((
float
)
bitmpaHeight
*
(
float
)
dispWidth
/
(
float
)
bitmapWidth
);
}
}
return
BitmapUtil
.
getResizedBitmap
(
filePath
,
targetW
,
targetH
,
Config
.
RGB_565
,
true
);
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/view/action/ImageChangeAction.java
View file @
0c422efa
package
jp
.
agentec
.
abook
.
abv
.
ui
.
viewer
.
view
.
action
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.cl.util.BitmapUtil
;
import
jp.agentec.abook.abv.launcher.android.R
;
import
jp.agentec.abook.abv.ui.common.util.DisplayUtil
;
import
jp.agentec.abook.abv.ui.viewer.view.ActionImageView
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.graphics.Point
;
import
android.view.animation.AnimationUtils
;
import
android.widget.ImageView
;
import
android.widget.ImageView.ScaleType
;
...
...
@@ -99,10 +102,14 @@ public class ImageChangeAction {
//noinspection deprecation(API16から非推奨になった。無視)
imgView
.
setBackgroundDrawable
(
null
);
//半透明表示
Bitmap
myBitmap
=
BitmapFactory
.
decodeFile
(
imgfile
);
imgView
.
setImageBitmap
(
myBitmap
);
// イメージをアスペクト比を無視してリサイズしているため、処理をコメントアウトする
// Bitmap resized = BitmapUtil.getResizedBitmap(imgfile, w, h, Config.RGB_565, false); //イメージサイズをリサイズする
// imgView.setImageBitmap(resized);
// ディスプレイ情報取得して、アクセプト比を維持してリサイズ
Point
point
=
DisplayUtil
.
getDisplaySize
(
context
);
int
dispWidth
=
point
.
x
;
int
dispHeight
=
point
.
y
;
Bitmap
resized
=
BitmapUtil
.
getResizedBitmap
(
imgfile
,
dispWidth
,
dispHeight
);
imgView
.
setImageBitmap
(
resized
);
layout
.
addView
(
imgView
,
param1
);
return
imgView
;
...
...
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