Commit 0cd2a8de by onuma

不要なコードを削除した

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