Commit ce85c8bf by Lee Munkyeong

Merge branch 'communication/feature/change_collaboration' into 'communication/develop'

Communication/feature/change collaboration

See merge request !152
parents 263341ce c53f122e
...@@ -53,6 +53,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.AddMemberGroupParameters; ...@@ -53,6 +53,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.AddMemberGroupParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AppStoreNewLoginParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AppStoreNewLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ArchiveDetailRequestParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.ArchiveDetailRequestParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ArchiveRequestParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.ArchiveRequestParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ChangeCollaborationParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ChangeRoomNameParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.ChangeRoomNameParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.CheckSendLogParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.CheckSendLogParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ContentReadingLogParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.ContentReadingLogParameters;
...@@ -808,6 +809,9 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -808,6 +809,9 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpResponse response = send(AcmsApis.ApigetCollaboration, new FinishCollaborationParameters(sid, AcmsApis.CollaborationCmds.finish, roomId)); HttpResponse response = send(AcmsApis.ApigetCollaboration, new FinishCollaborationParameters(sid, AcmsApis.CollaborationCmds.finish, roomId));
} }
public void changeCollaboration(String sid, int roomId, int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApigetCollaboration, new ChangeCollaborationParameters(sid, AcmsApis.CollaborationCmds.change, roomId, changeCollaborationType, meetingId));
}
/** /**
* 協業内ユーザー招待 * 協業内ユーザー招待
* *
......
package jp.agentec.abook.abv.bl.acms.client.parameters;
import jp.agentec.adf.net.http.HttpParameterObject;
/**
* ACMSのAPIに渡す共通的なパラメータを格納します。ACMSのAPIのパラメータ用クラスを作成するときはこのクラスを継承してください。<br>
* ただし、このクラスはログイン状態の確認用として使われる {@link ChangeCollaborationParameters#sid} を持っているため、ログイン用のパラメータ {@link MobileLoginParameters} は、このクラスを継承する必要はありません。
* @author lee-mk
* @version 1.0.0
*/
public class ChangeCollaborationParameters extends HttpParameterObject {
/**
* セッションID
* @since 1.0.0
*/
private String sid;
private String cmd;
private Integer roomId;
private Integer collaborationType;
private Integer meetingId;
/**
* {@link ChangeCollaborationParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
* @param cmd Apiリクエストに必要なコマンド(ABOOK COMM専用)。
* @param roomId roomId
* @param meetingId meetingId
* @since 1.0.0
*/
public ChangeCollaborationParameters(String sid, String cmd, Integer roomId, Integer collaborationType, Integer meetingId) {
this.sid = sid;
this.cmd = cmd;
this.roomId = roomId;
this.collaborationType = collaborationType;
this.meetingId = meetingId;
}
/**
* セッションIDを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public String getSid() {
return sid;
}
/**
* コマンドを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public String getCmd() {
return cmd;
}
/**
* roomIdを返します。
* @return roomId
* @since 1.0.0
*/
public Integer getRoomId() {
return roomId;
}
/**
* meetingIdを返します。
* @return meetingId
* @since 1.0.0
*/
public Integer getMeetingId() {
return meetingId;
}
/**
* collaborationTypeを返します。
* @return collaborationType
* @since 1.0.0
*/
public Integer getCollaborationType() {
return collaborationType;
}
}
...@@ -209,7 +209,7 @@ public class AcmsApis { ...@@ -209,7 +209,7 @@ public class AcmsApis {
} }
public static final class CollaborationCmds { public static final class CollaborationCmds {
public static final String start = "1"; public static final String change = "1";
public static final String join = "2"; public static final String join = "2";
public static final String finish = "3"; public static final String finish = "3";
public static final String invite = "4"; public static final String invite = "4";
......
...@@ -123,19 +123,17 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -123,19 +123,17 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
//private final String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public/networkError.html"; //private final String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public/networkError.html";
private final String CHAT_PAGE_URL = "file:///android_asset/chat/public_new/chat.html"; private final String CHAT_PAGE_URL = "file:///android_asset/chat/public_new/chat.html";
private final String CHAT_ROOM_PAGE_URL = "file:///android_asset/chat/public_new/chat_room.html"; private final String CHAT_ROOM_PAGE_URL = "file:///android_asset/chat/public_new/chat_room.html";
private final String PICTURE_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_picture.html"; private final String PICTURE_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_picture.html";
private final String VIDEO_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_video.html"; private final String VIDEO_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_video.html";
private final String VOICE_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_voice.html"; private final String VOICE_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_voice.html";
private final String DOCUMENT_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_documents.html"; private final String DOCUMENT_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_documents.html";
private final String WHITE_BOARD_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_whiteboard.html"; private final String WHITE_BOARD_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_whiteboard.html";
private final String COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration.html";
private final String DEFAULT_CHECKSUM = "0000000000"; private final String DEFAULT_CHECKSUM = "0000000000";
//AISDevelop //AISDevelop
private JsInf jsInf = new JsInf(); private JsInf jsInf = new JsInf();
private ValueCallback<Uri[]> mUploadMessage; private ValueCallback<Uri[]> mUploadMessage;
private String sid; private String sid;
private String roomName; private String roomName;
private String loginId; private String loginId;
...@@ -150,6 +148,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -150,6 +148,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private String selectedUserIdList; private String selectedUserIdList;
private String mSkey; private String mSkey;
private Integer joinMeetingId; private Integer joinMeetingId;
private boolean isPIP;
// 0:協業生成, 1:協業参加 // 0:協業生成, 1:協業参加
private Integer collaborationJoinFlg = 0; private Integer collaborationJoinFlg = 0;
private MeetingManager meetingManager = MeetingManager.getInstance(); private MeetingManager meetingManager = MeetingManager.getInstance();
...@@ -162,7 +162,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -162,7 +162,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private BroadcastReceiver receiver; private BroadcastReceiver receiver;
private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class); private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
private int mCollaborationType;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
...@@ -1395,10 +1395,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1395,10 +1395,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
@JavascriptInterface @JavascriptInterface
public String createContentView() { public int createContentView() {
Integer meetingId = null; Integer meetingId = null;
meetingManager.close(); meetingManager.close();
Stack<ABVAuthenticatedActivity> stack = activityHandlingHelper.getCurrentActivityStack();
activityHandlingHelper.removeContentViewActivity(activityHandlingHelper.getContentViewActivity()); activityHandlingHelper.removeContentViewActivity(activityHandlingHelper.getContentViewActivity());
finishBeforeContentListActivity();
Stack<ABVAuthenticatedActivity> stack2 = activityHandlingHelper.getCurrentActivityStack();
try { try {
connectMeetingServer(); connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey); List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey);
...@@ -1412,17 +1415,17 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1412,17 +1415,17 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} catch (Exception e) { } catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');"); mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
} }
finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build()); enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(true); startContentListActivity(true);
return meetingId.toString(); return meetingId.intValue();
} }
@JavascriptInterface @JavascriptInterface
public void startContentView() { public void startContentView() {
meetingManager.close();
activityHandlingHelper.removeContentViewActivity(activityHandlingHelper.getContentViewActivity()); activityHandlingHelper.removeContentViewActivity(activityHandlingHelper.getContentViewActivity());
finishBeforeContentListActivity();
meetingManager.close();
try { try {
connectMeetingServer(); connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey); List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey);
...@@ -1430,7 +1433,23 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1430,7 +1433,23 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} catch (Exception e) { } catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');"); mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
} }
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(false);
}
@JavascriptInterface
public void joinMeetingRoom(int newMeetingId) {
activityHandlingHelper.removeContentViewActivity(activityHandlingHelper.getContentViewActivity());
finishBeforeContentListActivity(); finishBeforeContentListActivity();
meetingManager.close();
try {
connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey);
meetingManager.join(newMeetingId, mSkey, roomId.toString(), false);
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
}
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build()); enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(false); startContentListActivity(false);
...@@ -1446,6 +1465,24 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1446,6 +1465,24 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
@JavascriptInterface @JavascriptInterface
public void exitMeetingRoom() { public void exitMeetingRoom() {
exitAndDeleteMeetingRoom(); exitAndDeleteMeetingRoom();
finishPIPmode();
}
@JavascriptInterface
public int getJoinCollaborationType() {
return mCollaborationType;
}
@JavascriptInterface
public void setJoinCollaborationType(int collaborationType) {
mCollaborationType = collaborationType;
}
@JavascriptInterface
public void changeCollaboration(int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).changeCollaboration(sid, roomId.intValue(), changeCollaborationType, meetingId);
int test =1 ;
test = test +1 ;
} }
} }
...@@ -1469,6 +1506,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1469,6 +1506,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} }
} }
private void finishPIPmode() {
if (isPIP) {
getApplication().startActivity(new Intent(this, ChatWebViewActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK));
}
}
public void exitAndDeleteMeetingRoom() { public void exitAndDeleteMeetingRoom() {
if (meetingManager.isConnected() && meetingManager.isOwner()) { if (meetingManager.isConnected() && meetingManager.isOwner()) {
try { try {
...@@ -1547,50 +1591,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1547,50 +1591,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} }
private void moveCollaborationScreen(Integer collaborationType) { private void moveCollaborationScreen(Integer collaborationType) {
switch (collaborationType) { mCollaborationType = collaborationType;
case 0:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(VOICE_COLLABORATION_PAGE_URL);
}
});
break;
case 2:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(PICTURE_COLLABORATION_PAGE_URL);
}
});
break;
case 3:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(VIDEO_COLLABORATION_PAGE_URL);
}
});
break;
case 4:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(DOCUMENT_COLLABORATION_PAGE_URL);
}
});
break;
case 5:
mChatWebView.post(new Runnable() { mChatWebView.post(new Runnable() {
@Override @Override
public void run() { public void run() {
mChatWebView.loadUrl(WHITE_BOARD_COLLABORATION_PAGE_URL); mChatWebView.loadUrl(COLLABORATION_PAGE_URL);
} }
}); });
break;
default:
break;
}
} }
private boolean deleteFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException { private boolean deleteFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException {
...@@ -1676,6 +1683,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1676,6 +1683,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
@Override @Override
public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) { public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) {
isPIP = isInPictureInPictureMode;
if (isInPictureInPictureMode) { if (isInPictureInPictureMode) {
mChatWebView.loadUrl("javascript:$('.pip_indicator').removeClass('none');"); mChatWebView.loadUrl("javascript:$('.pip_indicator').removeClass('none');");
} else { } else {
......
...@@ -519,8 +519,13 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -519,8 +519,13 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
showProgressPopup(); showProgressPopup();
hideContentList(); hideContentList();
MeetingManager meetingManager = MeetingManager.getInstance(); MeetingManager meetingManager = MeetingManager.getInstance();
}
MeetingManager meetingManager = MeetingManager.getInstance();
if (!meetingManager.isConnected()) { if (!meetingManager.isConnected()) {
backToHome(); ChatWebViewActivity chatWebViewActivity = activityHandlingHelper.getActivity(ChatWebViewActivity.class);
if (chatWebViewActivity != null && chatWebViewActivity.isInPictureInPictureMode()) {
getApplication().startActivity(new Intent(chatWebViewActivity, ChatWebViewActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK));
} }
} }
} else { } else {
......
...@@ -174,11 +174,11 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -174,11 +174,11 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
@Override @Override
public void run() { public void run() {
try { try {
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | intent.FLAG_ACTIVITY_NEW_TASK);
if (page != null) { if (page != null) {
intent.putExtra(ABVActivity.PAGE, page); intent.putExtra(ABVActivity.PAGE, page);
} }
startContentActivity(mContext, intent, null, Intent.FLAG_ACTIVITY_SINGLE_TOP, contentId); startContentActivity(mContext, intent, null, Intent.FLAG_ACTIVITY_SINGLE_TOP | intent.FLAG_ACTIVITY_NEW_TASK, contentId);
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, "startContentActivity contentId=" + contentId, e); Logger.e(TAG, "startContentActivity contentId=" + contentId, e);
showToast(mContext.getString(R.string.E113)); showToast(mContext.getString(R.string.E113));
...@@ -293,6 +293,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -293,6 +293,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
if (intent == null) { if (intent == null) {
intent = new Intent(); intent = new Intent();
} }
intent.putExtra(ABookKeys.CONTENT_ID, contentId); intent.putExtra(ABookKeys.CONTENT_ID, contentId);
intent.putExtra(FILEPATH, path); intent.putExtra(FILEPATH, path);
intent.putExtra(ABookKeys.CONTENT_TYPE, contentType); intent.putExtra(ABookKeys.CONTENT_TYPE, contentType);
...@@ -384,20 +385,23 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -384,20 +385,23 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
recordContentReadLog(context, contentId); recordContentReadLog(context, contentId);
} }
//AbookCommの文書協業の場合(ChatWebviewがPIPモードの場合)既存Contextでなく以前のActivityから画面を遷移する。
Activity targetActivity = getCurrentActivity(); ChatWebViewActivity chatWebViewActivity = getActivity(ChatWebViewActivity.class);
if (targetActivity instanceof ChatWebViewActivity) { if (chatWebViewActivity != null && chatWebViewActivity.isInPictureInPictureMode()) {
context = getCurrentActivity();
intent.removeFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | intent.FLAG_ACTIVITY_NEW_TASK);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
if (context instanceof ChatWebViewActivity) {
Stack<ABVAuthenticatedActivity> stack = getCurrentActivityStack(); Stack<ABVAuthenticatedActivity> stack = getCurrentActivityStack();
if (stack.size() > 1){ if (stack.size() > 1){
targetActivity = stack.get(stack.size()-2); context = stack.get(stack.size()-2);
}
} }
} }
intent.setClass(targetActivity, ContentViewActivity.class);
if (!StringUtil.equalsAny(contentType, if (!StringUtil.equalsAny(contentType,
ContentJSON.KEY_HTML_TYPE, ContentJSON.KEY_LINK_TYPE, ContentJSON.KEY_ENQUETE_TYPE, ContentJSON.KEY_EXAM_TYPE, ContentJSON.KEY_HTML_TYPE, ContentJSON.KEY_LINK_TYPE, ContentJSON.KEY_ENQUETE_TYPE, ContentJSON.KEY_EXAM_TYPE,
ContentJSON.KEY_PANO_MOVIE_TYPE, ContentJSON.KEY_PANO_IMAGE_TYPE, ContentJSON.KEY_OBJECTVR_TYPE)) { ContentJSON.KEY_PANO_MOVIE_TYPE, ContentJSON.KEY_PANO_IMAGE_TYPE, ContentJSON.KEY_OBJECTVR_TYPE)) {
targetActivity.startActivity(intent); context.startActivity(intent);
} }
} }
......
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