Commit 0f2c5b21 by onuma

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

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