Commit 510b9f13 by Lee Munkyeong

Add source file

parent 622a870f
<!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
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
......@@ -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;
}
}
});
} else {
......
......@@ -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();
//ネットワークがない場合専用のページを表示。
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 = ABgetString(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();
}
});
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment