Commit f4c426c5 by onuma

#43368 AndroidとiOSで画面遷移を同じにした。

parent 0010a51e
......@@ -48,9 +48,9 @@ public class ChatPushDataJSON extends AcmsCommonJSON {
}
PushMessageDto pushMessageDto = new PushMessageDto();
String tempDate = DateTimeUtil.toString(DateTimeUtil.toDate(pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate), DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmmssSSS_none);
Logger.d("messageId","messageId : " + pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate));
Logger.d("oerationId","oerationId : " + pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate)+1);
Logger.d("date","date : " + tempDate);
//Logger.d("messageId","messageId : " + pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate));
//Logger.d("oerationId","oerationId : " + pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate)+1);
//Logger.d("date","date : " + tempDate);
Please register or sign in to reply
pushMessageDto.pushMessageId = Long.valueOf(tempDate);
pushMessageDto.operationId = Long.valueOf(tempDate+1);
pushMessageDto.pushSendLoginId = pushMessagetJsonArray.getJSONObject(k).getString(PushSendLoginId);
......
......@@ -171,4 +171,15 @@ public interface ABookCommConstants {
String DEFAULT_CHECKSUM = "0000000000";
String PLATFORM_NAME = "android";
int PUSH_MESSAGE_DLG_REQUEST_CODE = 200;
interface PUSH_MESSAGE_DLG_RESULT {
int OK = 0;
int CANCEL = 1;
}
// ABookCheckで、onActivityResultのリクエストコードとして使用されている
int ABOOK_CHECK_TASK_IMAGE = 103;
int ABOOK_CHECK_TASK_VIDEO = 104;
int ABOOK_CHECK_SELECT_SCENE = 105;
}
......@@ -28,8 +28,12 @@ import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ShowPushMessageDailogActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
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.OperationRelatedContentActivity;
import jp.agentec.abook.abv.ui.home.activity.SplashScreenActivity;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.ContentViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLWebViewActivity;
import jp.agentec.adf.util.StringUtil;
public class ABVFcmListenerService extends FirebaseMessagingService {
......@@ -101,7 +105,15 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
if (textMessage.contains(INVITE_COLLABORATION)) {
String roomType = Integer.toString(json.getInt(AppDefType.ChatPushMessageKey.roomType));
String[] inviteMessage = textMessage.split(CHAT_MESSAGE_SEPERATOR);
showCollaborationPopUpMessage(roomId, roomName, roomType, pushSendLoginId, pushSendDate, inviteMessage[1]);
showChatRoomPopupMessage(getString(R.string.msg_invite_collaboration),
"",
"",
roomId,
roomName,
roomType,
pushSendLoginId,
pushSendDate,
inviteMessage[1]);
return;
}
}
......@@ -110,7 +122,15 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
String data = msg.get(AppDefType.PushMessageKey.data);
String operationID = msg.get(AppDefType.PushMessageKey.operationId);
if (roomName.length() > 0) {
showChatRoomPopupMessage(tempMsg, data, operationID, roomId, roomName, pushSendLoginId, pushSendDate);
showChatRoomPopupMessage(tempMsg,
data,
operationID,
roomId,
roomName,
"",
pushSendLoginId,
pushSendDate,
"");
} else {
showOperationPopUpMessage(tempMsg, data, operationID);
}
......@@ -127,6 +147,9 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
}
private void showCollaborationPopUpMessage(
String textMessage,
String data,
String operationID,
Long roomId,
String roomName,
String roomType,
......@@ -134,17 +157,21 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
long pushSendDate,
String collaborationType)
{
Activity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity();
String fromClassName = currentActivity.getClass().getName();
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
String collaobrationInvitedMessage = getString(R.string.msg_invite_collaboration);
pushMsgDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, collaobrationInvitedMessage);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, textMessage);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, data);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, operationID);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.fromClassName, fromClassName);
startActivity(pushMsgDialog);
}
......@@ -154,9 +181,11 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
String operationID,
Long roomID,
String roomName,
String roomType,
String pushSendLoginId,
long pushSendDate)
{
long pushSendDate,
String collaborationType
) {
Activity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity();
if (currentActivity.getClass().equals(ChatWebViewActivity.class)) {
ChatWebViewActivity chatWebViewActivity = (ChatWebViewActivity) currentActivity;
......@@ -165,6 +194,15 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
return;
}
}
// プッシュメッセージは、受信した時のActivityで処理をわける(後処理が違うので)
String fromClassName = currentActivity.getClass().getName();
if (currentActivity.getClass().equals(HTMLWebViewActivity.class)){
((HTMLWebViewActivity)currentActivity).showChatRoomPopupMessage(textMessage, data, operationID, roomID, roomName, roomType, pushSendLoginId, pushSendDate, collaborationType);
} else if (currentActivity.getClass().equals(ContentViewActivity.class)){
((ContentViewActivity)currentActivity).showChatRoomPopupMessage(textMessage, data, operationID, roomID, roomName, roomType, pushSendLoginId, pushSendDate, collaborationType);
} else if (currentActivity.getClass().equals(OperationRelatedContentActivity.class)){
((ContentViewActivity)currentActivity).showChatRoomPopupMessage(textMessage, data, operationID, roomID, roomName, roomType, pushSendLoginId, pushSendDate, collaborationType);
} else {
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
pushMsgDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, textMessage);
......@@ -172,10 +210,14 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, operationID);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, roomID);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.fromClassName, fromClassName);
startActivity(pushMsgDialog);
}
}
private void showOperationPopUpMessage(String textMessage, String data, String operationID) {
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
......
......@@ -89,9 +89,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected static GroupLogic groupLogic = AbstractLogic.getLogic(GroupLogic.class);
private static final String TAG ="ABVContentViewActivity";
public final static int ABOOK_CHECK_TASK_IMAGE = 103;
public final static int ABOOK_CHECK_TASK_VIDEO = 104;
protected final static int ABOOK_CHECK_SELECT_SCENE = 105;
protected long contentId;// 表示中のコンテンツID
protected long objectId; // オブジェクトID(オブジェクト用のActivityのときのみ使用)
......
......@@ -3,6 +3,7 @@ package jp.agentec.abook.abv.ui.common.activity;
import android.content.DialogInterface;
import android.os.Bundle;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
......@@ -124,6 +125,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
Bundle extras = getIntent().getExtras();
if (extras != null && !isMeetingRoomConnected) {
moveChatRoom(extras);
setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK);
finish();
}
if (isMeetingRoomConnected || isCollabration) {
......@@ -134,6 +136,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.CANCEL);
finish();
}
});
......@@ -152,12 +155,12 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
String roomName = extras.getString(AppDefType.ChatPushMessageKey.roomName);
String collaborationType = extras.getString(AppDefType.ChatPushMessageKey.collaborationType);
String roomType = extras.getString(AppDefType.ChatPushMessageKey.roomType);
String fromClassName = extras.getString(AppDefType.ChatPushMessageKey.fromClassName,"");
if (roomId > 0 && !StringUtil.isNullOrEmpty(roomName)) {
if (StringUtil.isNullOrEmpty(collaborationType)) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName);
ActivityHandlingHelper.getInstance().startChatWebViewActivity(fromClassName, roomId, roomName);
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId, roomName, collaborationType, roomType);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(fromClassName, roomId, roomName, collaborationType, roomType);
}
}
}
......@@ -181,6 +184,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
alertDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.CANCEL);
finish();
}
});
......
......@@ -145,5 +145,6 @@ public interface AppDefType {
String pushSendDate = "pushSendDate";
String collaborationType = "collaborationType";
String roomType = "roomType";
String fromClassName = "fromClassName";
}
}
......@@ -304,10 +304,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
boolean result = false;
// 画像が選択された場合
if (fileChooserParams.getAcceptTypes()[0].toLowerCase().contains(ABookKeys.IMAGE)) {
result = startCameraIntent(ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
result = startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
// 動画が選択された場合
} else if (fileChooserParams.getAcceptTypes()[0].toLowerCase().contains(ABookKeys.VIDEO)) {
result = startCameraIntent(ABOOK_CHECK_TASK_VIDEO, "Camera", ABookKeys.VIDEO, true);
result = startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_VIDEO, "Camera", ABookKeys.VIDEO, true);
}
if (result) {
if (mUploadMessage != null) {
......@@ -701,9 +701,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
}
}
if (requestCode == ABOOK_CHECK_TASK_IMAGE) {
if (requestCode == ABookCommConstants.ABOOK_CHECK_TASK_IMAGE) {
activityResultReceivedImage(dataUri);
} else if (requestCode == ABOOK_CHECK_TASK_VIDEO) {
} else if (requestCode == ABookCommConstants.ABOOK_CHECK_TASK_VIDEO) {
activityResultReceivedMovie(dataUri);
}
......
......@@ -5,12 +5,8 @@ import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
......@@ -24,8 +20,6 @@ import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioGroup;
import android.widget.TextView;
......@@ -37,10 +31,7 @@ import net.lingala.zip4j.exception.ZipException;
import org.json.adf.JSONObject;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -104,7 +95,6 @@ import jp.agentec.abook.abv.ui.common.view.ABVBatchSyncView;
import jp.agentec.abook.abv.ui.common.view.ABVListDialog;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.home.adapter.HierarchyOperationGroupListAdapter;
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.HomeOperationListHelper;
......@@ -354,13 +344,6 @@ public class OperationListActivity extends ABVUIActivity {
alertDialog.show();
}
}
// プッシュメッセージがある場合
else if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') > 0) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName));
}
// リスト更新
setOperationListView();
......@@ -521,6 +504,21 @@ public class OperationListActivity extends ABVUIActivity {
return;
}
refreshOperationList();
// プッシュメッセージ処理
if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') > 0) {
handler.postDelayed(new Runnable() {
@Override
public void run() {
ActivityHandlingHelper.getInstance().startChatWebViewActivity("",
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName));
}
},1000);
return;
}
// 報告画面から作業一覧へ戻った時の同期処理
final long operationId = getUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L);
if (operationId != -1) {
......
......@@ -11,7 +11,6 @@ import android.view.Display;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
......@@ -21,11 +20,11 @@ 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;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.exception.ExceptionHandler;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
......@@ -36,8 +35,8 @@ 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.activity.ShowPushMessageDailogActivity;
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;
......@@ -545,6 +544,19 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
refreshCollaborationUI();
super.onResume();
showOperationRelatedContentList();
if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') > 0) {
handler.postDelayed(new Runnable() {
@Override
public void run() {
ActivityHandlingHelper.getInstance().startChatWebViewActivity("",
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName));
}
},1000);
return;
}
}
@Override
......@@ -595,4 +607,40 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
super.showAlertDialog(alertDialog);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK) {
backToHome();
}
return;
}
}
/**
* プッシュメッセージ受信後のダイアログを表示処理。
*/
public void showChatRoomPopupMessage(
String textMessage,
String data,
String operationID,
Long roomID,
String roomName,
String pushSendLoginId,
long pushSendDate)
{
String fromClassName = getClass().getName();
Intent pushMsgDialog = new Intent(OperationRelatedContentActivity.this, ShowPushMessageDailogActivity.class);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, textMessage);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, data);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, operationID);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, roomID);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.fromClassName ,fromClassName);
startActivityForResult(pushMsgDialog, ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE);
}
}
......@@ -1669,8 +1669,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
getCurrentActivity().startActivity(intent);
}
// プシュメッセージからチャットに入る
public void startChatWebViewActivity(Long roomId, String roomName) {
/**
* プシュメッセージからチャットに入る
*/
public void startChatWebViewActivity(String fromClassName, 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();
......@@ -1684,7 +1686,49 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
intent.putExtra("roomId", roomId);
intent.putExtra("roomName", roomName);
intent.setClassName(mContext.getPackageName(), className);
String nextActivity = null;
if (fromClassName.equals(HTMLWebViewActivity.class.getName())) {
nextActivity = OperationListActivity.class.getName();
} else if(fromClassName.equals(ContentViewActivity.class.getName())){
nextActivity = OperationRelatedContentActivity.class.getName();
} else {
nextActivity = className;
}
intent.setClassName(mContext.getPackageName(), nextActivity);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getCurrentActivity().startActivity(intent);
}
/**
* プシュメッセージからチャットに入る(協業)
*/
public void startChatWebViewActivityWithCollaboration(String fromClassName, Long roomId, String roomName, String collaborationType, String roomType) {
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/");
String sid = ABVDataCache.getInstance().getMemberInfo().sid;
intent.putExtra("sid", sid);
String loginId = ABVDataCache.getInstance().getMemberInfo().loginId;
String shopName = ABVDataCache.getInstance().getUrlPath();
intent.putExtra("loginId", loginId);
intent.putExtra("collaborationType", collaborationType);
intent.putExtra("shopName", shopName);
intent.putExtra("roomId", roomId);
intent.putExtra("roomName", roomName);
intent.putExtra("roomType", roomType);
String nextActivity = null;
if (fromClassName.equals(HTMLWebViewActivity.class.getName())) {
nextActivity = OperationListActivity.class.getName();
} else if(fromClassName.equals(ContentViewActivity.class.getName())){
nextActivity = OperationRelatedContentActivity.class.getName();
} else {
nextActivity = className;
}
intent.setClassName(mContext.getPackageName(), nextActivity);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getCurrentActivity().startActivity(intent);
}
......@@ -1914,26 +1958,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
this.previousOfSettingActivity2 = activity;
}
public void startChatWebViewActivityWithCollaboration(Long roomId, String roomName, String collaborationType, String roomType) {
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/");
String sid = ABVDataCache.getInstance().getMemberInfo().sid;
intent.putExtra("sid", sid);
String loginId = ABVDataCache.getInstance().getMemberInfo().loginId;
String shopName = ABVDataCache.getInstance().getUrlPath();
intent.putExtra("loginId", loginId);
intent.putExtra("collaborationType", collaborationType);
intent.putExtra("shopName", shopName);
intent.putExtra("roomId", roomId);
intent.putExtra("roomName", roomName);
intent.putExtra("roomType", roomType);
intent.setClassName(mContext.getPackageName(), className);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getCurrentActivity().startActivity(intent);
}
/**
* 図面タイプのみ利用
* OZ画面閉じた後、タスクアイコンの再描画
......
......@@ -34,8 +34,6 @@ public class CommunicationWebViewActivity extends ABVAuthenticatedActivity {
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() {
......
......@@ -76,7 +76,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;
import java.util.concurrent.ConcurrentHashMap;
import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON;
......@@ -94,6 +93,7 @@ import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ExceptionHandler;
import jp.agentec.abook.abv.bl.common.log.Logger;
......@@ -119,8 +119,8 @@ 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.launcher.android.R.id;
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.activity.ShowPushMessageDailogActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppColor;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey;
......@@ -137,8 +137,6 @@ import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.common.view.ABVEditText;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.common.vo.Size;
import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.Interface.MovePageInterface;
......@@ -3829,6 +3827,14 @@ public class ContentViewActivity extends ABVContentViewActivity {
Uri[] result = null;
Uri dataUri = null;
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK) {
// Activityを閉じて遷移する
exitActivity();
}
return;
}
if (intent != null && resultCode == RESULT_OK) {
String dataString = intent.getDataString();
if (dataString != null) {
......@@ -3844,7 +3850,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
isAnotherViewOpenFlg = false;
// playPageBGMSound(mCurrentPageNumber); //프리뷰 모드 일때 음악재생 Bug
break;
case ABOOK_CHECK_TASK_IMAGE:
case ABookCommConstants.ABOOK_CHECK_TASK_IMAGE:
if (mUploadMessage == null) {
return;
}
......@@ -3865,7 +3871,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107);
}
break;
case ABOOK_CHECK_TASK_VIDEO:
case ABookCommConstants.ABOOK_CHECK_TASK_VIDEO:
if (mUploadMessage == null) {
return;
}
......@@ -5534,5 +5540,31 @@ public class ContentViewActivity extends ABVContentViewActivity {
operationTaskLayout.setIconStatus(taskKey,false);
}
/**
* プッシュメッセージ受信後のダイアログを表示処理。
*/
public void showChatRoomPopupMessage(
String textMessage,
String data,
String operationID,
Long roomID,
String roomName,
String roomType,
String pushSendLoginId,
long pushSendDate,
String collaborationType
) {
String fromClassName = getClass().getName();
Intent pushMsgDialog = new Intent(ContentViewActivity.this, ShowPushMessageDailogActivity.class);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, textMessage);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, data);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, operationID);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, roomID);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.fromClassName ,fromClassName);
startActivityForResult(pushMsgDialog, ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE);
}
}
......@@ -32,6 +32,7 @@ import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
......@@ -42,6 +43,8 @@ import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ShowPushMessageDailogActivity;
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.constant.NaviConsts;
......@@ -219,10 +222,10 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
FileChooserParams fileChooserParams) {
boolean result = false;
if (fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.IMAGE) != -1) {
result = startCameraIntent(ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
result = startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
} else if (fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.VIDEO) != -1) {
result = startCameraIntent(ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true);
result = startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true);
}
if (result) {
......@@ -685,6 +688,15 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK) {
// Activityを閉じて遷移する
finishActivity();
}
return;
}
Uri[] result = null;
Uri dataUri = null;
if (intent != null && resultCode == RESULT_OK) {
......@@ -695,7 +707,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
}
if (requestCode == ABOOK_CHECK_TASK_IMAGE) {
if (requestCode == ABookCommConstants.ABOOK_CHECK_TASK_IMAGE) {
if (mUploadMessage == null) {
return;
}
......@@ -715,16 +727,44 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
mUploadMessage.onReceiveValue(null);
ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107);
}
} else if (requestCode == ABOOK_CHECK_TASK_VIDEO) {
} else if (requestCode == ABookCommConstants.ABOOK_CHECK_TASK_VIDEO) {
if (mUploadMessage == null) {
return;
}
mUploadMessage.onReceiveValue(result);
} else if (requestCode == ABOOK_CHECK_SELECT_SCENE) {
} else if (requestCode == ABookCommConstants.ABOOK_CHECK_SELECT_SCENE) {
if (intent != null && result != null) {
confirmEntrySceneDialog(result[0]);
}
}
mUploadMessage = null;
}
/**
* プッシュメッセージ受信後のダイアログを表示処理。
*/
public void showChatRoomPopupMessage(
  • これって共通化できないのでしょうか? 親クラスとかで、、

Please register or sign in to reply
String textMessage,
String data,
String operationID,
Long roomID,
String roomName,
String roomType,
String pushSendLoginId,
long pushSendDate,
String collaborationType
) {
String fromClassName = getClass().getName();
Intent pushMsgDialog = new Intent(HTMLWebViewActivity.this, ShowPushMessageDailogActivity.class);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, textMessage);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, data);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, operationID);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, roomID);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.fromClassName ,fromClassName);
startActivityForResult(pushMsgDialog, ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE);
}
}
......@@ -37,6 +37,7 @@ 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.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
......@@ -224,9 +225,9 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
Logger.d(TAG, "*********************commonOpenFileChooser");
boolean result = false;
if (acceptType.toLowerCase().indexOf(ABookKeys.IMAGE) != -1) {
result = startCameraIntent(ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
result = startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
} else if (acceptType.toLowerCase().indexOf(ABookKeys.VIDEO) != -1) {
result = startCameraIntent(ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true);
result = startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true);
}
mUploadMessage = uploadFile;
if (result) {
......@@ -713,7 +714,7 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
Uri result = (intent == null || resultCode != RESULT_OK) ? null : intent.getData();
if (requestCode == ABOOK_CHECK_TASK_IMAGE) {
if (requestCode == ABookCommConstants.ABOOK_CHECK_TASK_IMAGE) {
if (mUploadMessage == null) {
return;
}
......@@ -729,13 +730,13 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
mUploadMessage.onReceiveValue(null);
ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107);
}
} else if (requestCode == ABOOK_CHECK_TASK_VIDEO) {
} else if (requestCode == ABookCommConstants.ABOOK_CHECK_TASK_VIDEO) {
if (mUploadMessage == null) {
return;
}
// 動画
mUploadMessage.onReceiveValue(result);
} else if (requestCode == ABOOK_CHECK_SELECT_SCENE) {
} else if (requestCode == ABookCommConstants.ABOOK_CHECK_SELECT_SCENE) {
if (intent != null && result != null) {
confirmEntrySceneDialog(result);
}
......
......@@ -23,6 +23,7 @@ import org.json.adf.JSONObject;
import java.util.List;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
......@@ -131,10 +132,10 @@ public class OperationTaskLayout extends RelativeLayout {
FileChooserParams fileChooserParams) {
boolean result = false;
if(fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.IMAGE) != -1) {
result = ((ABVActivity)context).startCameraIntent(((ABVContentViewActivity)context).ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
result = ((ABVActivity)context).startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
} else if(fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.VIDEO) != -1) {
result = ((ABVActivity)context).startCameraIntent(((ABVContentViewActivity)context).ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true);
result = ((ABVActivity)context).startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true);
}
if (result) {
......
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