Commit 0cd2a8de by onuma

不要なコードを削除した

parent 02afc046
...@@ -28,7 +28,6 @@ import android.provider.MediaStore; ...@@ -28,7 +28,6 @@ import android.provider.MediaStore;
import android.support.annotation.RequiresApi; import android.support.annotation.RequiresApi;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.webkit.CookieManager; import android.webkit.CookieManager;
import android.webkit.DownloadListener; import android.webkit.DownloadListener;
...@@ -38,7 +37,6 @@ import android.webkit.ValueCallback; ...@@ -38,7 +37,6 @@ import android.webkit.ValueCallback;
import android.webkit.WebView; import android.webkit.WebView;
import android.webkit.WebViewClient; import android.webkit.WebViewClient;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.Toast; import android.widget.Toast;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
...@@ -95,7 +93,6 @@ import jp.agentec.abook.abv.ui.common.constant.ErrorCode; ...@@ -95,7 +93,6 @@ import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts; import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.Interface.ChatRoomEventListener;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.VideoEncoder; import jp.agentec.abook.abv.ui.home.helper.VideoEncoder;
...@@ -112,7 +109,7 @@ import static org.chromium.net.NetError.ERR_FAILED; ...@@ -112,7 +109,7 @@ import static org.chromium.net.NetError.ERR_FAILED;
* Created by AIS-NB-048 on 2019/07/31. * Created by AIS-NB-048 on 2019/07/31.
*/ */
public class ChatWebViewActivity extends CommunicationWebViewActivity implements ChatRoomEventListener { public class ChatWebViewActivity extends CommunicationWebViewActivity {
public ChatWebView mChatWebView; public ChatWebView mChatWebView;
private String chatWebviewUrl; private String chatWebviewUrl;
...@@ -126,7 +123,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -126,7 +123,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
private boolean isOnline; private boolean isOnline;
public Long roomId; public Long roomId;
public String roomType; public String roomType;
public String collaborationType; public String strCollaborationType;
public String groupId; public String groupId;
public String beforeRoomType; public String beforeRoomType;
public Integer shopMemberId; public Integer shopMemberId;
...@@ -136,7 +133,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -136,7 +133,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
private boolean isPIP; private boolean isPIP;
private boolean isStop; private boolean isStop;
private String encodedFilePath; private String encodedFilePath;
private Uri encodedVideoPath;
// 0:協業生成, 1:協業参加 // 0:協業生成, 1:協業参加
public Integer collaborationJoinFlg = 0; public Integer collaborationJoinFlg = 0;
...@@ -144,9 +140,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -144,9 +140,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
private ActivityHandlingHelper handlingHelper = ActivityHandlingHelper.getInstance(); private ActivityHandlingHelper handlingHelper = ActivityHandlingHelper.getInstance();
public AlertDialog myAlertDialog; public AlertDialog myAlertDialog;
private ImageButton mOperationHomeButton; // ホームボタン
private ImageButton mOperationRelatedContentButton; // 関連資料ボタン
private BroadcastReceiver receiver; private BroadcastReceiver receiver;
private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class); private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
...@@ -162,7 +155,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -162,7 +155,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
setPortraitIfNormal(); setPortraitIfNormal();
} }
initializeWebView(); initializeWebView();
//setContentView(R.layout.chat_webview);
FrameLayout layout = new FrameLayout(this); FrameLayout layout = new FrameLayout(this);
FrameLayout.LayoutParams param = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); FrameLayout.LayoutParams param = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
setContentView(mChatWebView, param); setContentView(mChatWebView, param);
...@@ -186,17 +178,15 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -186,17 +178,15 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
roomType = intent.getStringExtra("roomType"); roomType = intent.getStringExtra("roomType");
loginId = intent.getStringExtra("loginId"); loginId = intent.getStringExtra("loginId");
shopName = intent.getStringExtra("shopName"); shopName = intent.getStringExtra("shopName");
collaborationType = intent.getStringExtra("collaborationType"); strCollaborationType = intent.getStringExtra("collaborationType");
isOnline = false; isOnline = false;
} }
private void setupChatWebView() { private void setupChatWebView() {
mChatWebView = new ChatWebView(ChatWebViewActivity.this); mChatWebView = new ChatWebView(ChatWebViewActivity.this);
//mChatWebView = findViewById(R.id.chatWebview);
mChatWebView.init(); mChatWebView.init();
mChatWebView.setCommunicationLogic(communicationLogic); mChatWebView.setCommunicationLogic(communicationLogic);
mChatWebView.setChatRoomEventListener(this);
} }
private void setupDefaultChatWebViewURL() { private void setupDefaultChatWebViewURL() {
...@@ -268,7 +258,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -268,7 +258,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
if (StringUtil.isNullOrEmpty(roomType)) { if (StringUtil.isNullOrEmpty(roomType)) {
roomType = communicationLogic.getChatRoom(integerRoomId).type.toString(); roomType = communicationLogic.getChatRoom(integerRoomId).type.toString();
} }
if (StringUtil.isNullOrEmpty(collaborationType)) { if (StringUtil.isNullOrEmpty(strCollaborationType)) {
String parameterData = "sid=" + sid + "&loginId=" + loginId + "&shopName=" + shopName + "&roomId=" + roomId + "&roomName=" + roomName + fixedParam; String parameterData = "sid=" + sid + "&loginId=" + loginId + "&shopName=" + shopName + "&roomId=" + roomId + "&roomName=" + roomName + fixedParam;
mChatWebView.postUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL, parameterData.getBytes()); mChatWebView.postUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL, parameterData.getBytes());
} else { } else {
...@@ -280,7 +270,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -280,7 +270,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} catch (AcmsException e) { } catch (AcmsException e) {
e.printStackTrace(); e.printStackTrace();
} }
moveCollaborationScreen(Integer.parseInt(collaborationType)); moveCollaborationScreen(Integer.parseInt(strCollaborationType));
} }
} else { // Chat } else { // Chat
if (lastRoomName.length() > 0 && lastRoomId.length() > 0) { if (lastRoomName.length() > 0 && lastRoomId.length() > 0) {
...@@ -390,7 +380,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -390,7 +380,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
// サーバと接続された場合、チャット画面を閉じる // サーバと接続された場合、チャット画面を閉じる
if (tempMessage.equals(getString(R.string.msg_error_chat_disconnected)) || tempMessage.equals(getString(R.string.msg_error_chat_room_sc_forbidden))) { if (tempMessage.equals(getString(R.string.msg_error_chat_disconnected)) || tempMessage.equals(getString(R.string.msg_error_chat_room_sc_forbidden))) {
mChatWebView.loadUrl("javascript:CHAT.leaveRoom()"); mChatWebView.loadUrl("javascript:ReverseDelegate.leaveRoom()");
finish(); finish();
} else if (tempMessage.equals(getString(R.string.msg_error_chat_join))) { } else if (tempMessage.equals(getString(R.string.msg_error_chat_join))) {
getLogin(); getLogin();
...@@ -604,7 +594,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -604,7 +594,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
String description, String failingUrl) { String description, String failingUrl) {
if (errorCode == ERR_FAILED) { if (errorCode == ERR_FAILED) {
mChatWebView.removeView(view); mChatWebView.removeView(view);
view.removeAllViews(); view.removeAllViews();
mChatWebView.reload(); mChatWebView.reload();
...@@ -649,26 +638,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -649,26 +638,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} }
} }
// 下辺のツールバー設定
private void settingBottomToolbar() {
// ホームボタン活性化
mOperationHomeButton.setEnabled(true);
// 共通資料ボタンの非活性化
mOperationRelatedContentButton.setEnabled(true);
// バッチを付けるか判定して、イメージを設定
setCommunicationImageButton();
// コミュニケーションボタン
communicationButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showCommunicationMenuDialog();
}
});
}
@Override
public void showCommunicationChatMenuDialog() { public void showCommunicationChatMenuDialog() {
showCommunicationMenuDialog(); showCommunicationMenuDialog();
} }
...@@ -681,7 +650,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -681,7 +650,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
return filenameWithoutExtension; return filenameWithoutExtension;
} }
@Override
public void getLogin() { public void getLogin() {
// ローカルの言語を確認する // ローカルの言語を確認する
String localLanguage = ActivityHandlingHelper.getInstance().getLocaleFileName(); String localLanguage = ActivityHandlingHelper.getInstance().getLocaleFileName();
...@@ -706,7 +674,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -706,7 +674,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} }
} }
@Override
public void getQueryParam() { public void getQueryParam() {
String chatServerUrl = ABVEnvironment.getInstance().websocketServerHttpUrl; String chatServerUrl = ABVEnvironment.getInstance().websocketServerHttpUrl;
chatServerUrl= chatServerUrl.substring(0, chatServerUrl.length() - 3); chatServerUrl= chatServerUrl.substring(0, chatServerUrl.length() - 3);
...@@ -753,13 +720,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -753,13 +720,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
return; return;
} }
if (dataUri != null) { if (dataUri != null) {
mChatWebView.loadChatViewUrl("javascript:CHAT_UI.showLoadingIndicator();");
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl("javascript:CHAT_UI.showLoadingIndicator();");
}
});
Cursor cursor = getContentResolver().query(dataUri, null, null, null, null); Cursor cursor = getContentResolver().query(dataUri, null, null, null, null);
cursor.moveToNext(); cursor.moveToNext();
...@@ -778,7 +739,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -778,7 +739,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
mChatWebView.loadUrl("javascript:CHAT_UI.videoEncodeEnd('" +encodedFilePath + "')"); mChatWebView.loadUrl("javascript:ChatMediaHandler.videoEncodeEnd('" +encodedFilePath + "')");
} }
}); });
} }
...@@ -788,7 +749,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -788,7 +749,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
String encodedPath = new VideoEncoder().changeResolution(file, callBack); String encodedPath = new VideoEncoder().changeResolution(file, callBack);
encodedFilePath = encodedPath; encodedFilePath = encodedPath;
} catch (Throwable throwable) { } catch (Throwable throwable) {
mChatWebView.loadUrl("javascript:CHAT_UI.videoEncodeFail();)"); mChatWebView.loadUrl("javascript:ChatMediaHandler.videoEncodeFail();)");
} }
} }
}; };
...@@ -846,9 +807,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -846,9 +807,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
/** /**
* 作業一覧へ遷移 * 作業一覧へ遷移
*/ */
@Override
public void backToHome() { public void backToHome() {
mChatWebView.loadUrl("javascript:CHAT.leaveRoom()"); mChatWebView.loadUrl("javascript:ReverseDelegate.leaveRoom()");
exitAndDeleteMeetingRoom(); exitAndDeleteMeetingRoom();
finish(); finish();
Intent intent = new Intent(); Intent intent = new Intent();
...@@ -958,12 +918,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -958,12 +918,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
return; return;
} }
mCollaborationType = collaborationType; mCollaborationType = collaborationType;
mChatWebView.post(new Runnable() { mChatWebView.loadChatViewUrl(ABookCommConstants.COLLABORATION_PAGE_URL);
@Override
public void run() {
mChatWebView.loadUrl(ABookCommConstants.COLLABORATION_PAGE_URL);
}
});
} }
public boolean deleteFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException { public boolean deleteFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException {
...@@ -1017,19 +972,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1017,19 +972,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
updateFavoriteGroup(); updateFavoriteGroup();
} }
/** 
* ボタンイベント設定
*/
private void setOnButtonEvent() {
// 作業のホーム画面へ
mOperationHomeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
backToHome();
}
});
}
@Override @Override
public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) { public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) {
isPIP = isInPictureInPictureMode; isPIP = isInPictureInPictureMode;
...@@ -1053,7 +995,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1053,7 +995,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
// 共通資料画面表示 // 共通資料画面表示
@Override
public void showCommonContent() { public void showCommonContent() {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClass(ChatWebViewActivity.this, OperationRelatedContentActivity.class); intent.setClass(ChatWebViewActivity.this, OperationRelatedContentActivity.class);
...@@ -1073,7 +1014,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1073,7 +1014,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
this.filePath = filePath; this.filePath = filePath;
} }
@Override @Override
protected Bitmap doInBackground(Void... params) { protected Bitmap doInBackground(Void... params) {
try { try {
...@@ -1178,46 +1118,35 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1178,46 +1118,35 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
updateUnreadCount(); updateUnreadCount();
} }
@Override
public void setSelectedUserIdList(String userList) { public void setSelectedUserIdList(String userList) {
selectedUserIdList = userList; selectedUserIdList = userList;
} }
@Override
public String getSelectedUserList() { public String getSelectedUserList() {
String userList = communicationLogic.getUserList(selectedUserIdList); String userList = communicationLogic.getUserList(selectedUserIdList);
Log.d("getSelectedUserList " , userList ); Log.d("getSelectedUserList " , userList );
return userList; return userList;
} }
@Override
public void updateRoomList() throws NetworkDisconnectedException, AcmsException { public void updateRoomList() throws NetworkDisconnectedException, AcmsException {
RoomListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getRoomList(sid); RoomListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getRoomList(sid);
communicationLogic.insertChatRoomList(resultJson.roomList); communicationLogic.insertChatRoomList(resultJson.roomList);
} }
@Override
public void updateMyInfo() throws NetworkDisconnectedException, AcmsException { public void updateMyInfo() throws NetworkDisconnectedException, AcmsException {
updateMyInfoFromServer(); updateMyInfoFromServer();
} }
@Override
public void updateGroupUser() throws NetworkDisconnectedException, AcmsException { public void updateGroupUser() throws NetworkDisconnectedException, AcmsException {
updateGroupInfoFromServer(); updateGroupInfoFromServer();
} }
@Override
public void createChatRoom(String roomType, String userIdList, String encodedRoomName, String screenFlg, boolean isVoice) throws NetworkDisconnectedException, AcmsException { public void createChatRoom(String roomType, String userIdList, String encodedRoomName, String screenFlg, boolean isVoice) throws NetworkDisconnectedException, AcmsException {
CreatedRoomJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).createRoom(sid, roomType, userIdList, encodedRoomName, loginId); CreatedRoomJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).createRoom(sid, roomType, userIdList, encodedRoomName, loginId);
if (ABookCommConstants.FLAG.SCREEN_FLG.MAKE_ROOM.equals(Integer.parseInt(screenFlg))) { if (ABookCommConstants.FLAG.SCREEN_FLG.MAKE_ROOM.equals(Integer.parseInt(screenFlg))) {
final ChatRoomDto chatRoomDto = communicationLogic.getChatRoom(resultJson.chatRoomDto.chatRoomId); final ChatRoomDto chatRoomDto = communicationLogic.getChatRoom(resultJson.chatRoomDto.chatRoomId);
if (chatRoomDto != null) { if (chatRoomDto != null) {
mChatWebView.post(new Runnable() { mChatWebView.loadChatViewUrl(String.format("javascript:ReverseDelegate.displayExistRoom('%s');", chatRoomDto.chatRoomId.toString()));
@Override
public void run() {
mChatWebView.loadUrl(String.format("javascript:CHAT_UI.displayExistRoom('%s');", chatRoomDto.chatRoomId.toString()));
}
});
return; return;
} }
} }
...@@ -1228,23 +1157,12 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1228,23 +1157,12 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
if (isVoice) { if (isVoice) {
roomId = chatRoomId.longValue(); roomId = chatRoomId.longValue();
roomName = chatRoomName; roomName = chatRoomName;
mChatWebView.post(new Runnable() { mChatWebView.loadChatViewUrl(String.format("javascript:CHAT_UI.startCollaboration('%s');", ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO));
@Override
public void run() {
mChatWebView.loadUrl(String.format("javascript:CHAT_UI.startCollaboration('%s');", ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO));
}
});
} else { } else {
mChatWebView.post(new Runnable() { mChatWebView.loadChatViewUrl(String.format("javascript:CHAT_UI.joinRoom('%s', '%s');", chatRoomId, chatRoomName));
@Override
public void run() {
mChatWebView.loadUrl(String.format("javascript:CHAT_UI.joinRoom('%s', '%s');", chatRoomId, chatRoomName));
}
});
} }
} }
@Override
public void changeRoomName(String changeRoomName) throws NetworkDisconnectedException, AcmsException { public void changeRoomName(String changeRoomName) throws NetworkDisconnectedException, AcmsException {
ChangeRoomNameJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).changeRoomName(sid, changeRoomName, roomId.intValue()); ChangeRoomNameJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).changeRoomName(sid, changeRoomName, roomId.intValue());
if (resultJson.status != 200) { return; } if (resultJson.status != 200) { return; }
...@@ -1253,7 +1171,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1253,7 +1171,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
joinRoom(roomId.toString(), changeRoomName); joinRoom(roomId.toString(), changeRoomName);
} }
@Override
public void joinRoom(String joinRoomId, String joinRoomName) { public void joinRoom(String joinRoomId, String joinRoomName) {
ChatRoomDto chatRoom = communicationLogic.getChatRoom(Integer.parseInt(joinRoomId)); ChatRoomDto chatRoom = communicationLogic.getChatRoom(Integer.parseInt(joinRoomId));
roomId = chatRoom.chatRoomId.longValue(); roomId = chatRoom.chatRoomId.longValue();
...@@ -1265,13 +1182,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1265,13 +1182,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL); mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL);
} }
@Override
public void roomDisplayOff(){ public void roomDisplayOff(){
communicationLogic.roomDisplayOff(roomId.intValue(), ABookCommConstants.FLAG.ROOM_VIEW_FLAG.INVISIBLE); communicationLogic.roomDisplayOff(roomId.intValue(), ABookCommConstants.FLAG.ROOM_VIEW_FLAG.INVISIBLE);
mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_PAGE_URL); mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_PAGE_URL);
} }
@Override
public void inviteUsers(String userIds, boolean isCollaboration) throws NetworkDisconnectedException, AcmsException { public void inviteUsers(String userIds, boolean isCollaboration) throws NetworkDisconnectedException, AcmsException {
final UserInviteResultJSON result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).inviteUsers(sid, roomId.intValue(), roomName, userIds); final UserInviteResultJSON result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).inviteUsers(sid, roomId.intValue(), roomName, userIds);
if (result.roomId == null) { if (result.roomId == null) {
...@@ -1280,26 +1195,22 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1280,26 +1195,22 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL); mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL);
} }
} else { } else {
mChatWebView.loadChatViewUrl(String.format("javascript:CHAT_UI.displayExistRoom('%s');", result.roomId.toString())); mChatWebView.loadChatViewUrl(String.format("javascript:ReverseDelegate.displayExistRoom('%s');", result.roomId.toString()));
} }
} }
@Override
public String getRoomType() { public String getRoomType() {
return roomType; return roomType;
} }
@Override
public String getBeforeRoomType() { public String getBeforeRoomType() {
return beforeRoomType; return beforeRoomType;
} }
@Override
public void clearBeforeRoomType() { public void clearBeforeRoomType() {
beforeRoomType = null; beforeRoomType = null;
} }
@Override
public void updateMessages(String roomId) throws NetworkDisconnectedException, AcmsException { public void updateMessages(String roomId) throws NetworkDisconnectedException, AcmsException {
SharedPreferences pref = getSharedPreferences(ABookCommConstants.TAG, MODE_PRIVATE); SharedPreferences pref = getSharedPreferences(ABookCommConstants.TAG, MODE_PRIVATE);
String lastUpdatedDate = pref.getString(ABookCommConstants.KEY.MESSAGE_UPDATED_DATE + roomId, DEFAULT_CHECKSUM); String lastUpdatedDate = pref.getString(ABookCommConstants.KEY.MESSAGE_UPDATED_DATE + roomId, DEFAULT_CHECKSUM);
...@@ -1315,48 +1226,34 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1315,48 +1226,34 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
editor.commit(); editor.commit();
} }
@Override
public String searchMessages(String keyword, String userList) { public String searchMessages(String keyword, String userList) {
String messageListStr = communicationLogic.searMessages(roomId.intValue(), keyword, userList); return communicationLogic.searMessages(roomId.intValue(), keyword, userList);
return messageListStr;
} }
@Override
public String getFavoriteUsersNotInRoom() { public String getFavoriteUsersNotInRoom() {
String favoriteUsersStr = communicationLogic.getFavoriteUsersNotInRoom(roomId.intValue()); return communicationLogic.getFavoriteUsersNotInRoom(roomId.intValue());
return favoriteUsersStr;
} }
@Override
public String getMyGroupUsersNotInRoom() { public String getMyGroupUsersNotInRoom() {
String myGroupUsersStr = communicationLogic.getMyGroupUsersNotInRoom(roomId.intValue()); return communicationLogic.getMyGroupUsersNotInRoom(roomId.intValue());
return myGroupUsersStr;
} }
@Override
public String getMyGroupShopMemberNotInRoomByName(String keywords) { public String getMyGroupShopMemberNotInRoomByName(String keywords) {
String searchUserStr = communicationLogic.getMyGroupUserNotInRoomByName(keywords, roomId.intValue()); return communicationLogic.getMyGroupUserNotInRoomByName(keywords, roomId.intValue());
return searchUserStr;
} }
@Override
public String getAllGroupShopMemberNotInRoomByName(String keywords) { public String getAllGroupShopMemberNotInRoomByName(String keywords) {
String searchUserStr = communicationLogic.getAllGroupShopMemberNotInRoomByName(keywords, roomId.intValue()); return communicationLogic.getAllGroupShopMemberNotInRoomByName(keywords, roomId.intValue());
return searchUserStr;
} }
@Override
public void updateUserInfo(String shopMemberId) throws NetworkDisconnectedException, AcmsException { public void updateUserInfo(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
updateUserInfoFromServer(shopMemberId); updateUserInfoFromServer(shopMemberId);
} }
@Override
public String getGroupInfoForAddUser(String groupId) { public String getGroupInfoForAddUser(String groupId) {
String groupInfoStr = communicationLogic.getGroupSearchDataForAddUser(Integer.parseInt(groupId), roomId.intValue()); return communicationLogic.getGroupSearchDataForAddUser(Integer.parseInt(groupId), roomId.intValue());
return groupInfoStr;
} }
@Override
public boolean addFavoriteUser(String shopMemberId) throws AcmsException { public boolean addFavoriteUser(String shopMemberId) throws AcmsException {
Integer favoriteCount = communicationLogic.getFavoriteCount(); Integer favoriteCount = communicationLogic.getFavoriteCount();
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT ) { if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT ) {
...@@ -1376,7 +1273,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1376,7 +1273,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
return false; return false;
} }
@Override
public boolean removeFavoriteUser(String shopMemberId) throws AcmsException { public boolean removeFavoriteUser(String shopMemberId) throws AcmsException {
try { try {
boolean result = deleteFavoriteUser(shopMemberId); boolean result = deleteFavoriteUser(shopMemberId);
...@@ -1391,7 +1287,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1391,7 +1287,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
return false; return false;
} }
@Override
public boolean addFavoriteGroup(String groupId) throws AcmsException { public boolean addFavoriteGroup(String groupId) throws AcmsException {
Integer favoriteCount = communicationLogic.getFavoriteCount(); Integer favoriteCount = communicationLogic.getFavoriteCount();
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT) { if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT) {
...@@ -1413,7 +1308,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1413,7 +1308,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
return false; return false;
} }
@Override
public boolean removeFavoriteGroup(String groupId) throws AcmsException { public boolean removeFavoriteGroup(String groupId) throws AcmsException {
boolean result = false; boolean result = false;
try { try {
...@@ -1429,12 +1323,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1429,12 +1323,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
return false; return false;
} }
@Override
public void updateFavorite() throws NetworkDisconnectedException, AcmsException { public void updateFavorite() throws NetworkDisconnectedException, AcmsException {
updateFavoriteInfo(); updateFavoriteInfo();
} }
@Override
public void updateArchiveList() throws NetworkDisconnectedException, AcmsException { public void updateArchiveList() throws NetworkDisconnectedException, AcmsException {
SharedPreferences pref = getSharedPreferences(ABookCommConstants.TAG, MODE_PRIVATE); SharedPreferences pref = getSharedPreferences(ABookCommConstants.TAG, MODE_PRIVATE);
String updateDate = pref.getString(ABookCommConstants.KEY.ARCHIVE_UPDATED_DATE, DEFAULT_CHECKSUM); String updateDate = pref.getString(ABookCommConstants.KEY.ARCHIVE_UPDATED_DATE, DEFAULT_CHECKSUM);
...@@ -1446,7 +1338,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1446,7 +1338,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
editor.commit(); editor.commit();
} }
@Override
public void updateArchiveDetail(String archiveId) throws NetworkDisconnectedException, AcmsException { public void updateArchiveDetail(String archiveId) throws NetworkDisconnectedException, AcmsException {
ArchiveDto archiveDto = communicationLogic.getArchive(Integer.parseInt(archiveId)); ArchiveDto archiveDto = communicationLogic.getArchive(Integer.parseInt(archiveId));
RoomJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getRoom(sid, archiveDto.roomId.toString()); RoomJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getRoom(sid, archiveDto.roomId.toString());
...@@ -1454,7 +1345,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1454,7 +1345,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
communicationLogic.updateArchiveDetial(archiveDto); communicationLogic.updateArchiveDetial(archiveDto);
} }
@Override
public void joinCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException { public void joinCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException {
joinMeetingId = Integer.parseInt(meetingId); joinMeetingId = Integer.parseInt(meetingId);
collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.JOIN; collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.JOIN;
...@@ -1462,55 +1352,45 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1462,55 +1352,45 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
moveCollaborationScreen(Integer.parseInt(collaborationType)); moveCollaborationScreen(Integer.parseInt(collaborationType));
} }
@Override
public void joinChangedCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException { public void joinChangedCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException {
joinMeetingId = Integer.parseInt(meetingId); joinMeetingId = Integer.parseInt(meetingId);
collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.JOIN; collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.JOIN;
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).joinCollaboration(sid, roomId.intValue()); AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).joinCollaboration(sid, roomId.intValue());
} }
@Override
public void inviteCollaboration(String inviteUserIds, String collaborationType) throws NetworkDisconnectedException, AcmsException { public void inviteCollaboration(String inviteUserIds, String collaborationType) throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).inviteCollaboration(sid, roomId.intValue(), roomName, inviteUserIds, collaborationType); AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).inviteCollaboration(sid, roomId.intValue(), roomName, inviteUserIds, collaborationType);
} }
@Override
public void startCollaboration(String collaborationType) { public void startCollaboration(String collaborationType) {
collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.CREATE; collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.CREATE;
moveCollaborationScreen(Integer.parseInt(collaborationType)); moveCollaborationScreen(Integer.parseInt(collaborationType));
} }
@Override
public void finishCollaboration() throws NetworkDisconnectedException, AcmsException { public void finishCollaboration() throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).finishCollaboration(sid, roomId.intValue()); AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).finishCollaboration(sid, roomId.intValue());
} }
@Override
public void finishAllCollaboration() throws NetworkDisconnectedException, AcmsException { public void finishAllCollaboration() throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).finishAllCollaboration(sid, roomId.intValue()); AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).finishAllCollaboration(sid, roomId.intValue());
} }
@Override
public String getCollaborationJoinFlg() { public String getCollaborationJoinFlg() {
return collaborationJoinFlg.toString(); return collaborationJoinFlg.toString();
} }
@Override public String getStrCollaborationType() {
public String getCollaborationType() { return strCollaborationType;
return collaborationType;
} }
@Override
public String getToMoveGroupId() { public String getToMoveGroupId() {
return groupId; return groupId;
} }
@Override
public void setToMoveGroupId(String moveToGroupId) { public void setToMoveGroupId(String moveToGroupId) {
groupId = moveToGroupId; groupId = moveToGroupId;
} }
@Override
public int createContentView() { public int createContentView() {
finishBeforeContentListActivity(); finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
...@@ -1535,7 +1415,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1535,7 +1415,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
return meetingId.intValue(); return meetingId.intValue();
} }
@Override
public void startContentView() throws InterruptedException { public void startContentView() throws InterruptedException {
finishBeforeContentListActivity(); finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
...@@ -1553,7 +1432,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1553,7 +1432,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
startContentListActivity(false); startContentListActivity(false);
} }
@Override
public void joinMeetingRoom(int newMeetingId) throws InterruptedException { public void joinMeetingRoom(int newMeetingId) throws InterruptedException {
finishBeforeContentListActivity(); finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
...@@ -1570,59 +1448,48 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1570,59 +1448,48 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
startContentListActivity(false); startContentListActivity(false);
} }
@Override
public void startPipMode() { public void startPipMode() {
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build()); enterPictureInPictureMode(mPipBuilder.build());
} }
@Override
public void exitPIPmode() { public void exitPIPmode() {
finishPIPmode(); finishPIPmode();
} }
@Override
public void exitMeetingRoom() { public void exitMeetingRoom() {
exitAndDeleteMeetingRoom(); exitAndDeleteMeetingRoom();
finishPIPmode(); finishPIPmode();
} }
@Override
public int getJoinCollaborationType() { public int getJoinCollaborationType() {
return mCollaborationType; return mCollaborationType;
} }
@Override
public void setJoinCollaborationType(int collaborationType) { public void setJoinCollaborationType(int collaborationType) {
mCollaborationType = collaborationType; mCollaborationType = collaborationType;
} }
@Override
public void changeCollaboration(int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException { public void changeCollaboration(int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).changeCollaboration(sid, roomId.intValue(), changeCollaborationType, meetingId); AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).changeCollaboration(sid, roomId.intValue(), changeCollaborationType, meetingId);
} }
@Override
public void setHostRequestFlg(int hostRequestFlg) { public void setHostRequestFlg(int hostRequestFlg) {
mHostRequestFlg = hostRequestFlg; mHostRequestFlg = hostRequestFlg;
} }
@Override
public int getHostRequestFlg() { public int getHostRequestFlg() {
return mHostRequestFlg; return mHostRequestFlg;
} }
@Override
public void finishPip() { public void finishPip() {
finishPIPmode(); finishPIPmode();
} }
@Override
public void setExitHostAlert() { public void setExitHostAlert() {
needHostAlert = true; needHostAlert = true;
} }
@Override
public boolean getExitHostAlert() { public boolean getExitHostAlert() {
if (needHostAlert) { if (needHostAlert) {
needHostAlert = false; needHostAlert = false;
...@@ -1631,7 +1498,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1631,7 +1498,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
return needHostAlert; return needHostAlert;
} }
@Override
public void updatePreMessage(String messageId) throws NetworkDisconnectedException, AcmsException { public void updatePreMessage(String messageId) throws NetworkDisconnectedException, AcmsException {
if (messageId.equals("0")) { if (messageId.equals("0")) {
return; return;
...@@ -1639,12 +1505,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1639,12 +1505,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
updateMessageFromMessageId(messageId); updateMessageFromMessageId(messageId);
} }
@Override
public String getMessageListFromMessageId(String messageId) { public String getMessageListFromMessageId(String messageId) {
if (messageId.equals("0")) { if (messageId.equals("0")) {
return ""; return "";
} }
String messageListStr = communicationLogic.getMessagesFromMessageId(roomId.intValue(), messageId); return communicationLogic.getMessagesFromMessageId(roomId.intValue(), messageId);
return messageListStr;
} }
} }
...@@ -2,14 +2,12 @@ package jp.agentec.abook.abv.ui.home.view; ...@@ -2,14 +2,12 @@ package jp.agentec.abook.abv.ui.home.view;
import android.content.Context; import android.content.Context;
import android.os.Build; import android.os.Build;
import android.util.Log;
import android.view.View; import android.view.View;
import android.webkit.JavascriptInterface; import android.webkit.JavascriptInterface;
import android.webkit.WebSettings; import android.webkit.WebSettings;
import android.webkit.WebView; import android.webkit.WebView;
import java.io.File; import java.io.File;
import java.util.Map;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants; import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.exception.AcmsException; import jp.agentec.abook.abv.bl.common.exception.AcmsException;
...@@ -18,7 +16,7 @@ import jp.agentec.abook.abv.bl.common.log.Logger; ...@@ -18,7 +16,7 @@ import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic; import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.Interface.ChatRoomEventListener; import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity; import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
...@@ -26,11 +24,12 @@ public class ChatWebView extends WebView { ...@@ -26,11 +24,12 @@ public class ChatWebView extends WebView {
private Context context; private Context context;
private CommunicationLogic communicationLogic; private CommunicationLogic communicationLogic;
private ChatRoomEventListener listener = null; private ChatWebViewActivity chatActivity;
public ChatWebView(Context context) { public ChatWebView(Context context) {
super(context); super(context);
this.context = context; this.context = context;
chatActivity = (ChatWebViewActivity)context;
} }
public void init() { public void init() {
...@@ -70,63 +69,47 @@ public class ChatWebView extends WebView { ...@@ -70,63 +69,47 @@ public class ChatWebView extends WebView {
} }
@JavascriptInterface @JavascriptInterface
public void getLoginParameter() { public void getLoginParameter() {
if (listener == null) {
return;
}
post(new Runnable() { post(new Runnable() {
@Override @Override
public void run() { public void run() {
listener.getLogin(); chatActivity.getLogin();
} }
}); });
} }
@JavascriptInterface @JavascriptInterface
public void getGlobalParameter() { public void getGlobalParameter() {
if (listener == null) {
return;
}
post(new Runnable() { post(new Runnable() {
@Override @Override
public void run() { public void run() {
listener.getQueryParam(); chatActivity.getQueryParam();
} }
}); });
} }
@JavascriptInterface @JavascriptInterface
public void goHome() { public void goHome() {
if (listener == null) {
return;
}
post(new Runnable() { post(new Runnable() {
@Override @Override
public void run() { public void run() {
listener.backToHome(); chatActivity.backToHome();
} }
}); });
} }
@JavascriptInterface @JavascriptInterface
public void openOperationRelatedContent() { public void openOperationRelatedContent() {
if (listener == null) {
return;
}
post(new Runnable() { post(new Runnable() {
@Override @Override
public void run() { public void run() {
listener.showCommonContent(); chatActivity.showCommonContent();
} }
}); });
} }
@JavascriptInterface @JavascriptInterface
public void openCommunication() { public void openCommunication() {
if (listener == null) { chatActivity.showCommunicationChatMenuDialog();
return;
}
listener.showCommunicationChatMenuDialog();
} }
@JavascriptInterface @JavascriptInterface
...@@ -152,19 +135,12 @@ public class ChatWebView extends WebView { ...@@ -152,19 +135,12 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public void saveSelectedUserList(String userIdList) { public void saveSelectedUserList(String userIdList) {
Log.d("userIdList " , userIdList ); chatActivity.setSelectedUserIdList(userIdList);
if (listener == null) {
return;
}
listener.setSelectedUserIdList(userIdList);
} }
@JavascriptInterface @JavascriptInterface
public String getSelectedUserList() { public String getSelectedUserList() {
if (listener == null) { return chatActivity.getSelectedUserList();
return null;
}
return listener.getSelectedUserList();
} }
@JavascriptInterface @JavascriptInterface
...@@ -181,391 +157,266 @@ public class ChatWebView extends WebView { ...@@ -181,391 +157,266 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public void updateRoomList() throws NetworkDisconnectedException, AcmsException { public void updateRoomList() throws NetworkDisconnectedException, AcmsException {
Map<String, Object> chatRoomList; chatActivity.updateRoomList();
if (listener == null) {
return;
}
listener.updateRoomList();
} }
@JavascriptInterface @JavascriptInterface
public void updateMyInfo() throws NetworkDisconnectedException, AcmsException { public void updateMyInfo() throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.updateMyInfo();
return;
}
listener.updateMyInfo();
} }
@JavascriptInterface @JavascriptInterface
public void updateGroupUser() throws NetworkDisconnectedException, AcmsException { public void updateGroupUser() throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.updateGroupUser();
return;
}
listener.updateGroupUser();
} }
@JavascriptInterface @JavascriptInterface
public void createChatRoom(String roomType, String userIdList, String encodedRoomName, String screenFlg, boolean isVoice) throws NetworkDisconnectedException, AcmsException { public void createChatRoom(String roomType, String userIdList, String encodedRoomName, String screenFlg, boolean isVoice) throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.createChatRoom(roomType, userIdList, encodedRoomName, screenFlg, isVoice);
return;
}
listener.createChatRoom(roomType, userIdList, encodedRoomName, screenFlg, isVoice);
} }
@JavascriptInterface @JavascriptInterface
public void changeRoomName(String changeRoomName) throws NetworkDisconnectedException, AcmsException { public void changeRoomName(String changeRoomName) throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.changeRoomName(changeRoomName);
return;
}
listener.changeRoomName(changeRoomName);
} }
@JavascriptInterface @JavascriptInterface
public void joinRoom(String joinRoomId, String joinRoomName) { public void joinRoom(String joinRoomId, String joinRoomName) {
if (listener == null) { chatActivity.joinRoom(joinRoomId, joinRoomName);
return;
} }
listener.joinRoom(joinRoomId, joinRoomName);
}
@JavascriptInterface @JavascriptInterface
public void roomDisplayOff() { public void roomDisplayOff() {
if (listener == null) { chatActivity.roomDisplayOff();
return;
}
listener.roomDisplayOff();
} }
@JavascriptInterface @JavascriptInterface
public void inviteUsers(String userIds, boolean isCollaboration) throws NetworkDisconnectedException, AcmsException { public void inviteUsers(String userIds, boolean isCollaboration) throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.inviteUsers(userIds,isCollaboration);
return;
}
listener.inviteUsers(userIds,isCollaboration);
} }
@JavascriptInterface @JavascriptInterface
public String getRoomType() { public String getRoomType() {
if (listener == null) { return chatActivity.getRoomType();
return null;
}
return listener.getRoomType();
} }
@JavascriptInterface @JavascriptInterface
public String getBeforeRoomType() { public String getBeforeRoomType() {
if (listener == null) { return chatActivity.getBeforeRoomType();
return null;
}
return listener.getBeforeRoomType();
} }
@JavascriptInterface @JavascriptInterface
public void clearBeforeRoomType() { public void clearBeforeRoomType() {
if (listener == null) { chatActivity.clearBeforeRoomType();
return;
}
listener.clearBeforeRoomType();
} }
@JavascriptInterface @JavascriptInterface
public void updateMessages(String roomId) throws NetworkDisconnectedException, AcmsException { public void updateMessages(String roomId) throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.updateMessages(roomId);
return;
}
listener.updateMessages(roomId);
} }
@JavascriptInterface @JavascriptInterface
public String getMessageList(String roomId) { public String getMessageList(String roomId) {
String messageListStr = communicationLogic.getMessages(Integer.parseInt(roomId)); return communicationLogic.getMessages(Integer.parseInt(roomId));
return messageListStr;
} }
@JavascriptInterface @JavascriptInterface
public String searchMessages(String keyword, String userList) { public String searchMessages(String keyword, String userList) {
if (listener == null) { return chatActivity.searchMessages(keyword, userList);
return null;
}
return listener.searchMessages(keyword, userList);
} }
@JavascriptInterface @JavascriptInterface
public String getFavoriteUsers() { public String getFavoriteUsers() {
String favoriteUsersStr = communicationLogic.getFavoriteUsers(); return communicationLogic.getFavoriteUsers();
return favoriteUsersStr;
} }
@JavascriptInterface @JavascriptInterface
public String getFavoriteUsersNotInRoom() { public String getFavoriteUsersNotInRoom() {
if (listener == null) { return chatActivity.getFavoriteUsersNotInRoom();
return null;
}
return listener.getFavoriteUsersNotInRoom();
} }
@JavascriptInterface @JavascriptInterface
public String getMyInfo() { public String getMyInfo() {
String myInfoStr = communicationLogic.getMyInfo(); return communicationLogic.getMyInfo();
return myInfoStr;
} }
@JavascriptInterface @JavascriptInterface
public String getUsersInRoom(String roomId) { public String getUsersInRoom(String roomId) {
String attendUsers = communicationLogic.getUsersInRoom(Integer.parseInt(roomId)); return communicationLogic.getUsersInRoom(Integer.parseInt(roomId));
return attendUsers;
} }
@JavascriptInterface @JavascriptInterface
public String getMyGroupUsers() { public String getMyGroupUsers() {
String myGroupUsersStr = communicationLogic.getMyGroupUsers(); return communicationLogic.getMyGroupUsers();
return myGroupUsersStr;
} }
@JavascriptInterface @JavascriptInterface
public String getMyGroupUsersNotInRoom() { public String getMyGroupUsersNotInRoom() {
if (listener == null) { return chatActivity.getMyGroupUsersNotInRoom();
return null;
}
return listener.getMyGroupUsersNotInRoom();
} }
@JavascriptInterface @JavascriptInterface
public String getMyGroupShopMemberByName(String keyword) { public String getMyGroupShopMemberByName(String keyword) {
String searchUserStr = communicationLogic.getMyGroupUserByName(keyword); return communicationLogic.getMyGroupUserByName(keyword);
return searchUserStr;
} }
@JavascriptInterface @JavascriptInterface
public String getMyGroupShopMemberNotInRoomByName(String keywords) { public String getMyGroupShopMemberNotInRoomByName(String keywords) {
if (listener == null) { return chatActivity.getMyGroupShopMemberNotInRoomByName(keywords);
return null;
}
return listener.getMyGroupShopMemberNotInRoomByName(keywords);
} }
@JavascriptInterface @JavascriptInterface
public String getAllGroupShopMemberByName(String shopMemberName) { public String getAllGroupShopMemberByName(String shopMemberName) {
String searchUserStr = communicationLogic.getAllGroupShopMemberByName(shopMemberName); return communicationLogic.getAllGroupShopMemberByName(shopMemberName);
return searchUserStr;
} }
@JavascriptInterface @JavascriptInterface
public String getAllGroupShopMemberNotInRoomByName(String keywords) { public String getAllGroupShopMemberNotInRoomByName(String keywords) {
if (listener == null) { return chatActivity.getAllGroupShopMemberNotInRoomByName(keywords);
return null;
}
return listener.getAllGroupShopMemberNotInRoomByName(keywords);
} }
@JavascriptInterface @JavascriptInterface
public String getGroupByName(String keyword) { public String getGroupByName(String keyword) {
String searchGroupStr = communicationLogic.getGroupByName(keyword); return communicationLogic.getGroupByName(keyword);
return searchGroupStr;
} }
@JavascriptInterface @JavascriptInterface
public String getFavoriteGroups() { public String getFavoriteGroups() {
String favoriteGroupsStr = communicationLogic.getFavoriteGroups(); return communicationLogic.getFavoriteGroups();
return favoriteGroupsStr;
} }
@JavascriptInterface @JavascriptInterface
public void updateUserInfo(String shopMemberId) throws NetworkDisconnectedException, AcmsException { public void updateUserInfo(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.updateUserInfo(shopMemberId);
return ;
}
listener.updateUserInfo(shopMemberId);
} }
@JavascriptInterface @JavascriptInterface
public String getGroupInfo(String groupId) { public String getGroupInfo(String groupId) {
String groupInfoStr = communicationLogic.getGroupSearchData(Integer.parseInt(groupId)); return communicationLogic.getGroupSearchData(Integer.parseInt(groupId));
return groupInfoStr;
} }
@JavascriptInterface @JavascriptInterface
public String getGroupInfoForAddUser(String groupId) { public String getGroupInfoForAddUser(String groupId) {
if (listener == null) { return chatActivity.getGroupInfoForAddUser(groupId);
return null;
}
return listener.getGroupInfoForAddUser(groupId);
} }
@JavascriptInterface @JavascriptInterface
public String getNameCardData(String shopMemberId) { public String getNameCardData(String shopMemberId) {
String nameCardStr = communicationLogic.getNameCardInfo(Integer.parseInt(shopMemberId)); return communicationLogic.getNameCardInfo(Integer.parseInt(shopMemberId));
return nameCardStr;
} }
@JavascriptInterface @JavascriptInterface
public String getFavoriteGroupsList() { public String getFavoriteGroupsList() {
String favoriteGroupsListStr = communicationLogic.getFavoriteGroups(); return communicationLogic.getFavoriteGroups();
return favoriteGroupsListStr;
} }
@JavascriptInterface @JavascriptInterface
public boolean addFavoriteUser(String shopMemberId) throws AcmsException { public boolean addFavoriteUser(String shopMemberId) throws AcmsException {
if (listener == null) { return chatActivity.addFavoriteUser(shopMemberId);
return false;
}
return listener.addFavoriteUser(shopMemberId);
} }
@JavascriptInterface @JavascriptInterface
public boolean removeFavoriteUser(String shopMemberId) throws AcmsException { public boolean removeFavoriteUser(String shopMemberId) throws AcmsException {
if (listener == null) { return chatActivity.removeFavoriteUser(shopMemberId);
return false;
}
return listener.removeFavoriteUser(shopMemberId);
} }
@JavascriptInterface @JavascriptInterface
public boolean addFavoriteGroup(String groupId) throws AcmsException { public boolean addFavoriteGroup(String groupId) throws AcmsException {
if (listener == null) { return chatActivity.addFavoriteGroup(groupId);
return false;
}
return listener.addFavoriteGroup(groupId);
} }
@JavascriptInterface @JavascriptInterface
public boolean removeFavoriteGroup(String groupId) throws AcmsException { public boolean removeFavoriteGroup(String groupId) throws AcmsException {
if (listener == null) { return chatActivity.removeFavoriteGroup(groupId);
return false;
}
return listener.removeFavoriteGroup(groupId);
} }
@JavascriptInterface @JavascriptInterface
public void updateFavorite() throws NetworkDisconnectedException, AcmsException { public void updateFavorite() throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.updateFavorite();
return;
}
listener.updateFavorite();
} }
@JavascriptInterface @JavascriptInterface
public void updateArchiveList() throws NetworkDisconnectedException, AcmsException { public void updateArchiveList() throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.updateArchiveList();
return;
}
listener.updateArchiveList();
} }
@JavascriptInterface @JavascriptInterface
public String getArchiveList() { public String getArchiveList() {
String archiveListStr = communicationLogic.getAllArchive(); return communicationLogic.getAllArchive();
return archiveListStr;
} }
@JavascriptInterface @JavascriptInterface
public String getArchiveListByName(String keyword) { public String getArchiveListByName(String keyword) {
String archiveListStr = communicationLogic.getArchiveListByName(keyword); return communicationLogic.getArchiveListByName(keyword);
return archiveListStr;
} }
@JavascriptInterface @JavascriptInterface
public String getUserInfo(String shopMemberId) { public String getUserInfo(String shopMemberId) {
String archiveListStr = communicationLogic.getUserInfo(Integer.parseInt(shopMemberId)); return communicationLogic.getUserInfo(Integer.parseInt(shopMemberId));
return archiveListStr;
} }
@JavascriptInterface @JavascriptInterface
public String getUserInfoList(String shopMemberIds) { public String getUserInfoList(String shopMemberIds) {
String userIds = shopMemberIds; return communicationLogic.getUserList(shopMemberIds);
String UserInfoList = communicationLogic.getUserList(shopMemberIds);
return UserInfoList;
} }
@JavascriptInterface @JavascriptInterface
public String getArchiveDetail(String archiveId) { public String getArchiveDetail(String archiveId) {
String archiveListStr = communicationLogic.getArchiveDetail(Integer.parseInt(archiveId)); return communicationLogic.getArchiveDetail(Integer.parseInt(archiveId));
return archiveListStr;
} }
@JavascriptInterface @JavascriptInterface
public void updateArchiveDetail(String archiveId) throws NetworkDisconnectedException, AcmsException { public void updateArchiveDetail(String archiveId) throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.updateArchiveDetail(archiveId);
return;
}
listener.updateArchiveDetail(archiveId);
} }
@JavascriptInterface @JavascriptInterface
public void joinCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException { public void joinCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.joinCollaboration(collaborationType, meetingId);
return;
}
listener.joinCollaboration(collaborationType, meetingId);
} }
@JavascriptInterface @JavascriptInterface
public void joinChangedCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException { public void joinChangedCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.joinChangedCollaboration(collaborationType, meetingId);
return;
}
listener.joinChangedCollaboration(collaborationType, meetingId);
} }
@JavascriptInterface @JavascriptInterface
public void inviteCollaboration(String inviteUserIds, String collaborationType) throws NetworkDisconnectedException, AcmsException { public void inviteCollaboration(String inviteUserIds, String collaborationType) throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.inviteCollaboration(inviteUserIds, collaborationType);
return;
}
listener.inviteCollaboration(inviteUserIds, collaborationType);
} }
@JavascriptInterface @JavascriptInterface
public void startCollaboration(String collaborationType) { public void startCollaboration(String collaborationType) {
if (listener == null) { chatActivity.startCollaboration(collaborationType);
return;
}
listener.startCollaboration(collaborationType);
} }
@JavascriptInterface @JavascriptInterface
public void finishCollaboration() throws NetworkDisconnectedException, AcmsException { public void finishCollaboration() throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.finishCollaboration();
return;
}
listener.finishCollaboration();
} }
@JavascriptInterface @JavascriptInterface
public void finishAllCollaboration() throws NetworkDisconnectedException, AcmsException { public void finishAllCollaboration() throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.finishAllCollaboration();
return;
}
listener.finishAllCollaboration();
} }
@JavascriptInterface @JavascriptInterface
public String getCollaborationJoinFlg() { public String getCollaborationJoinFlg() {
if (listener == null) { return chatActivity.getCollaborationJoinFlg();
return null;
}
return listener.getCollaborationJoinFlg();
} }
@JavascriptInterface @JavascriptInterface
public String getCollaborationType() { public String getCollaborationType() {
if (listener == null) { return chatActivity.getStrCollaborationType();
return null;
}
return listener.getCollaborationType();
} }
@JavascriptInterface @JavascriptInterface
public String getToMoveGroupId() { public String getToMoveGroupId() {
if (listener == null) { return chatActivity.getToMoveGroupId();
return null;
}
return listener.getToMoveGroupId();
} }
@JavascriptInterface @JavascriptInterface
public void setToMoveGroupId(String moveToGroupId) { public void setToMoveGroupId(String moveToGroupId) {
listener.setToMoveGroupId(moveToGroupId); chatActivity.setToMoveGroupId(moveToGroupId);
} }
@JavascriptInterface @JavascriptInterface
...@@ -581,74 +432,47 @@ public class ChatWebView extends WebView { ...@@ -581,74 +432,47 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public int createContentView() { public int createContentView() {
if (listener == null) { return chatActivity.createContentView();
return 0;
}
return listener.createContentView();
} }
@JavascriptInterface @JavascriptInterface
public void startContentView() throws InterruptedException { public void startContentView() throws InterruptedException {
if (listener == null) { chatActivity.startContentView();
return;
}
listener.startContentView();
} }
@JavascriptInterface @JavascriptInterface
public void joinMeetingRoom(int newMeetingId) throws InterruptedException { public void joinMeetingRoom(int newMeetingId) throws InterruptedException {
if (listener == null) { chatActivity.joinMeetingRoom(newMeetingId);
return;
}
listener.joinMeetingRoom(newMeetingId);
} }
@JavascriptInterface @JavascriptInterface
public void startPipMode() { public void startPipMode() {
if (listener == null) { chatActivity.startPipMode();
return;
}
listener.startPipMode();
} }
@JavascriptInterface @JavascriptInterface
public void exitPIPmode() { public void exitPIPmode() {
if (listener == null) { chatActivity.exitPIPmode();
return;
}
listener.exitPIPmode();
} }
@JavascriptInterface @JavascriptInterface
public void exitMeetingRoom() { public void exitMeetingRoom() {
if (listener == null) { chatActivity.exitMeetingRoom();
return;
}
listener.exitMeetingRoom();
} }
@JavascriptInterface @JavascriptInterface
public int getJoinCollaborationType() { public int getJoinCollaborationType() {
if (listener == null) { return chatActivity.getJoinCollaborationType();
return 0;
}
return listener.getJoinCollaborationType();
} }
@JavascriptInterface @JavascriptInterface
public void setJoinCollaborationType(int collaborationType) { public void setJoinCollaborationType(int collaborationType) {
if (listener == null) { chatActivity.setJoinCollaborationType(collaborationType);
return;
}
listener.setJoinCollaborationType(collaborationType);
} }
@JavascriptInterface @JavascriptInterface
public void changeCollaboration(int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException { public void changeCollaboration(int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.changeCollaboration(changeCollaborationType, meetingId);
return;
}
listener.changeCollaboration(changeCollaborationType, meetingId);
} }
@JavascriptInterface @JavascriptInterface
...@@ -666,66 +490,58 @@ public class ChatWebView extends WebView { ...@@ -666,66 +490,58 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public void setHostRequestFlg(int hostRequestFlg) { public void setHostRequestFlg(int hostRequestFlg) {
if (listener == null) { chatActivity.setHostRequestFlg(hostRequestFlg);
return;
}
listener.setHostRequestFlg(hostRequestFlg);
} }
@JavascriptInterface @JavascriptInterface
public int getHostRequestFlg() { public int getHostRequestFlg() {
if (listener == null) { return chatActivity.getHostRequestFlg();
return 0;
}
return listener.getHostRequestFlg();
} }
@JavascriptInterface @JavascriptInterface
public void finishPip() { public void finishPip() {
if (listener == null) { chatActivity.finishPip();
return;
}
listener.finishPip();
} }
@JavascriptInterface @JavascriptInterface
public void setExitHostAlert() { public void setExitHostAlert() {
if (listener == null) { chatActivity.setExitHostAlert();
return;
}
listener.setExitHostAlert();
} }
@JavascriptInterface @JavascriptInterface
public boolean getExitHostAlert() { public boolean getExitHostAlert() {
if (listener == null) { return chatActivity.getExitHostAlert();
return false;
}
return listener.getExitHostAlert();
} }
@JavascriptInterface @JavascriptInterface
public void updatePreMessage(String messageId) throws NetworkDisconnectedException, AcmsException { public void updatePreMessage(String messageId) throws NetworkDisconnectedException, AcmsException {
if (listener == null) { chatActivity.updatePreMessage(messageId);
return;
}
listener.updatePreMessage(messageId);
} }
@JavascriptInterface @JavascriptInterface
public String getMessageListFromMessageId(String messageId) { public String getMessageListFromMessageId(String messageId) {
if (listener == null) { return chatActivity.getMessageListFromMessageId(messageId);
return null; }
@JavascriptInterface
public boolean getDeviceInfo() {
return true;
} }
return listener.getMessageListFromMessageId(messageId);
@JavascriptInterface
public String getServerInfo() {
String json = "{\"chatURL\":\"hoge\", \"cmsURL\":\"fuga\", \"isOnline\": true }";
return json;
} }
public void setChatRoomEventListener(ChatRoomEventListener listener) { @JavascriptInterface
this.listener = listener; public String getMyUserInfo() {
return "hogehoge";
} }
public void removeChatRoomEventListener() { @JavascriptInterface
this.listener = null; public String getRoomInfo() {
return "fugafuga";
} }
public void loadChatViewUrl(final String urlString) { public void loadChatViewUrl(final String urlString) {
......
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