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
e8610a8a
Commit
e8610a8a
authored
Apr 12, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
コードレビュー対応。
parent
4a769161
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
+8
-4
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/BitmapUtil.java
+2
-4
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
+8
-8
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
View file @
e8610a8a
...
...
@@ -36,7 +36,7 @@ public class CommunicationLogic extends AbstractLogic {
private
ChatMessageDao
chatMessageDao
=
AbstractDao
.
getDao
(
ChatMessageDao
.
class
);
private
ShopMemberDao
shopMemberDao
=
AbstractDao
.
getDao
(
ShopMemberDao
.
class
);
private
ChatGroupDao
chatGroupDao
=
AbstractDao
.
getDao
(
ChatGroupDao
.
class
);
private
String
localFilePath
;
/**
* {@link CommunicationLogic} クラスのインスタンスを初期化します。
* context Androidとの互換性の為のプロパティです。Androidの android.content.Context のインスタンスを指定します。<br>
...
...
@@ -781,7 +781,7 @@ public class CommunicationLogic extends AbstractLogic {
}
String
[]
filePaths
=
profileUrl
.
split
(
"/"
);
String
fileName
=
filePaths
[
filePaths
.
length
-
1
];
String
filePath
=
ABookCommConstants
.
FILE_SAVE_PATH
+
fileName
;
String
filePath
=
localFilePath
+
fileName
;
File
file
=
new
File
(
filePath
);
if
(
file
.
exists
())
{
String
uri
=
file
.
toURI
().
toString
();
...
...
@@ -796,13 +796,13 @@ public class CommunicationLogic extends AbstractLogic {
return
fileUrlPath
;
}
String
fileName
=
fileUrlPath
.
split
(
"fileName="
)[
1
].
split
(
"&"
)[
0
];
String
filePath
=
ABookCommConstants
.
FILE_SAVE_PATH
+
fileName
;
String
filePath
=
localFilePath
+
fileName
;
File
file
=
new
File
(
filePath
);
if
(
file
.
exists
())
{
String
replaceTarget
=
"https"
+
fileUrlPath
.
split
(
"https"
)[
1
].
split
(
"\""
)[
0
];
String
uri
=
file
.
toURI
().
toString
();
String
resultPath
=
fileUrlPath
;
while
(
resultPath
.
contains
(
replaceTarget
))
{
while
(
resultPath
.
contains
(
replaceTarget
))
{
resultPath
=
resultPath
.
replace
(
replaceTarget
,
uri
);
}
return
resultPath
;
...
...
@@ -810,4 +810,8 @@ public class CommunicationLogic extends AbstractLogic {
return
fileUrlPath
;
}
};
public
void
setPackagePath
(
String
localFilePath
)
{
this
.
localFilePath
=
localFilePath
;
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/util/BitmapUtil.java
View file @
e8610a8a
...
...
@@ -436,8 +436,7 @@ public class BitmapUtil {
return
bitmapList
;
}
public
static
Bitmap
convert
(
String
base64Str
)
throws
IllegalArgumentException
{
public
static
Bitmap
convert
(
String
base64Str
)
throws
IllegalArgumentException
{
byte
[]
decodedBytes
=
Base64
.
decode
(
base64Str
.
substring
(
base64Str
.
indexOf
(
","
)
+
1
),
Base64
.
DEFAULT
...
...
@@ -446,8 +445,7 @@ public class BitmapUtil {
return
BitmapFactory
.
decodeByteArray
(
decodedBytes
,
0
,
decodedBytes
.
length
);
}
public
static
String
convert
(
Bitmap
bitmap
)
{
public
static
String
convert
(
Bitmap
bitmap
)
{
ByteArrayOutputStream
outputStream
=
new
ByteArrayOutputStream
();
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
PNG
,
100
,
outputStream
);
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
View file @
e8610a8a
...
...
@@ -135,7 +135,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
setContentView
(
R
.
layout
.
chat_webview
);
Intent
intent
=
getIntent
();
communicationLogic
.
setPackagePath
(
getFilesDir
().
getAbsolutePath
()
+
"/"
);
sid
=
intent
.
getStringExtra
(
"sid"
);
roomId
=
intent
.
getLongExtra
(
"roomId"
,
0
);
roomName
=
intent
.
getStringExtra
(
"roomName"
);
...
...
@@ -388,11 +388,11 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@Override
public
void
onLoadResource
(
WebView
view
,
String
url
)
{
if
(
url
.
contains
(
"profileFileName"
))
{
if
(
url
.
contains
(
"profileFileName"
))
{
Uri
uri
=
Uri
.
parse
(
url
);
String
fileName
=
uri
.
getQueryParameter
(
"profileFileName"
);
String
filePath
=
getFilesDir
().
getAbsolutePath
()
+
"/"
+
fileName
;
Logger
.
i
(
TAG
,
filePath
);
Logger
.
d
(
TAG
,
filePath
);
File
file
=
new
File
(
filePath
);
NetworkTask
networkTask
=
new
NetworkTask
(
url
,
filePath
);
...
...
@@ -401,7 +401,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
Uri
uri
=
Uri
.
parse
(
url
);
String
fileName
=
uri
.
getQueryParameter
(
"fileName"
);
String
filePath
=
getFilesDir
().
getAbsolutePath
()
+
"/"
+
fileName
;
Logger
.
i
(
TAG
,
filePath
);
Logger
.
d
(
TAG
,
filePath
);
File
file
=
new
File
(
filePath
);
NetworkTask
networkTask
=
new
NetworkTask
(
url
,
filePath
);
...
...
@@ -1237,7 +1237,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@Override
protected
Bitmap
doInBackground
(
Void
...
params
)
{
try
{
mBitmap
=
BitmapFactory
.
decodeStream
((
InputStream
)
new
URL
(
url
).
getContent
());
mBitmap
=
BitmapFactory
.
decodeStream
((
InputStream
)
new
URL
(
url
).
getContent
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -1258,11 +1258,11 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
Bitmap
bitmap
=
resultBitmap
;
ByteArrayOutputStream
bos
=
new
ByteArrayOutputStream
();
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
PNG
,
0
,
bos
);
byte
[]
bitmap
d
ata
=
bos
.
toByteArray
();
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
PNG
,
0
,
bos
);
byte
[]
bitmap
D
ata
=
bos
.
toByteArray
();
FileOutputStream
fos
=
new
FileOutputStream
(
f
);
fos
.
write
(
bitmap
d
ata
);
fos
.
write
(
bitmap
D
ata
);
fos
.
flush
();
fos
.
close
();
}
catch
(
IOException
e
)
{
...
...
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