#43368 AndroidとiOSで画面遷移を同じにした。
Showing
... | @@ -48,9 +48,9 @@ public class ChatPushDataJSON extends AcmsCommonJSON { | ... | @@ -48,9 +48,9 @@ public class ChatPushDataJSON extends AcmsCommonJSON { |
} | } | ||
PushMessageDto pushMessageDto = new PushMessageDto(); | PushMessageDto pushMessageDto = new PushMessageDto(); | ||
String tempDate = DateTimeUtil.toString(DateTimeUtil.toDate(pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate), DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmmssSSS_none); | 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("messageId","messageId : " + pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate)); | ||
Logger.d("oerationId","oerationId : " + pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate)+1); | //Logger.d("oerationId","oerationId : " + pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate)+1); | ||
Logger.d("date","date : " + tempDate); | //Logger.d("date","date : " + tempDate); | ||
Please
register
or
sign in
to reply
|
|||
pushMessageDto.pushMessageId = Long.valueOf(tempDate); | pushMessageDto.pushMessageId = Long.valueOf(tempDate); | ||
pushMessageDto.operationId = Long.valueOf(tempDate+1); | pushMessageDto.operationId = Long.valueOf(tempDate+1); | ||
pushMessageDto.pushSendLoginId = pushMessagetJsonArray.getJSONObject(k).getString(PushSendLoginId); | pushMessageDto.pushSendLoginId = pushMessagetJsonArray.getJSONObject(k).getString(PushSendLoginId); | ||
... | ... |
... | @@ -28,8 +28,12 @@ import jp.agentec.abook.abv.launcher.android.R; | ... | @@ -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.activity.ShowPushMessageDailogActivity; | ||
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; | 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.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.activity.SplashScreenActivity; | ||
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; | 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; | import jp.agentec.adf.util.StringUtil; | ||
public class ABVFcmListenerService extends FirebaseMessagingService { | public class ABVFcmListenerService extends FirebaseMessagingService { | ||
... | @@ -101,7 +105,15 @@ public class ABVFcmListenerService extends FirebaseMessagingService { | ... | @@ -101,7 +105,15 @@ public class ABVFcmListenerService extends FirebaseMessagingService { |
if (textMessage.contains(INVITE_COLLABORATION)) { | if (textMessage.contains(INVITE_COLLABORATION)) { | ||
String roomType = Integer.toString(json.getInt(AppDefType.ChatPushMessageKey.roomType)); | String roomType = Integer.toString(json.getInt(AppDefType.ChatPushMessageKey.roomType)); | ||
String[] inviteMessage = textMessage.split(CHAT_MESSAGE_SEPERATOR); | 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; | return; | ||
} | } | ||
} | } | ||
... | @@ -110,7 +122,15 @@ public class ABVFcmListenerService extends FirebaseMessagingService { | ... | @@ -110,7 +122,15 @@ public class ABVFcmListenerService extends FirebaseMessagingService { |
String data = msg.get(AppDefType.PushMessageKey.data); | String data = msg.get(AppDefType.PushMessageKey.data); | ||
String operationID = msg.get(AppDefType.PushMessageKey.operationId); | String operationID = msg.get(AppDefType.PushMessageKey.operationId); | ||
if (roomName.length() > 0) { | if (roomName.length() > 0) { | ||
showChatRoomPopupMessage(tempMsg, data, operationID, roomId, roomName, pushSendLoginId, pushSendDate); | showChatRoomPopupMessage(tempMsg, | ||
data, | |||
operationID, | |||
roomId, | |||
roomName, | |||
"", | |||
pushSendLoginId, | |||
pushSendDate, | |||
""); | |||
} else { | } else { | ||
showOperationPopUpMessage(tempMsg, data, operationID); | showOperationPopUpMessage(tempMsg, data, operationID); | ||
} | } | ||
... | @@ -127,6 +147,9 @@ public class ABVFcmListenerService extends FirebaseMessagingService { | ... | @@ -127,6 +147,9 @@ public class ABVFcmListenerService extends FirebaseMessagingService { |
} | } | ||
private void showCollaborationPopUpMessage( | private void showCollaborationPopUpMessage( | ||
String textMessage, | |||
String data, | |||
String operationID, | |||
Long roomId, | Long roomId, | ||
String roomName, | String roomName, | ||
String roomType, | String roomType, | ||
... | @@ -134,17 +157,21 @@ public class ABVFcmListenerService extends FirebaseMessagingService { | ... | @@ -134,17 +157,21 @@ public class ABVFcmListenerService extends FirebaseMessagingService { |
long pushSendDate, | long pushSendDate, | ||
String collaborationType) | String collaborationType) | ||
{ | { | ||
Activity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity(); | |||
String fromClassName = currentActivity.getClass().getName(); | |||
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class); | Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class); | ||
String collaobrationInvitedMessage = getString(R.string.msg_invite_collaboration); | |||
pushMsgDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | 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.roomId, roomId); | ||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName); | pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName); | ||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType); | |||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId); | pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId); | ||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate); | pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate); | ||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType); | pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType); | ||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType); | pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.fromClassName, fromClassName); | ||
startActivity(pushMsgDialog); | startActivity(pushMsgDialog); | ||
} | } | ||
... | @@ -154,9 +181,11 @@ public class ABVFcmListenerService extends FirebaseMessagingService { | ... | @@ -154,9 +181,11 @@ public class ABVFcmListenerService extends FirebaseMessagingService { |
String operationID, | String operationID, | ||
Long roomID, | Long roomID, | ||
String roomName, | String roomName, | ||
String roomType, | |||
String pushSendLoginId, | String pushSendLoginId, | ||
long pushSendDate) | long pushSendDate, | ||
{ | String collaborationType | ||
) { | |||
Activity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity(); | Activity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity(); | ||
if (currentActivity.getClass().equals(ChatWebViewActivity.class)) { | if (currentActivity.getClass().equals(ChatWebViewActivity.class)) { | ||
ChatWebViewActivity chatWebViewActivity = (ChatWebViewActivity) currentActivity; | ChatWebViewActivity chatWebViewActivity = (ChatWebViewActivity) currentActivity; | ||
... | @@ -165,16 +194,29 @@ public class ABVFcmListenerService extends FirebaseMessagingService { | ... | @@ -165,16 +194,29 @@ public class ABVFcmListenerService extends FirebaseMessagingService { |
return; | return; | ||
} | } | ||
} | } | ||
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class); | // プッシュメッセージは、受信した時のActivityで処理をわける(後処理が違うので) | ||
pushMsgDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | String fromClassName = currentActivity.getClass().getName(); | ||
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, textMessage); | if (currentActivity.getClass().equals(HTMLWebViewActivity.class)){ | ||
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, data); | ((HTMLWebViewActivity)currentActivity).showChatRoomPopupMessage(textMessage, data, operationID, roomID, roomName, roomType, pushSendLoginId, pushSendDate, collaborationType); | ||
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, operationID); | } else if (currentActivity.getClass().equals(ContentViewActivity.class)){ | ||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, roomID); | ((ContentViewActivity)currentActivity).showChatRoomPopupMessage(textMessage, data, operationID, roomID, roomName, roomType, pushSendLoginId, pushSendDate, collaborationType); | ||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName); | } else if (currentActivity.getClass().equals(OperationRelatedContentActivity.class)){ | ||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId); | ((ContentViewActivity)currentActivity).showChatRoomPopupMessage(textMessage, data, operationID, roomID, roomName, roomType, pushSendLoginId, pushSendDate, collaborationType); | ||
|
|||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate); | } else { | ||
startActivity(pushMsgDialog); | Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class); | ||
pushMsgDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |||
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.fromClassName, fromClassName); | |||
startActivity(pushMsgDialog); | |||
} | |||
} | } | ||
private void showOperationPopUpMessage(String textMessage, String data, String operationID) { | private void showOperationPopUpMessage(String textMessage, String data, String operationID) { | ||
... | ... |
... | @@ -32,6 +32,7 @@ import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType; | ... | @@ -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.ABVEnvironment; | ||
import jp.agentec.abook.abv.bl.common.CommonExecutor; | import jp.agentec.abook.abv.bl.common.CommonExecutor; | ||
import jp.agentec.abook.abv.bl.common.Constant; | 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.constant.ABookKeys; | ||
import jp.agentec.abook.abv.bl.common.log.Logger; | import jp.agentec.abook.abv.bl.common.log.Logger; | ||
import jp.agentec.abook.abv.bl.data.ABVDataCache; | import jp.agentec.abook.abv.bl.data.ABVDataCache; | ||
... | @@ -42,6 +43,8 @@ import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification; | ... | @@ -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.bl.dto.OperationDto; | ||
import jp.agentec.abook.abv.cl.util.ContentLogUtil; | import jp.agentec.abook.abv.cl.util.ContentLogUtil; | ||
import jp.agentec.abook.abv.launcher.android.R; | 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.ErrorCode; | ||
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; | import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; | ||
import jp.agentec.abook.abv.ui.common.constant.NaviConsts; | import jp.agentec.abook.abv.ui.common.constant.NaviConsts; | ||
... | @@ -219,10 +222,10 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { | ... | @@ -219,10 +222,10 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { |
FileChooserParams fileChooserParams) { | FileChooserParams fileChooserParams) { | ||
boolean result = false; | boolean result = false; | ||
if (fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.IMAGE) != -1) { | 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) { | } 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) { | if (result) { | ||
... | @@ -685,6 +688,15 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { | ... | @@ -685,6 +688,15 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { |
@Override | @Override | ||
protected void onActivityResult(int requestCode, int resultCode, Intent intent) { | protected void onActivityResult(int requestCode, int resultCode, Intent intent) { | ||
super.onActivityResult(requestCode, resultCode, 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[] result = null; | ||
Uri dataUri = null; | Uri dataUri = null; | ||
if (intent != null && resultCode == RESULT_OK) { | if (intent != null && resultCode == RESULT_OK) { | ||
... | @@ -695,7 +707,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { | ... | @@ -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) { | if (mUploadMessage == null) { | ||
return; | return; | ||
} | } | ||
... | @@ -715,16 +727,44 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { | ... | @@ -715,16 +727,44 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { |
mUploadMessage.onReceiveValue(null); | mUploadMessage.onReceiveValue(null); | ||
ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107); | ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107); | ||
} | } | ||
} else if (requestCode == ABOOK_CHECK_TASK_VIDEO) { | } else if (requestCode == ABookCommConstants.ABOOK_CHECK_TASK_VIDEO) { | ||
if (mUploadMessage == null) { | if (mUploadMessage == null) { | ||
return; | return; | ||
} | } | ||
mUploadMessage.onReceiveValue(result); | mUploadMessage.onReceiveValue(result); | ||
} else if (requestCode == ABOOK_CHECK_SELECT_SCENE) { | } else if (requestCode == ABookCommConstants.ABOOK_CHECK_SELECT_SCENE) { | ||
if (intent != null && result != null) { | if (intent != null && result != null) { | ||
confirmEntrySceneDialog(result[0]); | confirmEntrySceneDialog(result[0]); | ||
} | } | ||
} | } | ||
mUploadMessage = null; | mUploadMessage = null; | ||
} | } | ||
/** | |||
* プッシュメッセージ受信後のダイアログを表示処理。 | |||
*/ | |||
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(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); | |||
} | |||
} | } |