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
1d256d23
Commit
1d256d23
authored
Dec 25, 2020
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify to display placeholder when not connected network
parent
502112c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
7 deletions
+30
-7
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
+30
-7
No files found.
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
View file @
1d256d23
...
...
@@ -32,8 +32,10 @@ import java.io.File;
import
java.util.List
;
import
java.util.Objects
;
import
jp.agentec.abook.abv.bl.acms.client.AcmsClient
;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.constant.ABookKeys
;
import
jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.dto.PushMessageDto
;
import
jp.agentec.abook.abv.cl.util.PreferenceUtil
;
...
...
@@ -48,6 +50,8 @@ import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import
jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper
;
import
jp.agentec.abook.abv.ui.viewer.activity.ParentWebViewActivity
;
import
static
org
.
chromium
.
net
.
NetError
.
ERR_FAILED
;
/**
* Created by AIS-NB-048 on 2019/07/31.
*/
...
...
@@ -57,6 +61,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private
String
chatWebviewUrl
;
private
final
String
TAG
=
"ChatWebviewActivity"
;
private
final
String
NETWORK_ERROR_PLACE_HOLDER
=
"file:///android_asset/chat/public/index.html"
;
//AISDevelop
private
JsInf
jsInf
=
new
JsInf
();
...
...
@@ -81,18 +88,26 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
setContentView
(
R
.
layout
.
chat_webview
);
Intent
intent
=
getIntent
();
//ネットワークがない場合専用のページを表示。
if
(
ABVEnvironment
.
getInstance
().
networkAdapter
.
isNetworkConnected
())
{
chatWebviewUrl
=
intent
.
getStringExtra
(
"chatWebviewUrl"
);
}
else
{
chatWebviewUrl
=
"file:///android_asset/chat/public/index.html"
;
}
sid
=
intent
.
getStringExtra
(
"sid"
);
roomId
=
intent
.
getLongExtra
(
"roomId"
,
0
);
roomName
=
intent
.
getStringExtra
(
"roomName"
);
loginId
=
intent
.
getStringExtra
(
"loginId"
);
shopName
=
intent
.
getStringExtra
(
"shopName"
);
//ネットワークがない場合専用のページを表示。
chatWebviewUrl
=
NETWORK_ERROR_PLACE_HOLDER
;
if
(
ABVEnvironment
.
getInstance
().
networkAdapter
.
isNetworkConnected
())
{
try
{
if
(
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
checkSid
(
sid
))
{
chatWebviewUrl
=
intent
.
getStringExtra
(
"chatWebviewUrl"
);
}
}
catch
(
Exception
e
)
{
Logger
.
d
(
"SID_CHECK_ERROR"
);
}
}
else
{
Logger
.
d
(
"DEVICE_NOT_CONNECTED_NETWORK:"
);
}
mChatWebView
=
findViewById
(
R
.
id
.
chatWebview2
);
mChatWebView
.
setOverScrollMode
(
View
.
OVER_SCROLL_NEVER
);
//オーバースクロールしない。
mChatWebView
.
setVerticalScrollBarEnabled
(
false
);
//スクロールバーを消す。
...
...
@@ -307,7 +322,15 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@Override
public
void
onReceivedError
(
WebView
view
,
int
errorCode
,
String
description
,
String
failingUrl
)
{
Logger
.
d
(
"WEB_VIEW_TEST"
,
"error code:"
+
errorCode
+
" - "
+
description
);
if
(
errorCode
==
ERR_FAILED
)
{
mChatWebView
.
removeView
(
view
);
view
.
removeAllViews
();
mChatWebView
.
reload
();
mChatWebView
.
loadUrl
(
NETWORK_ERROR_PLACE_HOLDER
);
}
Logger
.
d
(
"WEB_VIEW_ERROR"
,
"error code:"
+
errorCode
+
" - "
+
description
);
}
@Override
...
...
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