Commit 0f2c5b21 by onuma

JavaScriptのインタフェース名変更に対応した。

parent 15236d5c
......@@ -365,7 +365,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
finish();
} else if (tempMessage.equals(getString(R.string.msg_invalid_parameters))) {
if (chatData.roomId != null) {
mChatWebView.loadUrl(String.format("javascript:CHAT_UI.joinRoom('%s', '%s');", chatData.roomId.toString(), chatData.roomName.toString()));
mChatWebView.loadUrl(String.format("javascript:Common.joinRoom('%s', '%s');", chatData.roomId.toString(), chatData.roomName.toString()));
} else {
mChatWebView.loadUrl(ABookCommConstants.CHAT_PAGE_URL);
}
......@@ -514,17 +514,17 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
ConnectivityManager connectivityManager = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(intent.getAction())) {
mChatWebView.loadUrl("javascript:CHAT_UI.dismissLoadingIndicator()");
mChatWebView.loadUrl("javascript:Common.dismissLoadingIndicator()");
}
if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo == null || !networkInfo.isConnectedOrConnecting()) {
chatData.setIsOnline(false);
mChatWebView.loadUrl("javascript:CHAT_UI.refreshForOffline();");
mChatWebView.loadUrl("javascript:Common.refreshForOffline();");
} else {
chatData.setIsOnline(true);
mChatWebView.loadUrl("javascript:CHAT_UI.refreshForOnline();");
mChatWebView.loadUrl("javascript:Common.refreshForOnline();");
if (mChatWebView.getUrl() != null && mChatWebView.getUrl().equals(ABookCommConstants.CHAT_ROOM_PAGE_URL)) {
mChatWebView.loadUrl("javascript:window.location.reload();");
}
......@@ -590,7 +590,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
// イメージをダウンロードする(png, jpg, jpeg, mp4, mov)
if (url.toLowerCase().endsWith(".png") || url.toLowerCase().endsWith(".jpg") || url.toLowerCase().endsWith(".jpeg")
|| url.toLowerCase().endsWith(".mov") || url.toLowerCase().endsWith(".mp4")) {
view.loadUrl("javascript:CHAT_UI.showLoadingIndicator()");
view.loadUrl("javascript:Common.showLoadingIndicator()");
DownloadManager mdDownloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
DownloadManager.Request request = new DownloadManager.Request(
Uri.parse(url));
......@@ -702,7 +702,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
return;
}
if (dataUri != null) {
mChatWebView.loadChatViewUrl("javascript:CHAT_UI.showLoadingIndicator();");
mChatWebView.loadChatViewUrl("javascript:Common.showLoadingIndicator();");
Cursor cursor = getContentResolver().query(dataUri, null, null, null, null);
cursor.moveToNext();
......@@ -1061,9 +1061,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
if (isVoice) {
chatData.roomId = chatRoomId.longValue();
chatData.roomName = chatRoomName;
mChatWebView.loadChatViewUrl(String.format("javascript:CHAT_UI.startCollaboration('%s');", ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO));
mChatWebView.loadChatViewUrl(String.format("javascript:Common.startCollaboration('%s');", ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO));
} else {
mChatWebView.loadChatViewUrl(String.format("javascript:CHAT_UI.joinRoom('%s', '%s');", chatRoomId, chatRoomName));
mChatWebView.loadChatViewUrl(String.format("javascript:Common.joinRoom('%s', '%s');", chatRoomId, chatRoomName));
}
}
......@@ -1160,7 +1160,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
try {
result = chatData.insertFavoriteUser(shopMemberId);
if (!result) { return false; }
mChatWebView.loadChatViewUrl("javascript:CHAT_UI.refreshContactScreen();");
mChatWebView.loadChatViewUrl("javascript:Common.refreshContactScreen();");
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');");
......@@ -1175,7 +1175,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
if (!result) {
return false;
}
mChatWebView.loadChatViewUrl("javascript:CHAT_UI.refreshContactScreen();");
mChatWebView.loadChatViewUrl("javascript:Common.refreshContactScreen();");
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');");
......@@ -1195,7 +1195,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
if (!result) {
return false;
}
mChatWebView.loadChatViewUrl("javascript:CHAT_UI.refreshContactScreen();");
mChatWebView.loadChatViewUrl("javascript:Common.refreshContactScreen();");
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');");
......@@ -1211,7 +1211,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
if (!result) {
return false;
}
mChatWebView.loadChatViewUrl("javascript:CHAT_UI.refreshContactScreen();");
mChatWebView.loadChatViewUrl("javascript:Common.refreshContactScreen();");
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');");
......
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