Commit bf210b59 by onuma

Merge branch 'communication/develop' into communication/develop_44459

parents 24a1b706 e1d1f60d
......@@ -1500,4 +1500,5 @@
<string name="msg_error_favorites_100_over">お気に入りは最大100件までです。</string>
<string name="msg_eroor_network_offline">接続しているネットワークがありません。</string>
<string name="msg_error_connection_error_meeting_room">会議室サーバに接続できませんでした。</string>
<string name="msg_fail_collaboration_not_action_allow">文書協業中には利用できない機能です。</string>
</resources>
......@@ -1505,4 +1505,5 @@
<string name="msg_error_favorites_100_over">즐겨찾기는 최대 100개까지 입니다.</string>
<string name="msg_eroor_network_offline">연결된 네트워크가 없습니다.</string>
<string name="msg_error_connection_error_meeting_room">회의실 서버에 연결할 수 없습니다.</string>
<string name="msg_fail_collaboration_not_action_allow">문서협업 중에는 이용할 수 없는 기능입니다.</string>
</resources>
\ No newline at end of file
......@@ -1501,4 +1501,5 @@
<string name="msg_error_favorites_100_over">You can have up to 100 favorites.</string>
<string name="msg_eroor_network_offline">There is no network connected.</string>
<string name="msg_error_connection_error_meeting_room">Could not connect to the meeting room server.</string>
<string name="msg_fail_collaboration_not_action_allow">This function cannot be used during document collaboration.</string>
</resources>
......@@ -113,6 +113,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
*/
private void showChatRoomPopupMessage(Map<String, String> messageMap) {
String messageBody = messageMap.get(AppDefType.PushMessageKey.message);
Logger.d("messageBody = " + messageBody);
PushMessageJSON json;
if (StringUtil.isNullOrEmpty(messageBody)) {
return;
......@@ -120,14 +121,6 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
json = new PushMessageJSON(messageBody);
Activity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity();
if (currentActivity.getClass().equals(ChatWebViewActivity.class)) {
ChatWebViewActivity chatWebViewActivity = (ChatWebViewActivity) currentActivity;
if (chatWebViewActivity.getRoomID().equals(json.getRoomId())) {
// push messageと同じ部屋にいる場合はpushmessageを送信しない。
return;
}
}
String baseActivityName = currentActivity.getClass().getName();
if (currentActivity.getClass().equals(HTMLWebViewActivity.class) ||
currentActivity.getClass().equals(ContentViewActivity.class) ||
......
......@@ -1319,10 +1319,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// 協業
String messageText = json.getMessage();
if (json.isCollaboration()) {
messageText = getString(R.string.msg_invite_collaboration);
}
Intent pushMsgDialog = new Intent(context, ShowPushMessageDailogActivity.class);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, messageText);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, json.getData());
......
......@@ -124,24 +124,31 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
isMeetingRoomConnected = MeetingManager.getInstance().isConnected();
isCollabration = MeetingManager.getInstance().isCollaboration();
Bundle extras = getIntent().getExtras();
if (extras != null && !isMeetingRoomConnected) {
boolean isNewVersion = extras.getBoolean(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen);
if (isNewVersion) {
setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK, getIntent());
} else {
moveChatRoom(extras);
}
finish();
}
if (isMeetingRoomConnected || isCollabration) {
showCannotMoveChatRoomDialog();
} else {
if (extras != null) {
boolean isNewVersion = extras.getBoolean(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen);
if (isNewVersion) {
setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK, getIntent());
} else {
moveChatRoom(extras);
}
}
}
dialog.dismiss();
}
});
alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.CANCEL, getIntent());
dialog.dismiss();
}
});
alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
finish();
}
});
......@@ -161,15 +168,20 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
String collaborationType = extras.getString(AppDefType.ChatPushMessageKey.collaborationType);
String roomType = extras.getString(AppDefType.ChatPushMessageKey.roomType);
if (roomId > 0 && !StringUtil.isNullOrEmpty(roomName)) {
if (StringUtil.isNullOrEmpty(collaborationType)) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName, ChatWebViewActivity.class.getName(),"");
ChatWebViewActivity chatWebViewActivity= activityHandlingHelper.getChatWebViewActivity();
if (chatWebViewActivity != null) {
chatWebViewActivity.reloadRoomViewCollaboration(roomId, roomName, collaborationType);
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId,
roomName,
collaborationType,
roomType,
ChatWebViewActivity.class.getName(),
"");
if (StringUtil.isNullOrEmpty(collaborationType)) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName, ChatWebViewActivity.class.getName(),"");
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId,
roomName,
collaborationType,
roomType,
ChatWebViewActivity.class.getName(),
"");
}
}
}
}
......
......@@ -820,20 +820,18 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
if (startPIP) {
Intent intent = new Intent();
intent.setClass(this, ChatWebViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra(ABookCommConstants.KEY.SID, chatData.sid);
intent.putExtra(ABookCommConstants.KEY.ROOM_ID, chatData.roomId);
intent.putExtra(ABookCommConstants.KEY.ROOM_NAME, chatData.roomName);
intent.putExtra(ABookCommConstants.KEY.ROOM_TYPE, chatData.roomType);
intent.putExtra(ABookCommConstants.KEY.LOGIN_ID, chatData.loginId);
intent.putExtra(ABookCommConstants.KEY.SHOP_NAME, chatData.shopName);
intent.putExtra(ABookCommConstants.KEY.COLLABORATION_TYPE, chatData.getStrCollaborationType());
intent.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, baseActivityName);
getApplication().startActivity(intent);
activityHandlingHelper.getCurrentActivity().startActivity(intent);
collaborationType = Integer.toString(0);
startPIP = false;
finish();
}
}
......@@ -1353,6 +1351,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
public void exitMeetingRoom() {
exitAndDeleteMeetingRoom();
finishPIPMode();
//関連資料画面閉じる
ActivityHandlingHelper.getInstance().finishCollaborationOperationRelatedContentActivity();
}
public void finishPIP() {
......@@ -1389,4 +1389,17 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
// 最後のチャットのルーム
PreferenceUtil.putUserPref(getApplicationContext(), AppDefType.UserPrefKey.CHAT_LAST_ROOMID, roomId);
}
/**
* プッシュメッセージ受信し、既にChatWebViewActivityが表示中の時、WebViewリロードする。
* @param roomId ルームID
* @param roomName ルーム名
* @param collaborationType 協業タイプ
*/
public void reloadRoomViewCollaboration(Long roomId, String roomName, String collaborationType) {
chatData.roomId = roomId;
chatData.roomName = roomName;
chatData.setStrCollaborationType(collaborationType);
registChatRoomPageLoader();
}
}
......@@ -851,6 +851,20 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
}
/**
* 文書協業用の関連資料画面を閉じる
*/
public void finishCollaborationOperationRelatedContentActivity() {
if (!currentActivityStack.isEmpty()) {
for (ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof OperationRelatedContentActivity) {
activity.finish();
break;
}
}
}
}
public Stack<ABVAuthenticatedActivity> getCurrentActivityStack() {
return currentActivityStack;
}
......@@ -1871,6 +1885,20 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
/**
* 使用中のChatWebViewActivityを返す
* @return 使用中のChatWebViewActivity
*/
public ChatWebViewActivity getChatWebViewActivity() {
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof ChatWebViewActivity) {
return (ChatWebViewActivity)activity;
}
}
}
return null;
}
/**
* 設定画面から戻る用
* @return 設定画面へ遷移前の画面
*/
......
......@@ -2139,16 +2139,19 @@ public class ContentViewActivity extends ABVContentViewActivity {
ContentLogUtil.getInstance().contentPageMove(contentId, readingLogId, currentPageNumber, nextPageNumber);
if (contentsBgmFlg && !StringUtil.isNullOrEmpty(contentsBgmFilePath) && !contentBGMPlayer.isPlaying()) {
//contentsBgmFilePath
contentBGMPlayer = new ABVMediaPlayer(true);
try {
Logger.v(TAG, "[addMusic]:MediaPlayer Content BGM");
contentBGMPlayer.setDataSource(contentsBgmFilePath);
contentBGMPlayer.prepare();
contentBGMPlayer.start();
} catch (IOException e) {
Logger.e(TAG, "Can't play content BGM",e);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT);
//文書協業接続中にはコンテンツBGM再生しない
if (!isCollaboration) {
//contentsBgmFilePath
contentBGMPlayer = new ABVMediaPlayer(true);
try {
Logger.v(TAG, "[addMusic]:MediaPlayer Content BGM");
contentBGMPlayer.setDataSource(contentsBgmFilePath);
contentBGMPlayer.prepare();
contentBGMPlayer.start();
} catch (IOException e) {
Logger.e(TAG, "Can't play content BGM", e);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT);
}
}
}
......@@ -2638,7 +2641,13 @@ public class ContentViewActivity extends ABVContentViewActivity {
private void handleAction(ActionButton actionButton, PageObjectJSON pageObject) {
ActionInfoJSON actionInfoJSON = pageObject.getActionInfo();
int pageNumber = pageObject.getPageNumber();
//文書協業接続時、機能制限する(動作再生、音声再生)
if (actionInfoJSON.getActionType() == ActionInfoJSON.VIDEO_ACTION ||
actionInfoJSON.getActionType() == ActionInfoJSON.MUSIC_ACTION) {
if (isCollaborationConnected()) {
return;
}
}
if (meetingManager.isSendable()
&& actionInfoJSON.getActionType() != ActionInfoJSON.EMAIL_ACTION
&& actionInfoJSON.getActionType() != ActionInfoJSON.CONTENTLINK_ACTION) { // リモート送信(メール・コンテンツリンクを除く)
......@@ -2867,16 +2876,19 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
// BGM
if (contentsBgmFlg && !StringUtil.isNullOrEmpty(contentsBgmFilePath) && !contentBGMPlayer.isPlaying()) {
//contentsBgmFilePath
contentBGMPlayer = new ABVMediaPlayer(true);
try {
Logger.v(TAG, "[addMusic]:MediaPlayer Content BGM");
contentBGMPlayer.setDataSource(contentsBgmFilePath);
contentBGMPlayer.prepare();
contentBGMPlayer.start();
} catch (IOException e) {
Logger.e(TAG, "Can't play content BGM", e);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT);
//文書協業接続中にはコンテンツBGM再生しない
if (!isCollaboration) {
//contentsBgmFilePath
contentBGMPlayer = new ABVMediaPlayer(true);
try {
Logger.v(TAG, "[addMusic]:MediaPlayer Content BGM");
contentBGMPlayer.setDataSource(contentsBgmFilePath);
contentBGMPlayer.prepare();
contentBGMPlayer.start();
} catch (IOException e) {
Logger.e(TAG, "Can't play content BGM", e);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT);
}
}
}
playPageBGMSound(jumpPage);
......@@ -3178,6 +3190,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
imgButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//文書協業接続中には差し替え動作機能制限
if (isCollaborationConnected()) {
return;
}
if (meetingManager.isSendable()) {
meetingManager.sendWs(MeetingManager.CMD_ACTION, getContentId(), pageNumber, pageObjectId, null);
}
......@@ -3292,6 +3308,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
private void videoOnClick(PageObjectJSON pageObject, int pageidx) {
//文書協業接続中には全画面動画制御
if (isCollaborationConnected()) {
return;
}
if (mPageScrollView.isZooming() == false) {
//リモート機能
if (meetingManager.isSendable()) {
......@@ -3483,7 +3503,11 @@ public class ContentViewActivity extends ABVContentViewActivity {
clickableArea.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (meetingManager.isSendable()) {
//文書協業接続時には音声アクション制限
if (isCollaborationConnected()) {
return;
}
if (meetingManager.isSendable()) {
meetingManager.sendWs(MeetingManager.CMD_ACTION, contentId, pageObject.getPageNumber(), pageObject.getActionInfo().getObjectId(), null);
}
playTapSound(soundFilePath, pageObject);
......@@ -3509,6 +3533,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
playIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//文書協業接続時には音声アクション制限
if (isCollaborationConnected()) {
return;
}
if (meetingManager.isSendable()) {
meetingManager.sendWs(MeetingManager.CMD_ACTION, contentId, pageObject.getPageNumber(), pageObject.getActionInfo().getObjectId(), null);
}
......@@ -3526,6 +3554,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
if (contentBGMPlayer != null) {
return;
}
//文書協業接続中にはコンテンツBGM再生しない
if (isCollaboration) {
return;
}
contentBGMPlayer = new ABVMediaPlayer(true);
try {
Logger.v(TAG, "[addMusic]:MediaPlayer Content BGM");
......@@ -3607,22 +3639,26 @@ public class ContentViewActivity extends ABVContentViewActivity {
String soundFilePath = mContentDir + "/" + contentsBGMPageObject.getActionInfo().getMusicFileName();
if (contentsBGMPageObject.getActionInfo().getPlayType() == 1) {
if (contentBGMPlayer == null) {
contentBGMPlayer = new ABVMediaPlayer(true);
try {
if (pageBgmFlg) {
contentsBgmFlg = true;
contentsBgmFilePath = soundFilePath;
//文書協業接続中にはコンテンツBGM再生しない
if (!isCollaboration) {
contentBGMPlayer = new ABVMediaPlayer(true);
try {
if (pageBgmFlg) {
contentsBgmFlg = true;
contentsBgmFilePath = soundFilePath;
return;
}
Logger.d(TAG, "[addMusic]:MediaPlayer Content BGM");
contentBGMPlayer.setDataSource(soundFilePath);
contentBGMPlayer.prepare();
contentBGMPlayer.start();
return;
} catch (IOException e) {
Logger.e(TAG, "Can't play content BGM", e);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT);
}
Logger.d(TAG, "[addMusic]:MediaPlayer Content BGM");
contentBGMPlayer.setDataSource(soundFilePath);
contentBGMPlayer.prepare();
contentBGMPlayer.start();
return;
} catch (IOException e) {
Logger.e(TAG, "Can't play content BGM", e);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT);
}
} else {
return;
}
......@@ -3703,6 +3739,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
private void playPageBGMSound(int pageNumber) {
//文書協業接続中にはページBGM再生しない
if (isCollaboration) {
return;
}
String bgmFilePath = pageBGMPathList.get(pageNumber);
//프리뷰 모드일때 사운드 계속 재생
......@@ -5554,5 +5594,15 @@ public class ContentViewActivity extends ABVContentViewActivity {
operationTaskLayout.setIconStatus(taskKey,false);
}
/**
* 文書協業接続中の値を返して、接続中にはエラーダイアログ表示
* @return YES:接続中、NO:非接続
* */
public boolean isCollaborationConnected() {
if (isCollaboration) {
showSimpleAlertDialog(R.string.msg_fail_collaboration_not_action_allow);
}
return isCollaboration;
}
}
......@@ -345,6 +345,11 @@ public class VideoMountAction {
}
private void videoOnClick(RelativeLayout contentPageView) {
//文書協業接続中、埋め込み動画制限
if (mActivity.isCollaborationConnected()) {
return;
}
if (((ZoomRelativeLayout)contentPageView).isZooming() == false) {
//動画の表示・再生
if (meetingManager.isSendable()) {
......
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