Commit 17680174 by Lee Munkyeong

Merge branch 'features/abcomm_sp6_document_collaboration' into 'communication/develop'

Features/abcomm sp6 document collaboration

See merge request !146
parents e9ad4810 2fc75b31
......@@ -243,7 +243,7 @@
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ChatWebviewActivity" android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity" android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:resizeableActivity="true"
android:supportsPictureInPicture="true"/>
......
......@@ -864,7 +864,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
ll_menuItem_chat.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ActivityHandlingHelper.getInstance().startChatWebviewActivity();
ActivityHandlingHelper.getInstance().startChatWebViewActivity();
mCommunicationMenuDialog.dismiss();
}
});
......@@ -939,7 +939,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
if(dto.roomName != null && dto.roomId != 0)
{
pushMessageLogic.updateReadingFlg(dto.pushMessageId);
ActivityHandlingHelper.getInstance().startChatWebviewActivityWithPushMessage(dto);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithPushMessage(dto);
mPushMessageListDialog.dismiss();
} else {
showPushMessageDetailView(dto);
......
......@@ -140,9 +140,9 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
Logger.d("tempDate","date : " + tempDate);
}
if (StringUtil.isNullOrEmpty(collaborationType)) {
ActivityHandlingHelper.getInstance().startChatWebviewActivity(roomId, roomName);
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName);
} else {
ActivityHandlingHelper.getInstance().startChatWebviewActivityWithCollaboration(roomId, roomName, collaborationType);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId, roomName, collaborationType);
}
}
}
......
......@@ -28,6 +28,7 @@ import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.RequiresApi;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.webkit.CookieManager;
......@@ -101,6 +102,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,11 +113,11 @@ 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;
private final String TAG = "ChatWebviewActivity";
private final String TAG = "ChatWebViewActivity";
private final String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public_new/chat.html";
//private final String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public/networkError.html";
......@@ -146,9 +148,11 @@ 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();
private ActivityHandlingHelper handlingHelper = ActivityHandlingHelper.getInstance();
public AlertDialog myAlertDialog;
private ImageButton mOperationHomeButton; // ホームボタン
......@@ -160,7 +164,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isNormalSize()) {
setPortraitIfNormal();
......@@ -188,6 +191,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
shopName = intent.getStringExtra("shopName");
collaborationType = intent.getStringExtra("collaborationType");
isOnline = false;
}
private void setupDefaultChatWebViewURL() {
......@@ -374,7 +378,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
final String tempMessage = message;
ABookAlertDialog dialog = AlertDialogUtil.createAlertDialog(ChatWebviewActivity.this, R.string.app_name);
ABookAlertDialog dialog = AlertDialogUtil.createAlertDialog(ChatWebViewActivity.this, R.string.app_name);
dialog.setMessage(message);
dialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
......@@ -420,7 +424,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
} else if (message.equals("방장 권한을 전달 받으시겠습니까?")){
message = getString(R.string.msg_confirm_send_host_change);
}
ABookAlertDialog confirmAlert = AlertDialogUtil.createAlertDialog(ChatWebviewActivity.this, R.string.app_name);
ABookAlertDialog confirmAlert = AlertDialogUtil.createAlertDialog(ChatWebViewActivity.this, R.string.app_name);
confirmAlert.setMessage(message);
if (message.equals(getString(R.string.msg_error_already_exist_same_room))) {
......@@ -594,16 +598,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
}
@Override
public void onDestroy(){
super.onDestroy();
if (receiver != null) {
unregisterReceiver(receiver);
receiver = null;
}
}
// 下辺のツールバー設定
private void settingBottomToolbar() {
// ホームボタン活性化
......@@ -685,10 +679,10 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
// チャット利用のはネットワークが繋がる時のみ
if (ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
showProgressPopup();
ActivityHandlingHelper.getInstance().startChatWebviewActivity();
ActivityHandlingHelper.getInstance().startChatWebViewActivity();
mCommunicationMenuDialog.dismiss();
} else {
ABVToastUtil.showMakeText(ChatWebviewActivity.this, R.string.request_network_connection, Toast.LENGTH_SHORT);
ABVToastUtil.showMakeText(ChatWebViewActivity.this, R.string.request_network_connection, Toast.LENGTH_SHORT);
return;
}
}
......@@ -782,10 +776,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;
}
......@@ -873,23 +863,11 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
@JavascriptInterface
public void openSetting() {
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl("javascript:CHAT.leaveRoom()");
finish();
showSetting();
}
});
}
@JavascriptInterface
public void reload() {
mChatWebView.post(new Runnable() {
@Override
public void run() {
ActivityHandlingHelper.getInstance().startChatWebviewActivity();
ActivityHandlingHelper.getInstance().startChatWebViewActivity();
}
});
......@@ -1361,7 +1339,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));
......@@ -1412,6 +1391,8 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@JavascriptInterface
public String createContentView() {
Integer meetingId = null;
meetingManager.close();
activityHandlingHelper.removeContentViewActivity(activityHandlingHelper.getContentViewActivity());
try {
connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey);
......@@ -1425,53 +1406,41 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
}
finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(true);
return meetingId.toString();
}
@JavascriptInterface
public void startContentView(String joinMeetingId) {
public void startContentView() {
Integer meetingId;
meetingManager.close();
activityHandlingHelper.removeContentViewActivity(activityHandlingHelper.getContentViewActivity());
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('" + "会議室サーバに接続できませんでした。" + "');");
}
finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
startContentListActivity(false);
}
@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);
exitMeetingRoom();
}
}
......@@ -1480,13 +1449,49 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
*/
private void backToHome() {
mChatWebView.loadUrl("javascript:CHAT.leaveRoom()");
exitMeetingRoom();
finish();
Intent intent = new Intent();
intent.setClass(ChatWebviewActivity.this, OperationListActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.setClass(ChatWebViewActivity.this, OperationListActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent, NaviConsts.Left);
}
private void finishBeforeContentListActivity() {
OperationRelatedContentActivity beforeActiryty = activityHandlingHelper.getActivity(OperationRelatedContentActivity.class);
if (beforeActiryty != null) {
beforeActiryty.finish();
}
}
public void exitMeetingRoom() {
if (meetingManager.isConnected() && meetingManager.isOwner()) {
try {
meetingManager.deleteMeeting();
} catch (Exception e) {
Logger.e(TAG, "showMeetingExitDialog deleteMeeting error", e);
}
}
meetingManager.close();
handlingHelper.saveMeetingInfo(null, null, null, false);
}
private void startContentListActivity(boolean isOwner) {
Activity targetActivity = activityHandlingHelper.getCurrentActivity();
if (targetActivity instanceof ChatWebViewActivity) {
Stack<ABVAuthenticatedActivity> stack = activityHandlingHelper.getCurrentActivityStack();
if (stack.size() > 1){
targetActivity = stack.get(stack.size()-2);
}
}
Intent intent = new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.setClass(targetActivity, OperationRelatedContentActivity.class);
intent.putExtra("isCollaboration", true);
intent.putExtra("isCollaborationOwner", isOwner);
targetActivity.startActivity(intent);
}
public void connectMeetingServer() throws Exception {
meetingManager = MeetingManager.getInstance();
mSkey = meetingManager.getSessionKey(true);
......@@ -1530,7 +1535,12 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
.insertFavoriteGroup(sid, Integer.parseInt(groupId));
return result;
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
private void moveCollaborationScreen(Integer collaborationType) {
switch (collaborationType) {
case 0:
......@@ -1651,21 +1661,23 @@ 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();
intent.setClass(ChatWebviewActivity.this, OperationRelatedContentActivity.class);
intent.setClass(ChatWebViewActivity.this, OperationRelatedContentActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
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;
......@@ -1716,4 +1728,26 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
}
@Override
public void onDestroy(){
exitMeetingRoom();
super.onDestroy();
if (receiver != null) {
unregisterReceiver(receiver);
receiver = null;
}
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
boolean eventPrevent = false;
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
backToHome();
eventPrevent = true;
break;
}
return eventPrevent;
}
}
......@@ -357,7 +357,7 @@ public class OperationListActivity extends ABVUIActivity {
// プッシュメッセージがある場合
else if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') > 0) {
ActivityHandlingHelper.getInstance().startChatWebviewActivity(
ActivityHandlingHelper.getInstance().startChatWebViewActivity(
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName));
}
......
......@@ -8,12 +8,14 @@ import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
......@@ -28,6 +30,7 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.websocket.MeetingManager;
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.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
......@@ -57,15 +60,18 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
private TextView mTxtOperationRelatedContent;
private Button mAllSaveButton;
private boolean isCollaboration;
private boolean isCollaborationOwner;
private ListView mContentListView;
private List<CategoryContentDto> mOperationContentList;
private LinearLayout mToolbar;
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
isCollaboration = getIntent().getBooleanExtra("isCollaboration", false);
isCollaborationOwner = getIntent().getBooleanExtra("isCollaborationOwner", false);
setContentView(R.layout.ac_operation_related_content);
// ホームボタン(作業一覧へ遷移ボタン)
......@@ -78,7 +84,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
mAllSaveButton = (Button) findViewById(R.id.btn_all_save);
mContentListView = (ListView) findViewById(R.id.lv_content_list);
showContentList();
mTxtOperationRelatedContent = (TextView) findViewById(R.id.txt_operation_related_content);
mQuickReportPrintButton = (ImageButton) findViewById(R.id.btn_operation_print);
......@@ -86,12 +92,11 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
mTxtOperationRelatedContent.setText("" + PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_common_content,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
mToolbar = (LinearLayout)findViewById(R.id.toolbar2);
mAllSaveButton.setVisibility(View.GONE);
settingBottomToolbar();
setOnButtonEvent();
settingBottomToolbar();
}
// 下辺のツールバー設定
......@@ -117,6 +122,22 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
}
}
private void hideBottomToolbar() {
mToolbar.setVisibility(View.GONE);
}
private void showBottomToolbar() {
mToolbar.setVisibility(View.VISIBLE);
}
private void hideContentList() {
mContentListView.setVisibility(View.GONE);
}
private void showContentList() {
mContentListView.setVisibility(View.VISIBLE);
}
@Override
public void onDownloadingContentZip(final ContentZipDownloadNotification notification) {
super.onDownloadingContentZip(notification);
......@@ -445,8 +466,11 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
// 端末の戻るボタン処理
Logger.d(TAG, "onKeyUp.Back");
// 端末の戻るボタン処理
if (isCollaboration) {
return true;
}
backToHome();
return true;
}
......@@ -482,11 +506,27 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
});
}
@Override
public void onResume() {
Logger.i(TAG, "onResume:start");
Stack<ABVAuthenticatedActivity> stack = activityHandlingHelper.getCurrentActivityStack();
super.onResume();
if (isCollaboration) {
hideBottomToolbar();
if (!isCollaborationOwner) {
showProgressPopup();
hideContentList();
MeetingManager meetingManager = MeetingManager.getInstance();
if (!meetingManager.isConnected()) {
backToHome();
}
}
} else {
showBottomToolbar();
showContentList();
}
showOperationRelatedContentList();
}
......
......@@ -71,7 +71,7 @@ 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;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.home.activity.ChatWebviewActivity;
import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationListActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationMeetingListActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity;
......@@ -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);
}
}
......@@ -701,6 +706,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
public synchronized void removeContentViewActivity(ABVContentViewActivity contentViewActivity) {
sendToBookShelf();
if (this.contentViewActivity != null && this.contentViewActivity.equals(contentViewActivity)) {
contentViewActivity.finish();
setContentViewActivity(null);
}
}
......@@ -716,7 +722,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 +739,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();
}
}
......@@ -1572,8 +1578,8 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
//プシュメッセージ一覧からチャットに入る
public void startChatWebviewActivityWithPushMessage(PushMessageDto dto) {
String className = ChatWebviewActivity.class.getName();
public void startChatWebViewActivityWithPushMessage(PushMessageDto dto) {
String className = ChatWebViewActivity.class.getName();
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
Intent intent = new Intent();
......@@ -1597,8 +1603,8 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
for(int i = size-1; i >= 0; i--) {
ABVAuthenticatedActivity activity = currentActivityStack.elementAt(i);
if (activity instanceof ChatWebviewActivity) {
activity2 = (ChatWebviewActivity) activity;
if (activity instanceof ChatWebViewActivity) {
activity2 = (ChatWebViewActivity) activity;
}
}
}
......@@ -1615,8 +1621,8 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
//チャットに入る
public void startChatWebviewActivity() {
String className = ChatWebviewActivity.class.getName();
public void startChatWebViewActivity() {
String className = ChatWebViewActivity.class.getName();
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
Intent intent = new Intent();
intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/");
......@@ -1634,8 +1640,8 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
for(int i = size-1; i >= 0; i--) {
ABVAuthenticatedActivity activity = currentActivityStack.elementAt(i);
if (activity instanceof ChatWebviewActivity) {
activity2 = (ChatWebviewActivity) activity;
if (activity instanceof ChatWebViewActivity) {
activity2 = (ChatWebViewActivity) activity;
}
}
}
......@@ -1652,8 +1658,8 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
// プシュメッセージからチャットに入る
public void startChatWebviewActivity(Long roomId, String roomName) {
String className = ChatWebviewActivity.class.getName();
public void startChatWebViewActivity(Long roomId, String roomName) {
String className = ChatWebViewActivity.class.getName();
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
Intent intent = new Intent();
intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/");
......@@ -1674,8 +1680,8 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
for(int i = size-1; i >= 0; i--) {
ABVAuthenticatedActivity activity = currentActivityStack.elementAt(i);
if (activity instanceof ChatWebviewActivity) {
activity2 = (ChatWebviewActivity) activity;
if (activity instanceof ChatWebViewActivity) {
activity2 = (ChatWebViewActivity) activity;
}
}
}
......@@ -1916,8 +1922,8 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
this.previousOfSettingActivity2 = activity;
}
public void startChatWebviewActivityWithCollaboration(Long roomId, String roomName, String collaborationType) {
String className = ChatWebviewActivity.class.getName();
public void startChatWebViewActivityWithCollaboration(Long roomId, String roomName, String collaborationType) {
String className = ChatWebViewActivity.class.getName();
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
Intent intent = new Intent();
intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/");
......@@ -1939,8 +1945,8 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
for (int i = size - 1; i >= 0; i--) {
ABVAuthenticatedActivity activity = currentActivityStack.elementAt(i);
if (activity instanceof ChatWebviewActivity) {
activity2 = (ChatWebviewActivity) activity;
if (activity instanceof ChatWebViewActivity) {
activity2 = (ChatWebViewActivity) activity;
}
}
}
......
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 = "CommunicationWebViewActivity";
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