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 @@ ...@@ -243,7 +243,9 @@
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity> </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> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -469,13 +469,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -469,13 +469,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// } // }
} }
else { // 会議室退室ボタン非表示 else { // 会議室退室ボタン非表示
exitMeetingBtn.setVisibility(View.GONE); if (exitMeetingBtn != null) {
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(WC, WC); exitMeetingBtn.setVisibility(View.GONE);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(WC, WC);
params.addRule(RelativeLayout.CENTER_VERTICAL); params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
params.rightMargin = (int) (getResources().getDisplayMetrics().density * 5); params.addRule(RelativeLayout.CENTER_VERTICAL);
subMenuBtn.setLayoutParams(params); params.rightMargin = (int) (getResources().getDisplayMetrics().density * 5);
subMenuBtn.setLayoutParams(params);
}
// if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) { // if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) {
// helpButton.setLayoutParams(params); // helpButton.setLayoutParams(params);
// } // }
......
package jp.agentec.abook.abv.ui.home.activity; package jp.agentec.abook.abv.ui.home.activity;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.DownloadManager; import android.app.DownloadManager;
import android.app.PictureInPictureParams;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.Context; import android.content.Context;
...@@ -54,6 +56,7 @@ import java.util.ArrayList; ...@@ -54,6 +56,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; 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.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.ArchiveDetailJSON; import jp.agentec.abook.abv.bl.acms.client.json.ArchiveDetailJSON;
...@@ -79,12 +82,16 @@ import jp.agentec.abook.abv.bl.dto.ArchiveDto; ...@@ -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.ChatGroupDto;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto; import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto; 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.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto; import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic; 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.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R; 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.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode; import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
...@@ -118,6 +125,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -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 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 DEFAULT_CHECKSUM = "0000000000"; private final String DEFAULT_CHECKSUM = "0000000000";
//AISDevelop //AISDevelop
...@@ -137,7 +145,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -137,7 +145,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private String beforeRoomType; private String beforeRoomType;
private Integer shopMemberId; private Integer shopMemberId;
private String selectedUserIdList; private String selectedUserIdList;
private String mSkey;
// 0:協業生成, 1:協業参加 // 0:協業生成, 1:協業参加
private Integer collaborationJoinFlg = 0; private Integer collaborationJoinFlg = 0;
...@@ -1399,6 +1407,72 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -1399,6 +1407,72 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
public String getUserListByLoginId(String loginIdList) { public String getUserListByLoginId(String loginIdList) {
return communicationLogic.getUserListByLoginId(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 { ...@@ -1413,6 +1487,11 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
startActivity(intent, NaviConsts.Left); startActivity(intent, NaviConsts.Left);
} }
public void connectMeetingServer() throws Exception {
meetingManager = MeetingManager.getInstance();
mSkey = meetingManager.getSessionKey(true);
}
private void updateMyInfoFromServer() throws NetworkDisconnectedException, AcmsException { private void updateMyInfoFromServer() throws NetworkDisconnectedException, AcmsException {
MyInfoJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMyInfo(sid); MyInfoJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMyInfo(sid);
if (resultJson.shopMemberDto != null) { if (resultJson.shopMemberDto != null) {
...@@ -1478,6 +1557,14 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -1478,6 +1557,14 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
} }
}); });
break; break;
case 4:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(DOCUMENT_COLLABORATION_PAGE_URL);
}
});
break;
default: default:
break; break;
} }
......
...@@ -30,12 +30,10 @@ import java.util.Stack; ...@@ -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.DownloadedContentInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON; 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.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; 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.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.log.Logger;
import jp.agentec.abook.abv.bl.common.util.ContentFileUtil; import jp.agentec.abook.abv.bl.common.util.ContentFileUtil;
import jp.agentec.abook.abv.bl.common.util.JsonUtil; import jp.agentec.abook.abv.bl.common.util.JsonUtil;
...@@ -69,7 +67,6 @@ import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; ...@@ -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.DefPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey; 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.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.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil; import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
...@@ -81,7 +78,6 @@ import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity; ...@@ -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.AudioPlayActivity;
import jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity; 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.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.EnqueteWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLWebViewActivity; import jp.agentec.abook.abv.ui.viewer.activity.HTMLWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity; import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity;
...@@ -90,7 +86,6 @@ import jp.agentec.abook.abv.ui.viewer.activity.ParentWebViewActivity; ...@@ -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.PreviewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.VideoViewActivity; 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.activity.theta.ThetaActivity;
import jp.agentec.abook.abv.ui.viewer.view.OperationTaskLayout;
import jp.agentec.adf.net.http.HttpDownloadSimpleNotification; import jp.agentec.adf.net.http.HttpDownloadSimpleNotification;
import jp.agentec.adf.util.CollectionUtil; import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
...@@ -179,11 +174,11 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -179,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_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
if (page != null) { if (page != null) {
intent.putExtra(ABVActivity.PAGE, page); 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) { } 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));
...@@ -389,11 +384,15 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -389,11 +384,15 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
recordContentReadLog(context, contentId); recordContentReadLog(context, contentId);
} }
Activity act = getCurrentActivity();
if (act instanceof ChatWebviewActivity) {
act = getActivity(OperationRelatedContentActivity.class);
}
intent.setClass(act, 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)) {
context.startActivity(intent); act.startActivity(intent);
} }
} }
...@@ -717,7 +716,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -717,7 +716,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
*/ */
public synchronized void finishAllContentViewActivity() { public synchronized void finishAllContentViewActivity() {
for (ABVAuthenticatedActivity activity : currentActivityStack) { for (ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof ABVContentViewActivity) { if (activity instanceof ABVContentViewActivity && !(activity instanceof ChatWebviewActivity)) {
activity.finish(); activity.finish();
} }
} }
...@@ -734,7 +733,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -734,7 +733,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
int activitySize = currentActivityStack.size(); int activitySize = currentActivityStack.size();
for (int i = 1; i < activitySize - 1; i++) { for (int i = 1; i < activitySize - 1; i++) {
ABVAuthenticatedActivity activity = currentActivityStack.get(currentActivityStack.size() - i); ABVAuthenticatedActivity activity = currentActivityStack.get(currentActivityStack.size() - i);
if (activity instanceof ABVContentViewActivity) { if (activity instanceof ABVContentViewActivity && !(activity instanceof ChatWebviewActivity)) {
activity.finish(); activity.finish();
} }
} }
...@@ -842,6 +841,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -842,6 +841,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
} }
} }
public Stack<ABVAuthenticatedActivity> getCurrentActivityStack() {
return currentActivityStack;
}
public void setRequireHomeReload(boolean requireHomeReload) { public void setRequireHomeReload(boolean requireHomeReload) {
this.requireHomeReload = 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