Commit e0c76faf by onuma

#44068 文書協業接続時にホストが終了した場合、Android端末のみPIPモード時にその画面にチャットルーム画面が表示

parent 3e35d71b
...@@ -115,6 +115,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -115,6 +115,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
private boolean startPIP = false; // PIPモードを開始していたらtrue; private boolean startPIP = false; // PIPモードを開始していたらtrue;
private boolean needFinishOnStop = false; // ×ボタンでPIP閉じた時用 private boolean needFinishOnStop = false; // ×ボタンでPIP閉じた時用
private boolean isStop; private boolean isStop;
private boolean doneOnStopEvent = false;
private String collaborationType = null;
private String meetingId = null;
private String encodedFilePath; private String encodedFilePath;
private MeetingManager meetingManager = MeetingManager.getInstance(); private MeetingManager meetingManager = MeetingManager.getInstance();
...@@ -410,7 +414,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -410,7 +414,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} }
}); });
myAlertDialog = dialog; //myAlertDialog = dialog; TODO: ダイアログの表示タイミングの調整が必要。
if (!isFinishing() && !message.equals("false")) { if (!isFinishing() && !message.equals("false")) {
dialog.show(); dialog.show();
} }
...@@ -586,11 +590,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -586,11 +590,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
mChatWebView.refreshForOnline(); mChatWebView.refreshForOnline();
if ( if (
mChatWebView.getUrl() != null && mChatWebView.getUrl() != null &&
(mChatWebView.getUrl().equals(ABookCommConstants.CHAT_ROOM_PAGE_URL) || (mChatWebView.getUrl().equals(ABookCommConstants.CHAT_ROOM_PAGE_URL) ||
mChatWebView.getUrl().equals(ABookCommConstants.CHAT_PAGE_URL) || mChatWebView.getUrl().equals(ABookCommConstants.CHAT_PAGE_URL) ||
mChatWebView.getUrl().equals(ABookCommConstants.CONTACT_URL) || mChatWebView.getUrl().equals(ABookCommConstants.CONTACT_URL) ||
mChatWebView.getUrl().equals(ABookCommConstants.ARCHIVE_URL) || mChatWebView.getUrl().equals(ABookCommConstants.ARCHIVE_URL) ||
mChatWebView.getUrl().indexOf(ABookCommConstants.ARCHIVE_DETAIL_URL) != -1) mChatWebView.getUrl().indexOf(ABookCommConstants.ARCHIVE_DETAIL_URL) != -1)
) { ) {
mChatWebView.windowReload(); mChatWebView.windowReload();
} }
...@@ -801,6 +805,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -801,6 +805,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
startActivity(intent, NaviConsts.Left); startActivity(intent, NaviConsts.Left);
} }
/**
* 以前の関連資料(共通)の画面を終了する
*/
public void finishBeforeContentListActivity() { public void finishBeforeContentListActivity() {
OperationRelatedContentActivity beforeActiryty = activityHandlingHelper.getActivity(OperationRelatedContentActivity.class); OperationRelatedContentActivity beforeActiryty = activityHandlingHelper.getActivity(OperationRelatedContentActivity.class);
if (beforeActiryty != null) { if (beforeActiryty != null) {
...@@ -811,15 +818,16 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -811,15 +818,16 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
/** /**
* PIPモードから元にもどる * PIPモードから元にもどる
*/ */
public void finishPIPmode() { public void finishPIPMode() {
if (!isPIP) { if (!isPIP) {
return; return;
} }
if (startPIP) { if (startPIP) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClass(this, ChatWebViewActivity.class); intent.setClass(this, ChatWebViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplication().startActivity(intent); getApplication().startActivity(intent);
collaborationType = Integer.toString(0);
startPIP = false; startPIP = false;
} }
} }
...@@ -838,6 +846,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -838,6 +846,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
public void startContentListActivity(boolean isOwner) { public void startContentListActivity(boolean isOwner) {
Activity targetActivity = activityHandlingHelper.getCurrentActivity(); Activity targetActivity = activityHandlingHelper.getCurrentActivity();
OperationRelatedContentActivity beforeActiryty = activityHandlingHelper.getActivity(OperationRelatedContentActivity.class);
if (beforeActiryty != null) {
// すでにあるなら作らない。
return;
}
if (targetActivity instanceof ChatWebViewActivity) { if (targetActivity instanceof ChatWebViewActivity) {
Stack<ABVAuthenticatedActivity> stack = activityHandlingHelper.getCurrentActivityStack(); Stack<ABVAuthenticatedActivity> stack = activityHandlingHelper.getCurrentActivityStack();
if (stack.size() > 1){ if (stack.size() > 1){
...@@ -873,7 +886,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -873,7 +886,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
.getInstance(ABVEnvironment.getInstance().networkAdapter) .getInstance(ABVEnvironment.getInstance().networkAdapter)
.deleteFavoriteGroup(chatData.sid, Integer.parseInt(groupId)); .deleteFavoriteGroup(chatData.sid, Integer.parseInt(groupId));
if (!result) { return false; } if (!result) {
return false;
}
List<Integer> deleteFavoriteList = new ArrayList<Integer>(); List<Integer> deleteFavoriteList = new ArrayList<Integer>();
deleteFavoriteList.add(Integer.parseInt(groupId)); deleteFavoriteList.add(Integer.parseInt(groupId));
...@@ -885,16 +900,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -885,16 +900,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) { public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) {
isPIP = isInPictureInPictureMode; isPIP = isInPictureInPictureMode;
if (isInPictureInPictureMode) { if (isInPictureInPictureMode) {
// true になったら、PIPのインディケーターを消す
mChatWebView.removePIPIndicator(); mChatWebView.removePIPIndicator();
return; return;
} }
if (isStop) {
if (doneOnStopEvent) {
mChatWebView.exitCollaboration(); mChatWebView.exitCollaboration();
Intent intent = new Intent();
Activity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity();
intent.setClass(currentActivity, OperationListActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent, NaviConsts.Left);
} }
mChatWebView.addPIPIndicator(); mChatWebView.addPIPIndicator();
if (!meetingManager.isConnected()) { if (!meetingManager.isConnected()) {
...@@ -1005,7 +1017,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1005,7 +1017,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
@Override @Override
protected void onResume() { protected void onResume() {
isStop = false; doneOnStopEvent = false; // activity動いている
super.onResume(); super.onResume();
if (mChatWebView.getUrl() != null && mChatWebView.getUrl().equals(ABookCommConstants.CHAT_ROOM_PAGE_URL)) { if (mChatWebView.getUrl() != null && mChatWebView.getUrl().equals(ABookCommConstants.CHAT_ROOM_PAGE_URL)) {
mChatWebView.socketCheck(); mChatWebView.socketCheck();
...@@ -1014,9 +1026,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1014,9 +1026,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
@Override @Override
protected void onStop() { protected void onStop() {
isStop = true;
super.onStop(); super.onStop();
doneOnStopEvent = true; // activity 停止
if (needFinishOnStop) { if (needFinishOnStop) {
try { try {
chatData.finishCollaboration(); chatData.finishCollaboration();
...@@ -1039,6 +1052,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1039,6 +1052,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
unregisterReceiver(receiver); unregisterReceiver(receiver);
receiver = null; receiver = null;
} }
finishBeforeContentListActivity();
} }
@Override @Override
...@@ -1125,7 +1139,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1125,7 +1139,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} }
public void joinRoom(String joinRoomId, String joinRoomName) { public void joinRoom(String joinRoomId, String joinRoomName) {
chatData.joinRoom(joinRoomId,joinRoomName); if (!StringUtil.isNullOrEmpty(this.collaborationType) && !StringUtil.isNullOrEmpty(this.meetingId)
&& this.collaborationType.equals(Integer.toString(ABookCommConstants.FLAG.COLLABORATION_TYPE.DOCUMENT))) {
if (startPIP) {
finishPIPMode();
}
}
chatData.joinRoom(joinRoomId, joinRoomName);
mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL); mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL);
} }
...@@ -1325,16 +1345,16 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1325,16 +1345,16 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} }
public void exitPIPmode() { public void exitPIPmode() {
finishPIPmode(); finishPIPMode();
} }
public void exitMeetingRoom() { public void exitMeetingRoom() {
exitAndDeleteMeetingRoom(); exitAndDeleteMeetingRoom();
finishPIPmode(); finishPIPMode();
} }
public void finishPIP() { public void finishPIP() {
finishPIPmode(); finishPIPMode();
} }
public void setExitHostAlert() { public void setExitHostAlert() {
...@@ -1350,6 +1370,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1350,6 +1370,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} }
public void joinCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException { public void joinCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException {
this.collaborationType = collaborationType;
this.meetingId = meetingId;
chatData.joinCollaboration(collaborationType, meetingId); chatData.joinCollaboration(collaborationType, meetingId);
moveCollaborationScreen(Integer.parseInt(collaborationType)); moveCollaborationScreen(Integer.parseInt(collaborationType));
} }
......
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