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
510b9f13
Commit
510b9f13
authored
Dec 11, 2020
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add source file
parent
622a870f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
143 additions
and
51 deletions
+143
-51
ABVJE_Launcher_Android/assets/chat/public/index.html
+57
-0
ABVJE_Launcher_Android/assets/chat/public/js/chat-error.js
+16
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
+41
-47
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
+29
-4
No files found.
ABVJE_Launcher_Android/assets/chat/public/index.html
0 → 100644
View file @
510b9f13
<!doctype html>
<html
lang=
"en"
style=
"background: #DBDBDB;"
>
<head>
<!-- Required meta tags -->
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1, user-scalable=0"
>
<title>
Prototype
</title>
<link
href=
"./fontawesome/css/all.css"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"./css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"./css/lightbox.min.css"
>
<link
rel=
"stylesheet"
href=
"./css/chat.css"
>
<script>
const
PLATFORM
=
'android'
;
const
IS_MOBILE
=
true
;
</script>
</script>
</head>
<body>
<nav
class=
"navbar navbar-expand navbar-dark bg-primary fixed-top flex-md-nowrap p-2 shadow"
>
<ul
class=
"navbar-nav col-3"
id=
"navbarLeft"
>
<button
class=
"btn btn-primary"
type=
"button"
id=
"homeButton"
>
<i
class=
"fa fa-home"
style=
"font-size: 1.6rem;"
></i>
</button>
</ul>
<a
class=
"navbar-brand col-6 mr-0 text-truncate titleRoomName text-center"
href=
"#"
>
Error
</a>
</nav>
<div
class=
"error-aria"
>
<img
id=
"errorImg"
src=
"./icon/error_top_icon.svg"
>
<div
id=
"errorTitle"
>
<a>
ネットワークエラー
</a>
</div>
<div
id=
"errorMsg"
>
ネットワークに接続できませんでした。電波が良いところでもう一度接続してください。
</div>
<button
class=
"bg-primary reload-button"
id=
"reloadButton"
>
更新
</button>
<img
id=
"errorEnd"
src=
"./icon/error_footer_img.svg"
>
</div>
</div>
<script
src=
"./js/libs/jquery-3.3.1.min.js"
></script>
<script
src=
"./js/libs/popper.min.js"
></script>
<script
src=
"./js/libs/moment.js"
></script>
<script
src=
"./js/libs/locale/ko.js"
charset=
"UTF-8"
></script>
<script
src=
"./js/libs/locale/ja.js"
charset=
"UTF-8"
></script>
<script
src=
"./js/libs/mustache.min.js"
></script>
<script
src=
"./js/libs/deparam.js"
></script>
<script
src=
"./js/libs/bootstrap.min.js"
></script>
<script
src=
"./js/libs/jquery.mark.min.js"
></script>
<script
src=
"./js/libs/lightbox.js"
></script>
<script
src=
"./js/language.js"
></script>
<script
src=
"./js/language_ko.js"
charset=
"UTF-8"
></script>
<script
src=
"./js/language_ja.js"
charset=
"UTF-8"
></script>
<script
src=
"./js/language_en.js"
charset=
"UTF-8"
></script>
<script
src=
"./js/chat-util.js"
></script>
<script
src=
"./js/chat-error.js"
></script>
</body>
</html>
\ No newline at end of file
ABVJE_Launcher_Android/assets/chat/public/js/chat-error.js
0 → 100644
View file @
510b9f13
jQuery
(
'#homeButton'
).
on
(
'click'
,
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要。
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
android
.
goHome
();
}
});
jQuery
(
'#reloadButton'
).
on
(
'click'
,
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
//TODO IOS処理追加必要。
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
android
.
reload
();
}
});
\ No newline at end of file
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
View file @
510b9f13
...
...
@@ -148,7 +148,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
int
TYPE_SHOW_TOAST
=
1
;
int
TYPE_SHOW_ALERT
=
2
;
}
public
interface
ContentCheckResultType
{
int
NETWORK_ERROR
=
-
2
;
int
ERROR
=
-
1
;
...
...
@@ -161,19 +161,19 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
sendRegistrationIdToCMS
();
sendRegistrationIdToCMS
();
activityHandlingHelper
=
ActivityHandlingHelper
.
getInstance
();
activityHandlingHelper
.
setCurrentActivity
(
this
);
}
private
void
sendRegistrationIdToCMS
()
{
// Tokenが更新されたか確認
if
(!
PreferenceUtil
.
getUserPref
(
this
,
UserPrefKey
.
NEED_SEND_TOKEN
,
false
)){
// 更新されてない
return
;
}
String
fcmToken
=
FirebaseInstanceId
.
getInstance
().
getToken
();
boolean
isSendSuccess
=
false
;
// Tokenが更新されたか確認
if
(!
PreferenceUtil
.
getUserPref
(
this
,
UserPrefKey
.
NEED_SEND_TOKEN
,
false
)){
// 更新されてない
return
;
}
String
fcmToken
=
FirebaseInstanceId
.
getInstance
().
getToken
();
boolean
isSendSuccess
=
false
;
// CMSに送信
if
(
getRInteger
(
R
.
integer
.
push_message
)
==
1
&&
fcmToken
!=
null
)
{
try
{
...
...
@@ -185,7 +185,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
else
{
AbstractLogic
.
getLogic
(
UserAuthenticateLogic
.
class
).
updateDeviceTokenByMacAdress
(
fcmToken
);
}
isSendSuccess
=
true
;
isSendSuccess
=
true
;
}
catch
(
NetworkDisconnectedException
e
)
{
Logger
.
w
(
TAG
,
"[sendRegistrationIdToCMS] NetworkDisconnectedException"
);
}
catch
(
Exception
e
)
{
...
...
@@ -193,7 +193,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
}
// CMSへ更新した結果をセットする
PreferenceUtil
.
putUserPref
(
this
,
UserPrefKey
.
NEED_SEND_TOKEN
,
!
isSendSuccess
);
PreferenceUtil
.
putUserPref
(
this
,
UserPrefKey
.
NEED_SEND_TOKEN
,
!
isSendSuccess
);
}
...
...
@@ -211,7 +211,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
Initializer
.
getInstance
().
init
(
getABVApplication
());
}
validateLoginStatus
();
if
(
ABVEnvironment
.
getInstance
().
acmsAddress
==
null
)
{
loadAddressIfSaasGeneral
();
}
...
...
@@ -289,14 +289,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
* Viewを開始します。
*/
public
void
startContentViewActivity
(
Intent
intent
,
long
contentId
)
{
// 該当コンテンツが360コンテンツ&直前にある場合、startActivityで移動せず、履歴で残っているActivityをそのまま表示する。
if
(
checkPanoContent
(
contentId
)
&&
ActivityHandlingHelper
.
getInstance
().
hasPreviousPanoContentId
(
contentId
))
{
finish
();
return
;
}
// 該当コンテンツが360コンテンツ&直前にある場合、startActivityで移動せず、履歴で残っているActivityをそのまま表示する。
if
(
checkPanoContent
(
contentId
)
&&
ActivityHandlingHelper
.
getInstance
().
hasPreviousPanoContentId
(
contentId
))
{
finish
();
return
;
}
// 直前のActivityにはないが、同じ360コンテンツが存在している場合、それをfinishさせる。
ActivityHandlingHelper
.
getInstance
().
deleteExistPanoContentId
(
contentId
);
// 直前のActivityにはないが、同じ360コンテンツが存在している場合、それをfinishさせる。
ActivityHandlingHelper
.
getInstance
().
deleteExistPanoContentId
(
contentId
);
// コンテンツアラートのサービスオプションがYの時はアラートを表示
if
(
AbstractLogic
.
getLogic
(
ContractLogic
.
class
).
getContentAlert
())
{
...
...
@@ -306,17 +306,17 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
}
/**
* 360コンテンツ使用可能かのチェック
* バーチャルツアー:OS4.4以上
* 360動画:OS5.0以上
* @param contentId
* @return
*/
private
boolean
checkPanoContent
(
long
contentId
)
{
int
ret
=
ContentViewHelper
.
getInstance
().
check360Content
(
contentId
);
return
ret
==
0
?
false
:
true
;
}
/**
* 360コンテンツ使用可能かのチェック
* バーチャルツアー:OS4.4以上
* 360動画:OS5.0以上
* @param contentId
* @return
*/
private
boolean
checkPanoContent
(
long
contentId
)
{
int
ret
=
ContentViewHelper
.
getInstance
().
check360Content
(
contentId
);
return
ret
==
0
?
false
:
true
;
}
private
void
contentViewActivityMoveWithContentAlert
(
final
Intent
intent
,
final
long
contentId
,
final
NaviConsts
ABVNavi
)
{
ContentDto
contentDto
=
contentDao
.
getContent
(
contentId
);
...
...
@@ -510,10 +510,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
configureKeepScreen
();
}
if
(
e
!=
null
)
{
//新着更新時にログアウトすることで、SIDが取得できなく、例外が発生したときにはトースト非表示
if
(
ABVDataCache
.
getInstance
().
getMemberInfo
()
!=
null
)
{
handleError
(
e
);
}
//新着更新時にログアウトすることで、SIDが取得できなく、例外が発生したときにはトースト非表示
if
(
ABVDataCache
.
getInstance
().
getMemberInfo
()
!=
null
)
{
handleError
(
e
);
}
}
}
});
...
...
@@ -541,9 +541,9 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
try
{
ContentDto
dto
=
contentDao
.
getContent
(
contentId
);
if
(
dto
==
null
)
{
return
ContentCheckResultType
.
ERROR
;
}
return
ContentCheckResultType
.
ERROR
;
}
ContractLogic
contractLogic
=
AbstractLogic
.
getLogic
(
ContractLogic
.
class
);
checkStatus
=
contentLogic
.
getContentCheckDeliverable
(
contentId
,
dto
.
resourceVersion
);
if
(
checkStatus
==
ContentCheckResultType
.
NO_AUTH_DELETE
)
{
...
...
@@ -678,7 +678,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
public
void
showWifiDisconnectAlert
(
final
int
messageId
,
final
DialogInterface
.
OnClickListener
positive
,
final
DialogInterface
.
OnClickListener
negative
)
throws
NetworkDisconnectedException
{
showWifiDisconnectAlert
(
messageId
,
R
.
string
.
download
,
positive
,
negative
);
}
public
void
showWifiDisconnectAlert
(
final
int
messageId
,
final
int
titleId
,
final
DialogInterface
.
OnClickListener
positive
,
final
DialogInterface
.
OnClickListener
negative
)
throws
NetworkDisconnectedException
{
if
(
ABVEnvironment
.
getInstance
().
networkAdapter
.
getActiveNetworkType
()
==
ConnectivityManager
.
TYPE_MOBILE
&&
PreferenceUtil
.
get
(
this
,
DefPrefKey
.
WIFI_ALERT_ENABLE
,
true
)){
handler
.
post
(
new
Runnable
()
{
...
...
@@ -737,7 +737,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
protected
void
setDisplaySize
()
{
mDisplaySize
=
DisplayUtil
.
getDisplaySize2
(
getApplicationContext
());
Logger
.
v
(
TAG
,
"[Size] display width=%s, height=%s"
,
mDisplaySize
.
width
,
mDisplaySize
.
height
);
}
...
...
@@ -864,14 +864,8 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
ll_menuItem_chat
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
// チャット利用のはネットワークが繋がる時のみ
if
(
ABVEnvironment
.
getInstance
().
networkAdapter
.
isNetworkConnected
())
{
ActivityHandlingHelper
.
getInstance
().
startChatWebviewActivity
();
mCommunicationMenuDialog
.
dismiss
();
}
else
{
ABVToastUtil
.
showMakeText
(
getABVApplication
().
getBaseContext
(),
R
.
string
.
request_network_connection
,
Toast
.
LENGTH_SHORT
);
return
;
}
ActivityHandlingHelper
.
getInstance
().
startChatWebviewActivity
();
mCommunicationMenuDialog
.
dismiss
();
}
});
}
else
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
View file @
510b9f13
...
...
@@ -75,14 +75,18 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
if
(
isNormalSize
())
{
setPortraitIfNormal
();
}
setContentView
(
R
.
layout
.
chat_webview
);
Intent
intent
=
getIntent
();
chatWebviewUrl
=
intent
.
getStringExtra
(
"chatWebviewUrl"
);
//ネットワークがない場合専用のページを表示。
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"
);
...
...
@@ -162,7 +166,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
if
(
message
.
equals
(
"server error Ocurred"
))
{
message
=
getString
(
R
.
string
.
msg_error_chat_server
);
message
=
AB
getString
(
R
.
string
.
msg_error_chat_server
);
}
else
if
(
message
.
equals
(
"Disconnected from the server"
))
{
message
=
getString
(
R
.
string
.
msg_error_chat_disconnected
);
}
else
if
(
message
.
equals
(
"connect_error"
))
{
...
...
@@ -584,6 +588,27 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
});
}
@JavascriptInterface
public
void
goHome
()
{
mChatWebView
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
backToHome
();
}
});
}
@JavascriptInterface
public
void
reload
()
{
mChatWebView
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
ActivityHandlingHelper
.
getInstance
().
startChatWebviewActivity
();
}
});
}
}
/**
...
...
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