Commit ee0e39b9 by Lee Munkyeong

43094対応

parent 966eb8ed
......@@ -1515,6 +1515,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
@JavascriptInterface
public int createContentView() {
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
Integer meetingId = null;
meetingManager.close();
try {
......@@ -1530,14 +1532,15 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
}
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(true);
return meetingId.intValue();
}
@JavascriptInterface
public void startContentView() {
public void startContentView() throws InterruptedException {
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(false);
meetingManager.close();
try {
connectMeetingServer();
......@@ -1546,31 +1549,32 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
}
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(false);
}
@JavascriptInterface
public void joinMeetingRoom(int newMeetingId) {
public void joinMeetingRoom(int newMeetingId) throws InterruptedException {
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(false);
meetingManager.close();
try {
connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey);
meetingManager.join(newMeetingId, mSkey, roomId.toString(), false);
meetingManager.join(joinMeetingId, mSkey, roomId.toString(), false);
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
}
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(false);
}
@JavascriptInterface
public void startPipMode() {
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
}
@JavascriptInterface
public void exitPIPmode() {
finishPIPmode();
}
@JavascriptInterface
......@@ -1715,12 +1719,12 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
.insertFavoriteGroup(sid, Integer.parseInt(groupId));
return result;
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
private void moveCollaborationScreen(Integer collaborationType) {
if (collaborationType.equals(ABookCommConstants.FLAG.COLLABORATION_TYPE.DOCUMENT) && !isValidVersion()) {
mChatWebView.loadUrl("javascript:alert(getLocalizedString('not_support_version'));");
......@@ -1823,7 +1827,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
mChatWebView.loadUrl("javascript:$('.pip_indicator').removeClass('none');");
} else {
if (isStop) {
exitAndDeleteMeetingRoom();
mChatWebView.loadUrl("javascript:Coview_exitCollaboration();");
Intent intent = new Intent();
intent.setClass(getApplicationContext(), OperationListActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK);
......
......@@ -120,7 +120,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
private long lastDisconnect;
private static Dialog meetingAlertDialog;
private ABVUIActivity previousOfSettingActivity;
private boolean isCollaboration;
// Chat
private ParentWebViewActivity previousOfSettingActivity2;
......@@ -886,7 +886,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
final String cmd = json.getString(MeetingManager.CMD);
final long contentId = JsonUtil.getLong(json, MeetingManager.CONTENTID);
final int pageNumber = JsonUtil.getInt(json, MeetingManager.PAGE_NUMBER);
boolean isCollaboration = false;
isCollaboration = false;
ChatWebViewActivity chatWebViewActivity = getActivity(ChatWebViewActivity.class);
if (chatWebViewActivity != null && chatWebViewActivity.isInPictureInPictureMode()) {
isCollaboration = true;
......@@ -1115,10 +1115,13 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
*/
public boolean checkContent(final long contentId, int page) {
try {
final ContentDto contentDto = contentDao.getContent(contentId);
if (contentDto == null) {
Logger.e(TAG, "Content not found. contentId=" + contentId);
showToast(mContext.getString(R.string.no_content_need_refresh));
if (!isCollaboration) {
showToast(mContext.getString(R.string.no_content_need_refresh));
}
return false;
}
......@@ -1256,36 +1259,43 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
String unAuthorizedContentDownloadMsg = getCurrentActivity().getString(R.string.request_download_un_authorized_content);
final boolean isNoAuthorizedContentDownloadRequest = contentName.equals(unAuthorizedContentDownloadMsg);
downloadConfirmDialog = AlertDialogUtil.createAlertDialog(getCurrentActivity(), R.string.confirm);
downloadConfirmDialog.setCancelable(false);
if (isNoAuthorizedContentDownloadRequest) {
downloadConfirmDialog.setMessage(unAuthorizedContentDownloadMsg);
if (isCollaboration) {
if (isNoAuthorizedContentDownloadRequest) {
downloadUnAuthorizedContentInfo(contentId);
}
downloadContent(contentId);
downloadConfirmDialog = null;
} else {
downloadConfirmDialog.setMessage(String.format(mContext.getString(R.string.no_content2), contentName));
}
downloadConfirmDialog.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
downloadConfirmDialog.dismiss();
//権限の無いコンテンツの場合:コンテンツ情報を先にダウンロード
if (isNoAuthorizedContentDownloadRequest) {
downloadUnAuthorizedContentInfo(contentId);
}
downloadContent(contentId);
downloadConfirmDialog = null;
downloadConfirmDialog = AlertDialogUtil.createAlertDialog(getCurrentActivity(), R.string.confirm);
downloadConfirmDialog.setCancelable(false);
if (isNoAuthorizedContentDownloadRequest) {
downloadConfirmDialog.setMessage(unAuthorizedContentDownloadMsg);
} else {
downloadConfirmDialog.setMessage(String.format(mContext.getString(R.string.no_content2), contentName));
}
});
downloadConfirmDialog.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
downloadConfirmDialog.dismiss();
if (meetingManager.isConnected()) {
meetingManager.setPaused(false);
downloadConfirmDialog.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
downloadConfirmDialog.dismiss();
//権限の無いコンテンツの場合:コンテンツ情報を先にダウンロード
if (isNoAuthorizedContentDownloadRequest) {
downloadUnAuthorizedContentInfo(contentId);
}
downloadContent(contentId);
downloadConfirmDialog = null;
}
downloadConfirmDialog = null;
}
});
});
downloadConfirmDialog.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
downloadConfirmDialog.dismiss();
if (meetingManager.isConnected()) {
meetingManager.setPaused(false);
}
downloadConfirmDialog = null;
}
});
}
}
/**
......@@ -1328,6 +1338,9 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
*/
private void showDownloadConfirm(final long contentId, String contentName) {
createDownloadConfirm(contentId, contentName);
if (isCollaboration) {
return;
}
downloadConfirmDialog.show();
}
......
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