Commit f1b9f46c by Lee Munkyeong

文書協業実装

parent 2b11ca45
......@@ -101,6 +101,7 @@ import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.view.FullscreenableChromeClient;
import jp.agentec.abook.abv.ui.viewer.activity.CommunicationWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.ParentWebViewActivity;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.StringUtil;
......@@ -111,7 +112,7 @@ import static org.chromium.net.NetError.ERR_FAILED;
* Created by AIS-NB-048 on 2019/07/31.
*/
public class ChatWebviewActivity extends ParentWebViewActivity {
public class ChatWebviewActivity extends CommunicationWebViewActivity {
private WebView mChatWebView;
private String chatWebviewUrl;
......@@ -145,9 +146,10 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private Integer shopMemberId;
private String selectedUserIdList;
private String mSkey;
private Integer joinMeetingId;
// 0:協業生成, 1:協業参加
private Integer collaborationJoinFlg = 0;
private MeetingManager meetingManager = MeetingManager.getInstance();
public AlertDialog myAlertDialog;
private ImageButton mOperationHomeButton; // ホームボタン
......@@ -159,7 +161,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isNormalSize()) {
setPortraitIfNormal();
......@@ -186,6 +187,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
loginId = intent.getStringExtra("loginId");
shopName = intent.getStringExtra("shopName");
isOnline = false;
}
private void setupDefaultChatWebViewURL() {
......@@ -307,10 +309,10 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
boolean result = false;
// 画像が選択された場合
if (fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.IMAGE) != -1) {
result = startCameraIntent(ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
result = startCameraIntent(103, "Camera", ABookKeys.IMAGE, true);
// 動画が選択された場合
} else if (fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.VIDEO) != -1) {
result = startCameraIntent(ABOOK_CHECK_TASK_VIDEO, "Camera", ABookKeys.VIDEO, true);
result = startCameraIntent(104, "Camera", ABookKeys.VIDEO, true);
}
if (result) {
if (mUploadMessage != null) {
......@@ -768,10 +770,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
return;
}
mUploadMessage.onReceiveValue(result);
} else if (requestCode == ABOOK_CHECK_SELECT_SCENE) {
if (data != null && result != null) {
confirmEntrySceneDialog(result[0]);
}
}
mUploadMessage = null;
}
......@@ -848,17 +846,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
showCommunicationMenuDialog();
}
@JavascriptInterface
public void openSetting() {
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl("javascript:CHAT.leaveRoom()");
finish();
showSetting();
}
});
}
@JavascriptInterface
public void reload() {
......@@ -1337,7 +1324,8 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
@JavascriptInterface
public void joinCollaboration(String collaborationType) throws NetworkDisconnectedException, AcmsException {
public void joinCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException {
joinMeetingId = Integer.parseInt(meetingId);
collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.JOIN;
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).joinCollaboration(sid, roomId.intValue());
moveCollaborationScreen(Integer.parseInt(collaborationType));
......@@ -1397,22 +1385,12 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
@JavascriptInterface
public void startContentView(String joinMeetingId) {
public void startContentView() {
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);
}
meetingManager.join(joinMeetingId, mSkey, roomId.toString(), false);
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
}
......@@ -1617,6 +1595,15 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
});
}
@Override
public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) {
if (isInPictureInPictureMode) {
mChatWebView.loadUrl("javascript:$('.pip_indicator').removeClass('none');");
} else {
mChatWebView.loadUrl("javascript:$('.pip_indicator').addClass('none');");
}
}
// 共通資料画面表示
private void showCommonContent() {
Intent intent = new Intent();
......@@ -1625,13 +1612,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
startActivity(intent, NaviConsts.Left);
}
// 設定画面へ遷移
public void onClickSetting(View v) {
mChatWebView.loadUrl("javascript:CHAT.leaveRoom()");
finish();
showSetting();
}
public class NetworkTask extends AsyncTask<Void, Void, Bitmap> {
private String url;
......
......@@ -384,15 +384,20 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
recordContentReadLog(context, contentId);
}
Activity act = getCurrentActivity();
if (act instanceof ChatWebviewActivity) {
act = getActivity(OperationRelatedContentActivity.class);
Activity targetActivity = getCurrentActivity();
if (targetActivity instanceof ChatWebviewActivity) {
Stack<ABVAuthenticatedActivity> stack = getCurrentActivityStack();
if (stack.size() > 1){
targetActivity = stack.get(stack.size()-2);
}
}
intent.setClass(act, ContentViewActivity.class);
intent.setClass(targetActivity, 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)) {
act.startActivity(intent);
targetActivity.startActivity(intent);
}
}
......@@ -716,7 +721,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
*/
public synchronized void finishAllContentViewActivity() {
for (ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof ABVContentViewActivity && !(activity instanceof ChatWebviewActivity)) {
if (activity instanceof ABVContentViewActivity) {
activity.finish();
}
}
......@@ -733,7 +738,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 && !(activity instanceof ChatWebviewActivity)) {
if (activity instanceof ABVContentViewActivity) {
activity.finish();
}
}
......
package jp.agentec.abook.abv.ui.viewer.activity;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContentObjectLogLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.cl.util.ContentLogUtil;
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;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
public class CommunicationWebViewActivity extends ABVAuthenticatedActivity {
private static final String TAG = "ParentWebViewActivity";
private LinearLayout historyLayout;
private ImageButton addSceneButton;
protected ImageButton promoteBtn;
protected ImageButton pauseBtn;
protected ImageButton mBtnRemoteStart;
protected Button historyListBtn;
protected ImageButton btnWebClose;
protected Button closeButton;
protected Button btnLinkOriginalBack;
protected Button btnWebBack;
protected Button btnWebForward;
private ProgressBar m_progress;
protected ContentDto mContentDto;
protected File mLocalFile;
public final static int ABOOK_CHECK_TASK_IMAGE = 103;
public final static int ABOOK_CHECK_TASK_VIDEO = 104;
@Override
protected void onDestroy() {
Logger.d(TAG, "onDestroy");
super.onDestroy();
}
protected Uri attachmentImageProcessing(Uri uri) throws Exception {
if (uri == null) {
return null;
}
String[] operationion = {MediaStore.MediaColumns.DATA};
Cursor cursor = getContentResolver().query(uri, operationion, null, null, null);
String photoFilePath = ABookCheckWebViewHelper.getInstance().contentSchemeUriToFilePath(cursor);
try {
int rotationAngle = ABookCheckWebViewHelper.getInstance().rotateBitmapOrientation(photoFilePath);
mLocalFile = new File(photoFilePath);
if (mLocalFile.exists()) {
return Uri.fromFile(mLocalFile);
}
} catch (FileNotFoundException e) {
Logger.e(TAG, "image file is not found", e);
}
return null;
}
}
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