遠隔支援(会議室)接続中には、プッシュメッセージを受信してもチャットに行かないように修正。
Showing
... | @@ -12,6 +12,7 @@ import jp.agentec.abook.abv.bl.dto.PushMessageDto; | ... | @@ -12,6 +12,7 @@ import jp.agentec.abook.abv.bl.dto.PushMessageDto; |
import jp.agentec.abook.abv.bl.logic.AbstractLogic; | import jp.agentec.abook.abv.bl.logic.AbstractLogic; | ||
import jp.agentec.abook.abv.bl.logic.OperationLogic; | import jp.agentec.abook.abv.bl.logic.OperationLogic; | ||
import jp.agentec.abook.abv.bl.logic.PushMessageLogic; | import jp.agentec.abook.abv.bl.logic.PushMessageLogic; | ||
import jp.agentec.abook.abv.bl.websocket.MeetingManager; | |||
import jp.agentec.abook.abv.launcher.android.R; | import jp.agentec.abook.abv.launcher.android.R; | ||
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; | import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; | ||
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PushMessageKey; | import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PushMessageKey; | ||
... | @@ -29,6 +30,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity { | ... | @@ -29,6 +30,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity { |
private static final String TAG = "ShowPushMessageDailogActivity"; | private static final String TAG = "ShowPushMessageDailogActivity"; | ||
OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class); | OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class); | ||
boolean isMeetingRoomConnected = false; | |||
@Override | @Override | ||
protected void onCreate(Bundle savedInstanceState) { | protected void onCreate(Bundle savedInstanceState) { | ||
... | @@ -121,56 +123,78 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity { | ... | @@ -121,56 +123,78 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity { |
alertDialog.setPositiveButton(R.string.move, new DialogInterface.OnClickListener() { | alertDialog.setPositiveButton(R.string.move, new DialogInterface.OnClickListener() { | ||
@Override | @Override | ||
public void onClick(DialogInterface dialog, int which) { | public void onClick(DialogInterface dialog, int which) { | ||
isMeetingRoomConnected = MeetingManager.getInstance().isConnected(); | |||
// Check PushMessage | // Check PushMessage | ||
Bundle extras = getIntent().getExtras(); | Bundle extras = getIntent().getExtras(); | ||
if (extras != null) { | if (extras != null && !isMeetingRoomConnected) { | ||
Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0); | moveChatRoom(extras); | ||
String roomName = extras.getString(AppDefType.ChatPushMessageKey.roomName); | finish(); | ||
String pushSendLoginId = extras.getString(AppDefType.ChatPushMessageKey.pushSendLoginId); | } | ||
long pushSendDate = extras.getLong(AppDefType.ChatPushMessageKey.pushSendDate); | if (isMeetingRoomConnected) { | ||
String collaborationType = extras.getString(AppDefType.ChatPushMessageKey.collaborationType); | showCannotMoveChatRoomDialog(); | ||
String roomType = extras.getString(AppDefType.ChatPushMessageKey.roomType); | |||
if (roomId > 0 && !StringUtil.isNullOrEmpty(roomName)) { | |||
List<PushMessageDto> pushMessageDtoList = AbstractLogic.getLogic(PushMessageLogic.class).getAllPushMessageList(); | |||
Logger.d("pushSendDate", "pushSendDate : " + pushSendDate); | |||
String pushSendDateDate = DateTimeUtil.toString(new Date(pushSendDate), DateTimeFormat.yyyyMMddHHmmssSSS_none); | |||
Logger.d("pushSendDate", "pushSendDateDate : " + pushSendDateDate); | |||
String pushSendDateDate2 = DateTimeUtil.toString(DateTimeUtil.toDate(pushSendDateDate, DateTimeFormat.yyyyMMddHHmmssSSS_none), DateTimeFormat.yyyyMMddHHmmssSSS_none); | |||
Logger.d("pushSendDate", "pushSendDateDate2 : " + pushSendDateDate2); | |||
for (int i = 0; i < pushMessageDtoList.size() - 1; i++) { | |||
String tempDate = DateTimeUtil.toString(pushMessageDtoList.get(i).pushSendDate, DateTimeFormat.yyyyMMddHHmmssSSS_none); | |||
Logger.d("tempDate", "date : " + tempDate); | |||
} | |||
if (StringUtil.isNullOrEmpty(collaborationType)) { | |||
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName); | |||
} else { | |||
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId, roomName, collaborationType, roomType); | |||
} | |||
} | |||
} | } | ||
finish(); | |||
} | } | ||
}); | }); | ||
alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { | alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { | ||
@Override | @Override | ||
public void onClick(DialogInterface dialog, int which) { | public void onClick(DialogInterface dialog, int which) { | ||
finish(); | finish(); | ||
} | } | ||
}); | }); | ||
} | } | ||
alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { | alertDialog.show(); | ||
} | |||
} | |||
} | |||
/** | |||
* チャットルームへ遷移するための処理 | |||
* @param extras | |||
*/ | |||
private void moveChatRoom(Bundle extras) { | |||
Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0); | |||
String roomName = extras.getString(AppDefType.ChatPushMessageKey.roomName); | |||
String pushSendLoginId = extras.getString(AppDefType.ChatPushMessageKey.pushSendLoginId); | |||
long pushSendDate = extras.getLong(AppDefType.ChatPushMessageKey.pushSendDate); | |||
String collaborationType = extras.getString(AppDefType.ChatPushMessageKey.collaborationType); | |||
String roomType = extras.getString(AppDefType.ChatPushMessageKey.roomType); | |||
if (roomId > 0 && !StringUtil.isNullOrEmpty(roomName)) { | |||
List<PushMessageDto> pushMessageDtoList = AbstractLogic.getLogic(PushMessageLogic.class).getAllPushMessageList(); | |||
Please
register
or
sign in
to reply
|
|||
Logger.d("pushSendDate", "pushSendDate : " + pushSendDate); | |||
String pushSendDateDate = DateTimeUtil.toString(new Date(pushSendDate), DateTimeFormat.yyyyMMddHHmmssSSS_none); | |||
Logger.d("pushSendDate", "pushSendDateDate : " + pushSendDateDate); | |||
String pushSendDateDate2 = DateTimeUtil.toString(DateTimeUtil.toDate(pushSendDateDate, DateTimeFormat.yyyyMMddHHmmssSSS_none), DateTimeFormat.yyyyMMddHHmmssSSS_none); | |||
Logger.d("pushSendDate", "pushSendDateDate2 : " + pushSendDateDate2); | |||
for (int i = 0; i < pushMessageDtoList.size() - 1; i++) { | |||
String tempDate = DateTimeUtil.toString(pushMessageDtoList.get(i).pushSendDate, DateTimeFormat.yyyyMMddHHmmssSSS_none); | |||
Logger.d("tempDate", "date : " + tempDate); | |||
} | |||
if (StringUtil.isNullOrEmpty(collaborationType)) { | |||
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName); | |||
} else { | |||
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId, roomName, collaborationType, roomType); | |||
} | |||
} | |||
} | |||
/** | |||
* 遠隔支援中(会議室接続中)はチャットルームにはいけない。 | |||
*/ | |||
private void showCannotMoveChatRoomDialog() { | |||
handler.post(new Runnable() { | |||
@Override | |||
public void run() { | |||
final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ShowPushMessageDailogActivity.this, "だー","もー"); | |||
alertDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { | |||
@Override | @Override | ||
public void onDismiss(DialogInterface dialog) { | public void onClick(DialogInterface dialog, int which) { | ||
finish(); | finish(); | ||
} | } | ||
}); | }); | ||
alertDialog.show(); | alertDialog.show(); | ||
} | } | ||
} | }); | ||
} | } | ||
} | } |