Commit fc73015e by Lee Munkyeong

文書協業実装

parent 799dc91c
......@@ -28,6 +28,7 @@ import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.RequiresApi;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.webkit.CookieManager;
......@@ -583,16 +584,6 @@ public class ChatWebviewActivity extends CommunicationWebViewActivity {
}
}
@Override
public void onDestroy(){
super.onDestroy();
if (receiver != null) {
unregisterReceiver(receiver);
receiver = null;
}
}
// 下辺のツールバー設定
private void settingBottomToolbar() {
// ホームボタン活性化
......@@ -1382,7 +1373,7 @@ public class ChatWebviewActivity extends CommunicationWebViewActivity {
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
}
finishBeforeCOntentListActiviry();
finishBeforeContentListActiviry();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(true);
......@@ -1401,7 +1392,7 @@ public class ChatWebviewActivity extends CommunicationWebViewActivity {
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
}
finishBeforeCOntentListActiviry();
finishBeforeContentListActiviry();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(false);
......@@ -1416,15 +1407,7 @@ public class ChatWebviewActivity extends CommunicationWebViewActivity {
@JavascriptInterface
public void exitMeetingRoom() {
if (meetingManager.isConnected() && meetingManager.isOwner()) {
try {
meetingManager.deleteMeeting();
} catch (Exception e) {
Logger.e(TAG, "showMeetingExitDialog deleteMeeting error", e);
}
}
meetingManager.close();
handlingHelper.saveMeetingInfo(null, null, null, false);
exitMettingRoom();
}
}
......@@ -1433,19 +1416,33 @@ public class ChatWebviewActivity extends CommunicationWebViewActivity {
*/
private void backToHome() {
mChatWebView.loadUrl("javascript:CHAT.leaveRoom()");
exitMettingRoom();
finish();
Intent intent = new Intent();
intent.setClass(ChatWebviewActivity.this, OperationListActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent, NaviConsts.Left);
}
private void finishBeforeCOntentListActiviry() {
private void finishBeforeContentListActiviry() {
OperationRelatedContentActivity beforeActiryty = activityHandlingHelper.getActivity(OperationRelatedContentActivity.class);
if (beforeActiryty != null) {
beforeActiryty.finish();
}
}
public void exitMettingRoom() {
if (meetingManager.isConnected() && meetingManager.isOwner()) {
try {
meetingManager.deleteMeeting();
} catch (Exception e) {
Logger.e(TAG, "showMeetingExitDialog deleteMeeting error", e);
}
}
meetingManager.close();
handlingHelper.saveMeetingInfo(null, null, null, false);
}
private void startContentListActivity(boolean isOwner) {
Activity targetActivity = activityHandlingHelper.getCurrentActivity();
if (targetActivity instanceof ChatWebviewActivity) {
......@@ -1698,4 +1695,35 @@ public class ChatWebviewActivity extends CommunicationWebViewActivity {
}
}
@Override
public void onDestroy(){
exitMettingRoom();
super.onDestroy();
if (receiver != null) {
unregisterReceiver(receiver);
receiver = null;
}
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
boolean eventPrevent = false;
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
backToHome();
eventPrevent = true;
}
return eventPrevent;
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onPause() {
super.onPause();
}
}
......@@ -15,6 +15,7 @@ import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
......@@ -29,6 +30,7 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.websocket.MeetingManager;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVAuthenticatedActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
......@@ -509,11 +511,17 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
@Override
public void onResume() {
Logger.i(TAG, "onResume:start");
Stack<ABVAuthenticatedActivity> stack = activityHandlingHelper.getCurrentActivityStack();
super.onResume();
if (isCollaboration) {
hideBottomToolbar();
if (!isCollaborationOwner) {
showProgressPopup();
hideContentList();
MeetingManager meetingManager = MeetingManager.getInstance();
if (!meetingManager.isConnected()) {
backToHome();
}
}
} else {
showBottomToolbar();
......
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