Commit fc73015e by Lee Munkyeong

文書協業実装

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