Commit 7362826b by Lee Munkyeong

Merge branch 'communication/develop' of…

Merge branch 'communication/develop' of https://gitlab.agentec.jp/abook_android/abook_check into communication/feature/finish_all_collaboration
parents b2e86c83 6ae3e3c6
Subproject commit 76f2642396962fb9b6e8bb35a2aaa8a9949075d0
Subproject commit b4450c27e35d46a203c6b12e2656baebef9b80bd
......@@ -494,7 +494,7 @@
<string name="ReportReply">報告(回答)</string>
<string name="content_link_update">資料名「%1$s」は更新状態となります。\n更新しますか?</string>
<string name="msg_non_target_meeting_content">遠隔支援中には対象外の資料なので、開けません。</string>
<string name="msg_non_target_collaboration_content">協業中は閲覧できない資料です。</string>
<string name="msg_help_operation_list_list_view">リスト表示に変更できます。</string>
<string name="msg_help_operation_list_panel_view">パネル表示に変更できます。</string>
<string name="msg_help_operation_list_filter">表示する作業の種類を選択できます。</string>
......@@ -1482,6 +1482,10 @@
<string name="msg_confirm_send_host_change">ホスト権限変更の依頼があります。変更しますか?</string>
<string name="msg_confirm_share_image">キャプチャーした写真を共有しますか?</string>
<string name="msg_invite_collaboration">協業に招待されました。</string>
<string name="msg_wait_for_host">ホストが文書を選択中です</string>
<string name="msg_rejected_by_host">ホストの変更依頼は拒否されました。</string>
<string name="msg_invalid_parameters">通信に失敗しました。チャットルームに戻ります。</string>
<!-- 連続作業 -->
<string name="msg_error_all_process_delete">全削除の送信に失敗しました。</string>
<string name="msg_ozd_file_could_not_opened">帳票ファイルを開くことができませんでした。</string>
......
......@@ -497,7 +497,7 @@
<string name="ReportReply">보고(응답)</string>
<string name="content_link_update">자료명[%1$s]는 업데이트 가능한 상태입니다.\n업데이트 하시겠습니까?</string>
<string name="msg_non_target_meeting_content">원격 지원 접속 중에는 열람할 수 없는 자료입니다.</string>
<string name="msg_non_target_collaboration_content">협업중에는 열람할 수 없는 자료입니다.</string>
<string name="msg_help_operation_list_list_view">리스트 표시로 변경 가능합니다.</string>
<string name="msg_help_operation_list_panel_view">패널 표시로 변경 가능합니다.</string>
<string name="msg_help_operation_list_filter">표시할 작업의 종류를 선택 가능합니다.</string>
......@@ -1490,4 +1490,7 @@
<string name="msg_confirm_send_host_change">방장 권한을 전달 받으시겠습니까?</string>
<string name="msg_confirm_share_image">캡쳐한 사진을 공유 하시겠습니까?</string>
<string name="msg_invite_collaboration">협업에 초대되셨습니다.</string>
<string name="msg_wait_for_host">호스트가 문서를 선택중입니다.</string>
<string name="msg_rejected_by_host">호스트가 요청을 거절하셨습니다.</string>
<string name="msg_invalid_parameters">통신에 실패했습니다. 채팅룸으로 돌아갑니다.</string>
</resources>
\ No newline at end of file
......@@ -501,7 +501,7 @@
<string name="ReportReply">ReportReply</string>
<string name="content_link_update">The document name [%1$s] will be updated. \nDo you want to update it?</string>
<string name="msg_non_target_meeting_content">It is the document that can not be read during distance support connection.</string>
<string name="msg_non_target_collaboration_content">It is the document that can not be read during collaboration.</string>
<string name="msg_help_operation_list_list_view">You can change to list display.</string>
<string name="msg_help_operation_list_panel_view">You can change to panel display.</string>
<string name="msg_help_operation_list_filter">You can select the type of work to be displayed.</string>
......@@ -1487,4 +1487,7 @@
<string name="msg_confirm_send_host_change">Do you want to receive host permissions?</string>
<string name="msg_confirm_share_image">Do you want to share captured image?</string>
<string name="msg_invite_collaboration">You are invited to collaboration.</string>
<string name="msg_wait_for_host">Please wait for selecting document by host</string>
<string name="msg_rejected_by_host">Rejected host request.</string>
<string name="msg_invalid_parameters">Communication failed. Return to the chat room.</string>
</resources>
......@@ -16,6 +16,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/related_content_third_linear"
android:orientation="vertical" >
<FrameLayout
......
......@@ -17,6 +17,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/related_content_third_linear"
android:orientation="vertical">
<FrameLayout
......
......@@ -572,7 +572,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return;
}
textView.setVisibility(View.GONE);
if (isVisible) {
if (isVisible && !isCollaboration) {
if (meetingManager.isConnected() && meetingManager.isOwner()) {
textView.setVisibility(View.VISIBLE);
CommonExecutor.execute(new Runnable() {
......
......@@ -61,6 +61,8 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Stack;
import java.util.Timer;
import java.util.TimerTask;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.ArchiveDetailJSON;
......@@ -147,6 +149,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private String mSkey;
private Integer joinMeetingId;
private boolean isPIP;
private boolean isStop;
private String encodedFilePath;
private Uri encodedVideoPath;
......@@ -383,6 +386,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
mChatWebView.loadUrl("javascript:$('#userNameCardInCollaboration').modal('hide');");
result.confirm();
return true;
} else if (message.contains("REJECT for owner user")) {
mChatWebView.loadUrl("javascript:$('#userNameCardInCollaboration').modal('hide');");
mChatWebView.loadUrl("javascript:$('#hostRequestModal').modal('hide');");
mChatWebView.loadUrl("javascript:$('#userNameCardInCollaboration').modal('hide');");
message = getString(R.string.msg_rejected_by_host);
} else if (message.contains("Invalid Parameters")) {
message = getString(R.string.msg_invalid_parameters);
}
final String tempMessage = message;
......@@ -406,6 +416,12 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} else if (tempMessage.equals(getString(R.string.msg_error_chat_join))) {
getLogin();
finish();
} else if (tempMessage.equals(getString(R.string.msg_invalid_parameters))) {
if (roomId != null) {
mChatWebView.loadUrl(String.format("javascript:CHAT_UI.joinRoom('%s', '%s');", roomId.toString(), roomName.toString()));
} else {
mChatWebView.loadUrl(CHAT_PAGE_URL);
}
}
}
});
......@@ -442,7 +458,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} else if (message.equals("캡쳐한 사진을 공유 하시겠습니까?")) {
message = getString(R.string.msg_confirm_share_image);
}
ABookAlertDialog confirmAlert = AlertDialogUtil.createAlertDialog(ChatWebViewActivity.this, R.string.app_name);
final ABookAlertDialog confirmAlert = AlertDialogUtil.createAlertDialog(ChatWebViewActivity.this, R.string.app_name);
confirmAlert.setMessage(message);
if (message.equals(getString(R.string.msg_error_already_exist_same_room))) {
......@@ -1504,6 +1520,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 {
......@@ -1519,14 +1537,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();
......@@ -1535,31 +1554,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
......@@ -1704,12 +1724,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'));");
......@@ -1811,6 +1831,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
if (isInPictureInPictureMode) {
mChatWebView.loadUrl("javascript:$('.pip_indicator').removeClass('none');");
} else {
if (isStop) {
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);
startActivity(intent, NaviConsts.Left);
}
mChatWebView.loadUrl("javascript:$('.pip_indicator').addClass('none');");
if (!meetingManager.isConnected()) {
mChatWebView.loadUrl("javascript:$('.start_pip_btn').addClass('none');");
......@@ -1818,6 +1845,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
}
}
// 共通資料画面表示
private void showCommonContent() {
Intent intent = new Intent();
......@@ -1877,6 +1905,21 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
}
@Override
protected void onResume() {
isStop = false;
super.onResume();
if (mChatWebView.getUrl() != null && mChatWebView.getUrl().equals(CHAT_ROOM_PAGE_URL)) {
mChatWebView.loadUrl("javascript:CHAT_SOCKET.socketCheck();");
}
}
@Override
protected void onStop() {
isStop = true;
super.onStop();
}
@Override
public void onDestroy(){
exitAndDeleteMeetingRoom();
super.onDestroy();
......
......@@ -2,10 +2,15 @@ package jp.agentec.abook.abv.ui.home.activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
......@@ -66,6 +71,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
private List<CategoryContentDto> mOperationContentList;
private LinearLayout mToolbar;
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
TextView mWaitOwnerTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -304,7 +310,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
public void run() {
final ABookAlertDialog nonTargetMeetingContentDialog = AlertDialogUtil.createAlertDialog(OperationRelatedContentActivity.this, R.string.app_name);
nonTargetMeetingContentDialog.setCancelable(false);
nonTargetMeetingContentDialog.setMessage(R.string.msg_non_target_meeting_content);
nonTargetMeetingContentDialog.setMessage(isCollaboration? R.string.msg_non_target_meeting_content : R.string.msg_non_target_meeting_content);
nonTargetMeetingContentDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
......@@ -501,7 +507,11 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
}
}
}
mAllSaveButton.setVisibility(visible);
if (isCollaboration) {
mAllSaveButton.setVisibility(isCollaborationOwner ? visible : View.GONE);
} else {
mAllSaveButton.setVisibility(visible);
}
}
});
}
......@@ -511,16 +521,19 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
activityHandlingHelper.removeContentViewActivity(activityHandlingHelper.getContentViewActivity());
hideBottomToolbar();
if (isCollaborationOwner) {
closeProgressPopup();
hideWaitOwnerSelect();
showContentList();
mAllSaveButton.setVisibility(View.VISIBLE);
} else {
showProgressPopup();
showWaitOwnerSelect();
hideContentList();
mAllSaveButton.setVisibility(View.GONE);
}
} else {
closeProgressPopup();
hideWaitOwnerSelect();
showBottomToolbar();
showContentList();
mAllSaveButton.setVisibility(View.VISIBLE);
}
}
......@@ -543,4 +556,31 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
public void onClickSetting(View v) {
showSetting();
}
public void showWaitOwnerSelect() {
if (mWaitOwnerTextView != null) {
mWaitOwnerTextView.setVisibility(View.VISIBLE);
return;
}
Display display = getWindowManager().getDefaultDisplay();
DisplayMetrics outMetrics = new DisplayMetrics ();
display.getMetrics(outMetrics);
LinearLayout container = (LinearLayout) findViewById(R.id.related_content_third_linear);
mWaitOwnerTextView = new TextView(this);
mWaitOwnerTextView.setText(getString(R.string.msg_wait_for_host));
mWaitOwnerTextView.setGravity(Gravity.CENTER);
mWaitOwnerTextView.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
LinearLayout mainLayout = (LinearLayout) findViewById(R.id.related_content_main_linear);
mWaitOwnerTextView.setHeight((int) (outMetrics.heightPixels / 2));
mWaitOwnerTextView.setTextSize(20);
mWaitOwnerTextView.setTextColor(Color.BLACK);
container.addView(mWaitOwnerTextView);
mWaitOwnerTextView.setVisibility(View.VISIBLE);
}
public void hideWaitOwnerSelect() {
if (mWaitOwnerTextView != null) {
mWaitOwnerTextView.setVisibility(View.GONE);
}
}
}
......@@ -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,8 +886,12 @@ 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);
if (cmd.equals(MeetingManager.CMD_MEETINGINFO)) { // 入室結果
isCollaboration = false;
ChatWebViewActivity chatWebViewActivity = getActivity(ChatWebViewActivity.class);
if (chatWebViewActivity != null && chatWebViewActivity.isInPictureInPictureMode()) {
isCollaboration = true;
}
if (cmd.equals(MeetingManager.CMD_MEETINGINFO) && !isCollaboration) { // 入室結果
showToast(mContext.getString(meetingManager.isOwner() ? R.string.msg_enter_as_publisher : R.string.msg_enter_as_subscriber));
return;
}
......@@ -1111,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;
}
......@@ -1252,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;
}
});
}
}
/**
......@@ -1324,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();
}
......
......@@ -710,6 +710,11 @@ public class ContentViewActivity extends ABVContentViewActivity {
setToolbarVisableForTask(true);
}
}
if (isCollaboration) {
mPageNumberLayout.setVisibility(View.GONE);
mSeekBarLayout.setVisibility(View.GONE);
}
}
private void configureSize() {
......@@ -949,6 +954,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
});
if (isCollaboration) {
titleTxt.setVisibility(View.GONE);
pauseBtn.setVisibility(View.GONE);
exitMeetingBtn.setVisibility(View.GONE);
exitBtn.setVisibility(View.GONE);
......@@ -1411,6 +1417,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
marking.setVisibility(View.GONE);
bookmark.setVisibility(View.GONE);
subMenuBtn.setVisibility(View.GONE);
tvContentTitle.setVisibility(View.GONE);
}
}
......@@ -1780,6 +1787,12 @@ public class ContentViewActivity extends ABVContentViewActivity {
// ページ番号を表示する
setCurrentPageNumber();
}
if (isCollaboration) {
mPageNumberLayout.setVisibility(View.GONE);
mSeekBarLayout.setVisibility(View.GONE);
bookmark.setVisibility(View.GONE);
}
}
else {
if (hasMultiPages) {
......@@ -1882,7 +1895,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
} else {
TranslateAnimation toolBarAnimation;
if (mToolBar.getVisibility() == View.GONE) {
if (mToolBar.getVisibility() == View.GONE && !(meetingManager.isSubscribed() && isCollaboration)) {
setToolbarVisable(true);
toolBarAnimation = new TranslateAnimation(0, 0, -mToolBar.getHeight(), 0);
Logger.d(TAG, "[singleTapMotion]:[mToolBar]:VISIBLE");
......
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