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
80facdc7
Commit
80facdc7
authored
Jul 28, 2021
by
Kim Peace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed to display native progressbar in chat webview
parent
691a442a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
12 deletions
+78
-12
ABVJE_Launcher_Android/assets/chat
+1
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebViewActivity.java
+55
-3
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/view/ChatWebView.java
+16
-8
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/view/ChatWebViewDelegate.java
+6
-0
No files found.
chat
@
caecb139
Subproject commit
9ecee0d315a72826655fb964234d2271134482b2
Subproject commit
caecb139064df9e006ead24b3c6d0272d1b86baf
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebViewActivity.java
View file @
80facdc7
...
...
@@ -4,6 +4,7 @@ import android.app.Activity;
import
android.app.AlertDialog
;
import
android.app.DownloadManager
;
import
android.app.PictureInPictureParams
;
import
android.app.ProgressDialog
;
import
android.content.BroadcastReceiver
;
import
android.content.ContentValues
;
import
android.content.Context
;
...
...
@@ -15,6 +16,7 @@ import android.content.res.Configuration;
import
android.database.Cursor
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.graphics.PixelFormat
;
import
android.net.ConnectivityManager
;
import
android.net.NetworkInfo
;
import
android.net.Uri
;
...
...
@@ -85,6 +87,7 @@ import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import
jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper
;
import
jp.agentec.abook.abv.ui.home.helper.VideoEncoder
;
import
jp.agentec.abook.abv.ui.home.view.ChatWebView
;
import
jp.agentec.abook.abv.ui.home.view.ChatWebViewDelegate
;
import
jp.agentec.abook.abv.ui.home.view.FullscreenableChromeClient
;
import
jp.agentec.abook.abv.ui.viewer.activity.CommunicationWebViewActivity
;
import
jp.agentec.adf.util.StringUtil
;
...
...
@@ -96,8 +99,9 @@ import static org.chromium.net.NetError.ERR_FAILED;
* Created by AIS-NB-048 on 2019/07/31.
*/
public
class
ChatWebViewActivity
extends
CommunicationWebViewActivity
{
public
class
ChatWebViewActivity
extends
CommunicationWebViewActivity
implements
ChatWebViewDelegate
{
private
ChatWebView
mChatWebView
;
private
ProgressDialog
chatProgressDialog
;
private
String
chatWebviewUrl
;
private
final
String
TAG
=
"ChatWebViewActivity"
;
...
...
@@ -120,6 +124,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private
boolean
needHostAlert
=
false
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -163,6 +168,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private
void
setupChatWebView
()
{
mChatWebView
=
new
ChatWebView
(
ChatWebViewActivity
.
this
);
mChatWebView
.
configue
(
chatData
);
mChatWebView
.
delegate
=
this
;
}
private
void
setupDefaultChatWebViewURL
()
{
...
...
@@ -561,7 +567,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
if
(
DownloadManager
.
ACTION_DOWNLOAD_COMPLETE
.
equals
(
intent
.
getAction
()))
{
mChatWebView
.
dismiss
LoadingIndicator
();
mChatWebView
.
hide
LoadingIndicator
();
}
if
(
intent
.
getAction
().
equals
(
ConnectivityManager
.
CONNECTIVITY_ACTION
))
{
...
...
@@ -875,7 +881,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
}
}
// 共通資料画面表示
public
void
showCommonContent
()
{
Intent
intent
=
new
Intent
();
...
...
@@ -884,6 +889,52 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
startActivity
(
intent
,
NaviConsts
.
Left
);
}
private
void
showChatWebViewProgressPopup
()
{
if
(
chatProgressDialog
==
null
)
{
chatProgressDialog
=
new
ProgressDialog
(
this
);
chatProgressDialog
.
setMessage
(
getResources
().
getString
(
R
.
string
.
progress
));
chatProgressDialog
.
setIndeterminate
(
true
);
chatProgressDialog
.
setCancelable
(
false
);
if
(
chatProgressDialog
.
getWindow
()
!=
null
)
{
chatProgressDialog
.
getWindow
().
setFormat
(
PixelFormat
.
TRANSPARENT
);
}
}
if
(
chatProgressDialog
!=
null
&&
!
chatProgressDialog
.
isShowing
()
&&
!
isFinishing
())
{
chatProgressDialog
.
show
();
}
}
private
void
closeChatWebViewProgressPopup
()
{
if
(
chatProgressDialog
!=
null
&&
chatProgressDialog
.
isShowing
())
{
try
{
chatProgressDialog
.
dismiss
();
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
"closeProgressPopup error. "
,
e
);
// ignore
}
}
}
@Override
public
void
chatWebViewNeedsShowProgressBar
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
showChatWebViewProgressPopup
();
}
});
}
@Override
public
void
chatWebViewNeedsDismissProgressBar
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
closeChatWebViewProgressPopup
();
}
});
}
public
class
NetworkTask
extends
AsyncTask
<
Void
,
Void
,
Bitmap
>
{
private
String
url
;
...
...
@@ -1292,4 +1343,5 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
// 最後のチャットのルーム
PreferenceUtil
.
putUserPref
(
getApplicationContext
(),
AppDefType
.
UserPrefKey
.
CHAT_LAST_ROOMID
,
roomId
);
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/view/ChatWebView.java
View file @
80facdc7
...
...
@@ -23,6 +23,7 @@ public class ChatWebView extends WebView {
private
final
ChatWebViewActivity
chatActivity
;
private
ChatData
chatData
;
public
ChatWebViewDelegate
delegate
;
public
ChatWebView
(
Context
context
)
{
super
(
context
);
...
...
@@ -534,6 +535,21 @@ public class ChatWebView extends WebView {
return
chatData
.
getRoomInfo
();
}
@JavascriptInterface
public
void
showLoadingIndicator
()
{
if
(
delegate
!=
null
)
{
delegate
.
chatWebViewNeedsShowProgressBar
();
}
}
@JavascriptInterface
public
void
hideLoadingIndicator
()
{
if
(
delegate
!=
null
)
{
delegate
.
chatWebViewNeedsDismissProgressBar
();
}
}
public
void
loadChatViewUrl
(
final
String
urlString
)
{
post
(
new
Runnable
()
{
@Override
...
...
@@ -577,14 +593,6 @@ public class ChatWebView extends WebView {
loadUrl
(
"javascript:penOff();"
);
}
public
void
showLoadingIndicator
()
{
loadChatViewUrl
(
"javascript:Common.showLoadingIndicator();"
);
}
public
void
dismissLoadingIndicator
()
{
loadUrl
(
"javascript:Common.dismissLoadingIndicator()"
);
}
public
void
refreshForOffline
()
{
loadUrl
(
"javascript:Common.refreshForOffline();"
);
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/view/ChatWebViewDelegate.java
0 → 100644
View file @
80facdc7
package
jp
.
agentec
.
abook
.
abv
.
ui
.
home
.
view
;
public
interface
ChatWebViewDelegate
{
void
chatWebViewNeedsShowProgressBar
();
void
chatWebViewNeedsDismissProgressBar
();
}
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