Commit f88c2e59 by Lee Munkyeong

Merge branch 'features/abcomm_sp6_document_collaboration' into 'features/abcomm_sp6'

Features/abcomm sp6 document collaboration

See merge request !143
parents 5c18e2a3 2b11ca45
......@@ -243,7 +243,9 @@
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ChatWebviewActivity" android:configChanges="orientation|screenSize"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ChatWebviewActivity" android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:resizeableActivity="true"
android:supportsPictureInPicture="true"/>
</application>
</manifest>
\ No newline at end of file
......@@ -469,13 +469,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// }
}
else { // 会議室退室ボタン非表示
if (exitMeetingBtn != null) {
exitMeetingBtn.setVisibility(View.GONE);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(WC, WC);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
params.addRule(RelativeLayout.CENTER_VERTICAL);
params.rightMargin = (int) (getResources().getDisplayMetrics().density * 5);
subMenuBtn.setLayoutParams(params);
}
// if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) {
// helpButton.setLayoutParams(params);
// }
......
package jp.agentec.abook.abv.ui.home.activity;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DownloadManager;
import android.app.PictureInPictureParams;
import android.content.BroadcastReceiver;
import android.content.ContentValues;
import android.content.Context;
......@@ -54,6 +56,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Stack;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.ArchiveDetailJSON;
......@@ -79,12 +82,16 @@ import jp.agentec.abook.abv.bl.dto.ArchiveDto;
import jp.agentec.abook.abv.bl.dto.ChatGroupDto;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.MeetingDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.bl.websocket.MeetingManager;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
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.ABVContentViewActivity;
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.ErrorMessage;
......@@ -118,6 +125,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
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 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 DEFAULT_CHECKSUM = "0000000000";
//AISDevelop
......@@ -137,7 +145,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private String beforeRoomType;
private Integer shopMemberId;
private String selectedUserIdList;
private String mSkey;
// 0:協業生成, 1:協業参加
private Integer collaborationJoinFlg = 0;
......@@ -1399,6 +1407,72 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
public String getUserListByLoginId(String loginIdList) {
return communicationLogic.getUserListByLoginId(loginIdList);
}
@JavascriptInterface
public String createContentView() {
Integer meetingId = null;
try {
connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey);
for (MeetingDto meeting : meetingList) {
if (meeting.title.equals("Collaboration__"+roomId) && meetingManager.isOwner()) {
meetingManager.deleteMeeting(meeting.meetingId, mSkey);
}
}
meetingId = meetingManager.createMeeting(mSkey, "Collaboration_"+roomId, roomId.toString());
meetingManager.join(meetingId, mSkey, roomId.toString(), true);
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
}
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
return meetingId.toString();
}
@JavascriptInterface
public void startContentView(String joinMeetingId) {
Integer meetingId;
try {
connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey);
for (MeetingDto meeting : meetingList) {
if (meeting.title.equals("Collaboration__"+roomId) && meetingManager.isOwner()) {
meetingManager.deleteMeeting(meeting.meetingId, mSkey);
}
}
if (collaborationJoinFlg == 0) {
meetingId = meetingManager.createMeeting(mSkey, "Collaboration_"+roomId, roomId.toString());
meetingManager.join(meetingId, mSkey, roomId.toString(), true);
} else {
meetingManager.join(Integer.parseInt(joinMeetingId), mSkey, roomId.toString(), true);
}
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
}
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
}
@JavascriptInterface
public void startPipMode() {
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
}
@JavascriptInterface
public void exitMeetingRoom() {
if (meetingManager.isOwner()) {
try {
meetingManager.deleteMeeting();
} catch (Exception e) {
Logger.e(TAG, "showMeetingExitDialog deleteMeeting error", e);
}
}
meetingManager.close();
ActivityHandlingHelper handlingHelper = ActivityHandlingHelper.getInstance();
handlingHelper.saveMeetingInfo(null, null, null, false);
}
}
/**
......@@ -1413,6 +1487,11 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
startActivity(intent, NaviConsts.Left);
}
public void connectMeetingServer() throws Exception {
meetingManager = MeetingManager.getInstance();
mSkey = meetingManager.getSessionKey(true);
}
private void updateMyInfoFromServer() throws NetworkDisconnectedException, AcmsException {
MyInfoJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMyInfo(sid);
if (resultJson.shopMemberDto != null) {
......@@ -1478,6 +1557,14 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
});
break;
case 4:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(DOCUMENT_COLLABORATION_PAGE_URL);
}
});
break;
default:
break;
}
......
......@@ -30,12 +30,10 @@ import java.util.Stack;
import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.DeliveryType;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.ContentFileUtil;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
......@@ -69,7 +67,6 @@ import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppNaviType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
......@@ -81,7 +78,6 @@ import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity;
import jp.agentec.abook.abv.ui.viewer.activity.AudioPlayActivity;
import jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.ContentViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.DeviceImageListActivity;
import jp.agentec.abook.abv.ui.viewer.activity.EnqueteWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity;
......@@ -90,7 +86,6 @@ import jp.agentec.abook.abv.ui.viewer.activity.ParentWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.PreviewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.VideoViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.theta.ThetaActivity;
import jp.agentec.abook.abv.ui.viewer.view.OperationTaskLayout;
import jp.agentec.adf.net.http.HttpDownloadSimpleNotification;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeFormat;
......@@ -179,11 +174,11 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
@Override
public void run() {
try {
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
if (page != null) {
intent.putExtra(ABVActivity.PAGE, page);
}
startContentActivity(mContext, intent, null, Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK, contentId);
startContentActivity(mContext, intent, null, Intent.FLAG_ACTIVITY_SINGLE_TOP, contentId);
} catch (Exception e) {
Logger.e(TAG, "startContentActivity contentId=" + contentId, e);
showToast(mContext.getString(R.string.E113));
......@@ -389,11 +384,15 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
recordContentReadLog(context, contentId);
}
Activity act = getCurrentActivity();
if (act instanceof ChatWebviewActivity) {
act = getActivity(OperationRelatedContentActivity.class);
}
intent.setClass(act, ContentViewActivity.class);
if (!StringUtil.equalsAny(contentType,
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)) {
context.startActivity(intent);
act.startActivity(intent);
}
}
......@@ -717,7 +716,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
*/
public synchronized void finishAllContentViewActivity() {
for (ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof ABVContentViewActivity) {
if (activity instanceof ABVContentViewActivity && !(activity instanceof ChatWebviewActivity)) {
activity.finish();
}
}
......@@ -734,7 +733,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
int activitySize = currentActivityStack.size();
for (int i = 1; i < activitySize - 1; i++) {
ABVAuthenticatedActivity activity = currentActivityStack.get(currentActivityStack.size() - i);
if (activity instanceof ABVContentViewActivity) {
if (activity instanceof ABVContentViewActivity && !(activity instanceof ChatWebviewActivity)) {
activity.finish();
}
}
......@@ -842,6 +841,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
}
public Stack<ABVAuthenticatedActivity> getCurrentActivityStack() {
return currentActivityStack;
}
public void setRequireHomeReload(boolean requireHomeReload) {
this.requireHomeReload = requireHomeReload;
}
......
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