#43368 AndroidとiOSで画面遷移を同じにした。
Showing
... | ... | @@ -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); | ||
... | ... |
... | ... | @@ -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,16 +194,29 @@ public class ABVFcmListenerService extends FirebaseMessagingService { |
return; | ||
} | ||
} | ||
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.pushSendLoginId, pushSendLoginId); | ||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate); | ||
startActivity(pushMsgDialog); | ||
// プッシュメッセージは、受信した時の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); | ||
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) { | ||
... | ... |
... | ... | @@ -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( | ||
|
||
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); | ||
} | ||
} |