Commit e0c76faf by onuma

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

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