Commit 09e97798 by onuma

チャットルームへ遷移する関数を作成

parent d1d7ccfa
...@@ -5,6 +5,7 @@ import android.app.Notification; ...@@ -5,6 +5,7 @@ import android.app.Notification;
import android.app.NotificationChannel; import android.app.NotificationChannel;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.util.Log; import android.util.Log;
...@@ -25,11 +26,16 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic; ...@@ -25,11 +26,16 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.util.AppUtil; import jp.agentec.abook.abv.cl.util.AppUtil;
import jp.agentec.abook.abv.launcher.android.R; 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.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 {
...@@ -55,33 +61,24 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -55,33 +61,24 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
@Override @Override
public void onMessageReceived(RemoteMessage remoteMessage) { public void onMessageReceived(RemoteMessage remoteMessage) {
Map<String, String> msg = remoteMessage.getData(); Map<String, String> messageMap = remoteMessage.getData();
Logger.d(TAG,"onMessageReceived(): msg :"+ msg); Logger.d(TAG,"onMessageReceived(): messageMap :"+ messageMap);
try { try {
UserAuthenticateLogic logic = AbstractLogic.getLogic(UserAuthenticateLogic.class); UserAuthenticateLogic logic = AbstractLogic.getLogic(UserAuthenticateLogic.class);
MemberInfoDto memberInfo = logic.getMemberInfo(); MemberInfoDto memberInfo = logic.getMemberInfo();
boolean hasMessageBody = !StringUtil.isNullOrWhiteSpace(msg.get(AppDefType.PushMessageKey.message)); boolean hasMessageBody = !StringUtil.isNullOrWhiteSpace(messageMap.get(AppDefType.PushMessageKey.message));
boolean isPushMessageEnabled = this.getResources().getInteger(R.integer.push_message) == 1; boolean isPushMessageEnabled = this.getResources().getInteger(R.integer.push_message) == 1;
if (hasMessageBody && isPushMessageEnabled && memberInfo != null) { if (hasMessageBody && isPushMessageEnabled && memberInfo != null) {
// Check pushmessage by chat // Check pushmessage by chat
String tempMsg = msg.get(AppDefType.PushMessageKey.message); String messageBody = messageMap.get(AppDefType.PushMessageKey.message);
Long roomId = null;
String roomName = ""; String roomName = "";
String pushSendLoginId = "";
long pushSendDate = 0;
Log.d(TAG,"tempMsg : "+ tempMsg); Log.d(TAG,"messageBody : "+ messageBody);
if (Objects.requireNonNull(tempMsg).indexOf(AppDefType.ChatPushMessageKey.pushSendLoginId) > 0) {
JSONObject json = new JSONObject(tempMsg);
roomId = json.getLong(AppDefType.ChatPushMessageKey.roomId);
roomName = json.getString(AppDefType.ChatPushMessageKey.roomName);
pushSendLoginId = json.getString(AppDefType.ChatPushMessageKey.pushSendLoginId);
pushSendDate = json.getLong(AppDefType.ChatPushMessageKey.pushSendDate);
String textMessage = json.getString(AppDefType.PushMessageKey.message);
if (Objects.requireNonNull(messageBody).indexOf(AppDefType.ChatPushMessageKey.pushSendLoginId) > 0) {
PushMessageJSON json = new PushMessageJSON(messageBody);
roomName = json.getRoomName();
//TODO pushメッセージが到着した際、新着メッセージかルーム招待か判別してDB格納が必要 //TODO pushメッセージが到着した際、新着メッセージかルーム招待か判別してDB格納が必要
//Integer insertId = 0; //Integer insertId = 0;
//Integer messageType = 0; //Integer messageType = 0;
...@@ -89,37 +86,19 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -89,37 +86,19 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
//ChatMessageDto chatMessageDto = new ChatMessageDto(); //ChatMessageDto chatMessageDto = new ChatMessageDto();
//chatMessageDto.chatRoomId = //chatMessageDto.chatRoomId =
//chatRoomId shopMemberId messge messageType insertDate //chatRoomId shopMemberId messge messageType insertDate
if (textMessage.length() > 0) {
tempMsg = textMessage;
}
if (AppUtil.isAppForground(this)) {
msg.put(AppDefType.PushMessageKey.message, textMessage);
}
String roomType = null;
String[] inviteMessage;
if (textMessage.contains(INVITE_COLLABORATION)) {
roomType = Integer.toString(json.getInt(AppDefType.ChatPushMessageKey.roomType));
inviteMessage = textMessage.split(CHAT_MESSAGE_SEPERATOR);
//showCollaborationPopUpMessage(roomId, roomName, roomType, pushSendLoginId, pushSendDate, inviteMessage[1]);
//return;
Logger.i(TAG,"" + roomType);
Logger.i(TAG,"" + inviteMessage[1]);
}
} }
if (AppUtil.isAppForground(this)) { if (AppUtil.isAppForground(this)) {
String data = msg.get(AppDefType.PushMessageKey.data);
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);
showChatRoomPopupMessage(messageMap);
} else { } else {
showOperationPopUpMessage(tempMsg, data, operationID); String data = messageMap.get(AppDefType.PushMessageKey.data);
String operationID = messageMap.get(AppDefType.PushMessageKey.operationId);
showOperationPopUpMessage(messageBody, data, operationID);
} }
} else { } else {
sendNotification(msg); sendNotification(messageMap);
} }
} }
} catch (ABVException e) { } catch (ABVException e) {
...@@ -130,6 +109,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -130,6 +109,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
} }
} }
/*
private void showCollaborationPopUpMessage( private void showCollaborationPopUpMessage(
Long roomId, Long roomId,
String roomName, String roomName,
...@@ -151,34 +131,49 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -151,34 +131,49 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType); pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
startActivity(pushMsgDialog); startActivity(pushMsgDialog);
} }
*/
/**
* プッシュメッセージをダイアログ表示する
*/
private void showChatRoomPopupMessage(Map<String, String> messageMap) {
String messageBody = messageMap.get(AppDefType.PushMessageKey.message);
PushMessageJSON json;
if (StringUtil.isNullOrEmpty(messageBody)) {
return;
}
json = new PushMessageJSON(messageBody);
private void showChatRoomPopupMessage(
String textMessage,
String data,
String operationID,
Long roomID,
String roomName,
String pushSendLoginId,
long pushSendDate)
{
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;
if (chatWebViewActivity.getRoomID().equals(roomID)) { if (chatWebViewActivity.getRoomID().equals(json.getRoomId())) {
// push messageと同じ部屋にいる場合はpushmessageを送信しない。 // push messageと同じ部屋にいる場合はpushmessageを送信しない。
return; return;
} }
} }
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
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); currentActivity.getClass().equals(ContentViewActivity.class) ||
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, operationID); currentActivity.getClass().equals(OperationRelatedContentActivity.class) ||
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, roomID); currentActivity.getClass().equals(OperationListActivity.class)
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName); ){
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId); // 呼び出し元のActivity名を保存しておく
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate); messageMap.put(AppDefType.ChatPushMessageKey.fromClassName, fromClassName);
startActivity(pushMsgDialog); ((ABVAuthenticatedActivity)currentActivity).showChatRoomPopupMessage((Context)currentActivity, messageMap);
} else {
// 既存の処理
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
pushMsgDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, json.getMessage());
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, json.getData());
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, json.getOperationID());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, json.getRoomId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, json.getRoomName());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, json.getPushSendLoginId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, json.getPushSendDate());
startActivity(pushMsgDialog);
}
} }
private void showOperationPopUpMessage(String textMessage, String data, String operationID) { private void showOperationPopUpMessage(String textMessage, String data, String operationID) {
...@@ -190,6 +185,10 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -190,6 +185,10 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
startActivity(pushMsgDialog); startActivity(pushMsgDialog);
} }
/**
* アプリがバックグラウンドなので通知エリアにアイコン表示する。
* アイコンタップ時の情報を作成する。
*/
private void sendNotification(Map<String, String> message) { private void sendNotification(Map<String, String> message) {
Intent intent = instantiatePushNotificationIntent(message); Intent intent = instantiatePushNotificationIntent(message);
...@@ -206,7 +205,6 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -206,7 +205,6 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
mNotificationManager.notify(uniqueId, notification); mNotificationManager.notify(uniqueId, notification);
} }
} else { } else {
//mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
Notification.Builder nb = getNotificationBuilder(pendingIntent, message); Notification.Builder nb = getNotificationBuilder(pendingIntent, message);
...@@ -266,8 +264,6 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -266,8 +264,6 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
roomType = Integer.toString(json.getInt(AppDefType.ChatPushMessageKey.roomType)); roomType = Integer.toString(json.getInt(AppDefType.ChatPushMessageKey.roomType));
String[] inviteMessage = textMessage.split(CHAT_MESSAGE_SEPERATOR); String[] inviteMessage = textMessage.split(CHAT_MESSAGE_SEPERATOR);
collaborationType = inviteMessage[1]; collaborationType = inviteMessage[1];
//showCollaborationPopUpMessage(roomId, roomName, roomType, pushSendLoginId, pushSendDate, inviteMessage[1]);
//return;
} }
String roomName = json.getString(AppDefType.ChatPushMessageKey.roomName); String roomName = json.getString(AppDefType.ChatPushMessageKey.roomName);
String pushMsg = json.getString(AppDefType.PushMessageKey.message); String pushMsg = json.getString(AppDefType.PushMessageKey.message);
...@@ -280,8 +276,9 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -280,8 +276,9 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
long roomId = json.getLong(AppDefType.ChatPushMessageKey.roomId); long roomId = json.getLong(AppDefType.ChatPushMessageKey.roomId);
long pushSendDate = json.getLong(AppDefType.ChatPushMessageKey.pushSendDate); long pushSendDate = json.getLong(AppDefType.ChatPushMessageKey.pushSendDate);
String pushSendLoginId = json.getString(AppDefType.ChatPushMessageKey.pushSendLoginId); String pushSendLoginId = json.getString(AppDefType.ChatPushMessageKey.pushSendLoginId);
//String roomType = json.getString(AppDefType.ChatPushMessageKey.roomType); String collaobrationInvitedMessage = getContentText(textMessage);
intent.putExtra(AppDefType.PushMessageKey.message, collaobrationInvitedMessage);
intent.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId); intent.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId);
intent.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName); intent.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName);
intent.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId); intent.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId);
...@@ -293,13 +290,14 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -293,13 +290,14 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
} }
private Notification.Builder getNotificationBuilder(PendingIntent pendingIntent, Map<String, String> message) { private Notification.Builder getNotificationBuilder(PendingIntent pendingIntent, Map<String, String> message) {
String txtMessage = getContentText(message.get(AppDefType.PushMessageKey.message));
return new Notification.Builder(this) return new Notification.Builder(this)
.setDefaults(Notification.DEFAULT_ALL) .setDefaults(Notification.DEFAULT_ALL)
.setSmallIcon(R.drawable.icon) .setSmallIcon(R.drawable.icon)
.setWhen(System.currentTimeMillis()) .setWhen(System.currentTimeMillis())
.setAutoCancel(true) .setAutoCancel(true)
.setContentTitle(getString(R.string.app_name)) .setContentTitle(getString(R.string.app_name))
.setContentText(message.get(AppDefType.PushMessageKey.message)) .setContentText(txtMessage)
.setContentIntent(pendingIntent); .setContentIntent(pendingIntent);
} }
...@@ -310,4 +308,25 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -310,4 +308,25 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
} }
return downloadUrl; return downloadUrl;
} }
/**
* 通知エリアに表示するテキストを決定する
* @param textMessage プッシュメッセージをJSONOjbcetにした時の、AppDefType.PushMessageKey.message の値
* @return 表示するテキスト
*/
private String getContentText(String textMessage) {
if (!StringUtil.isNullOrEmpty(textMessage) && textMessage.contains(INVITE_COLLABORATION)) {
return getString(R.string.msg_invite_collaboration);
}
return textMessage;
}
/**
* プッシュメッセージからJSONObjectを作成する。
* @param jsonText 受信したプッシュメッセージをJSONObjectにする。
* @return
*/
private JSONObject createMessageJsonObject(String jsonText) {
return new JSONObject(jsonText);
}
} }
...@@ -30,6 +30,7 @@ import com.google.firebase.iid.FirebaseInstanceId; ...@@ -30,6 +30,7 @@ import com.google.firebase.iid.FirebaseInstanceId;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
...@@ -40,6 +41,7 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment; ...@@ -40,6 +41,7 @@ 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.AlertMessageLevel; import jp.agentec.abook.abv.bl.common.Constant.AlertMessageLevel;
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.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode; import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
...@@ -67,6 +69,7 @@ import jp.agentec.abook.abv.bl.logic.MemoLogic; ...@@ -67,6 +69,7 @@ import jp.agentec.abook.abv.bl.logic.MemoLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic; import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler; import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler;
import jp.agentec.abook.abv.cl.push.PushMessageJSON;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.cl.util.StorageUtil; import jp.agentec.abook.abv.cl.util.StorageUtil;
import jp.agentec.abook.abv.launcher.android.ABVApplication; import jp.agentec.abook.abv.launcher.android.ABVApplication;
...@@ -158,6 +161,13 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -158,6 +161,13 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
int PAYMENT = 3; int PAYMENT = 3;
} }
// ABookCommunicationでチャットの情報を格納しておく
private Long roomId = new Long(0);
private String roomName = "";
private String collaborationType = "";
private String roomType = "";
private String fromClassName = "";
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
...@@ -1235,4 +1245,129 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1235,4 +1245,129 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
return existUnreadFlg; return existUnreadFlg;
} }
/**
* プッシュメッセージ受信後のダイアログを表示する。
* @param context コンテキスト
* @param textMessage プッシュメッセージ
* @param data Intentに付属するデータ
* @param operationID operationID
* @param roomID roomID
* @param roomName roomName
* @param roomType roomType
* @param pushSendLoginId pushSendLoginId
* @param pushSendDate pushSendDate
* @param collaborationType ABookCommConstants.COLLABORATION_TYPE のいずれか
*/
/**
public void showChatRoomPopupMessage(
Context context,
String textMessage,
String data,
String operationID,
Long roomID,
String roomName,
String roomType,
String pushSendLoginId,
long pushSendDate,
String collaborationType,
String fromClassName
) {
Intent pushMsgDialog = new Intent(context, 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);
this.roomId = roomID;
this.roomName = roomName;
this.collaborationType = collaborationType;
this.roomType = roomType;
this.fromClassName = fromClassName;
startActivityForResult(pushMsgDialog, ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE);
}
*/
/**
* チャットルームへ遷移する。
*/
/**
public void goChatRoom() {
if (roomId <= 0 && StringUtil.isNullOrEmpty(roomName)) {
return;
}
if (StringUtil.isNullOrEmpty(collaborationType)) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName, "");
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId, roomName, collaborationType, roomType, "");
}
}
*/
/**
* ッシュメッセージがあるので、チャットルームに遷移する。
*/
public void goChatRoom(final Intent intent, final String fromClassName) {
if (!StringUtil.isNullOrEmpty(intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') > 0) {
handler.postDelayed(new Runnable() {
@Override
public void run() {
Logger.d(TAG,"fromClassName = " + fromClassName);
if (!StringUtil.isNullOrEmpty(intent.getStringExtra(AppDefType.ChatPushMessageKey.roomType)) &&
!StringUtil.isNullOrEmpty(intent.getStringExtra(AppDefType.ChatPushMessageKey.collaborationType))
) {
// roomTypeと、collaborationType が存在する場合は、協業を開始する。
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(
intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName),
intent.getStringExtra(AppDefType.ChatPushMessageKey.collaborationType),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomType),
intent.getStringExtra(AppDefType.ChatPushMessageKey.fromClassName));
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(
intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName),"");
}
}
}, 500);
}
}
/**
* プッシュメッセージ受信後のダイアログを表示する。
* @param context コンテキスト
* @param messageMap プッシュメッセージ
*/
public void showChatRoomPopupMessage(Context context, Map<String, String> messageMap) {
String messageBody = messageMap.get(AppDefType.PushMessageKey.message);
PushMessageJSON json;
if (StringUtil.isNullOrEmpty(messageBody)) {
return;
}
json = new PushMessageJSON(messageBody);
Intent pushMsgDialog = new Intent(context, ShowPushMessageDailogActivity.class);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, json.getMessage());
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, json.getData());
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, json.getOperationID());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, json.getRoomId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, json.getRoomName());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, json.getPushSendLoginId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, json.getPushSendDate());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.fromClassName, messageMap.get(AppDefType.ChatPushMessageKey.fromClassName));
/**
this.roomId = roomID;
this.roomName = roomName;
this.collaborationType = collaborationType;
this.roomType = roomType;
this.fromClassName = fromClassName;
*/
startActivityForResult(pushMsgDialog, ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE);
}
} }
...@@ -3,6 +3,7 @@ package jp.agentec.abook.abv.ui.common.activity; ...@@ -3,6 +3,7 @@ package jp.agentec.abook.abv.ui.common.activity;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Bundle; 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.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
...@@ -123,7 +124,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity { ...@@ -123,7 +124,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
isCollabration = MeetingManager.getInstance().isCollaboration(); isCollabration = MeetingManager.getInstance().isCollaboration();
Bundle extras = getIntent().getExtras(); Bundle extras = getIntent().getExtras();
if (extras != null && !isMeetingRoomConnected) { if (extras != null && !isMeetingRoomConnected) {
moveChatRoom(extras); setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK, getIntent());
finish(); finish();
} }
if (isMeetingRoomConnected || isCollabration) { if (isMeetingRoomConnected || isCollabration) {
...@@ -134,6 +135,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity { ...@@ -134,6 +135,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
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) {
setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.CANCEL, getIntent());
finish(); finish();
} }
}); });
...@@ -147,6 +149,8 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity { ...@@ -147,6 +149,8 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
* チャットルームへ遷移するための処理 * チャットルームへ遷移するための処理
* @param extras * @param extras
*/ */
/** ここでチャットルームには移動させない */
/**
private void moveChatRoom(Bundle extras) { private void moveChatRoom(Bundle extras) {
Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0); Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0);
String roomName = extras.getString(AppDefType.ChatPushMessageKey.roomName); String roomName = extras.getString(AppDefType.ChatPushMessageKey.roomName);
...@@ -161,6 +165,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity { ...@@ -161,6 +165,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
} }
} }
} }
*/
/** /**
* 遠隔支援中(会議室接続中)はチャットルームにはいけない。 * 遠隔支援中(会議室接続中)はチャットルームにはいけない。
......
...@@ -776,6 +776,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -776,6 +776,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
/** /**
* 作業一覧へ遷移 * 作業一覧へ遷移
*
*/ */
public void backToHome() { public void backToHome() {
mChatWebView.leaveRoom(); mChatWebView.leaveRoom();
......
...@@ -63,6 +63,7 @@ import jp.agentec.abook.abv.bl.common.CommonExecutor; ...@@ -63,6 +63,7 @@ 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.ReportType; import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.common.Constant.TaskReportLevel; import jp.agentec.abook.abv.bl.common.Constant.TaskReportLevel;
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.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode; import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
...@@ -354,24 +355,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -354,24 +355,6 @@ public class OperationListActivity extends ABVUIActivity {
alertDialog.show(); alertDialog.show();
} }
} }
// プッシュメッセージがある場合
else if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') > 0) {
if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomType)) &&
!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.ChatPushMessageKey.collaborationType))
) {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName),
getIntent().getStringExtra(AppDefType.ChatPushMessageKey.collaborationType),
getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomType));
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(
getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName));
}
}
// リスト更新 // リスト更新
setOperationListView(); setOperationListView();
...@@ -532,6 +515,11 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -532,6 +515,11 @@ public class OperationListActivity extends ABVUIActivity {
return; return;
} }
refreshOperationList(); refreshOperationList();
// プッシュメッセージがある場合の処理
getIntent().putExtra(AppDefType.ChatPushMessageKey.fromClassName, this.getClass().getName());
goChatRoom(getIntent(), "");
// 報告画面から作業一覧へ戻った時の同期処理 // 報告画面から作業一覧へ戻った時の同期処理
final long operationId = getUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L); final long operationId = getUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L);
if (operationId != -1) { if (operationId != -1) {
...@@ -569,6 +557,37 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -569,6 +557,37 @@ public class OperationListActivity extends ABVUIActivity {
configurationToolbarIcon(); configurationToolbarIcon();
} }
/**
* ッシュメッセージがあるので、チャットルームに遷移する。
*/
/*
public void goChatRoom(final Intent intent) {
if (!StringUtil.isNullOrEmpty(intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') > 0) {
handler.postDelayed(new Runnable() {
@Override
public void run() {
if (!StringUtil.isNullOrEmpty(intent.getStringExtra(AppDefType.ChatPushMessageKey.roomType)) &&
!StringUtil.isNullOrEmpty(intent.getStringExtra(AppDefType.ChatPushMessageKey.collaborationType))
) {
// roomTypeと、collaborationType が存在する場合は、協業を開始する。
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(
intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName),
intent.getStringExtra(AppDefType.ChatPushMessageKey.collaborationType),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomType), "");
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(
intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName), "");
}
}
}, 500);
}
}
*/
// 検索ダイアログ表示 // 検索ダイアログ表示
private void showSearchDialog() { private void showSearchDialog() {
contentRefresher.stopRefresh(); contentRefresher.stopRefresh();
...@@ -1261,6 +1280,15 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1261,6 +1280,15 @@ public class OperationListActivity extends ABVUIActivity {
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) { protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode,requestCode, intent);
// プッシュメッセージダイアログのリザルトだった場合
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK) {
goChatRoom(intent, "");
}
return;
}
activityResultFlg = true; activityResultFlg = true;
Uri result = (intent == null || resultCode != RESULT_OK) ? null : intent.getData(); Uri result = (intent == null || resultCode != RESULT_OK) ? null : intent.getData();
//ベースファイル登録した後にシーン画像選択画面閉じた後に呼ばれる //ベースファイル登録した後にシーン画像選択画面閉じた後に呼ばれる
......
...@@ -26,6 +26,7 @@ import java.util.Stack; ...@@ -26,6 +26,7 @@ import java.util.Stack;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON; 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.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; 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.exception.ExceptionHandler;
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;
...@@ -595,4 +596,17 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -595,4 +596,17 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
super.showAlertDialog(alertDialog); 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();
finish();
goChatRoom(intent, "");
}
return;
}
}
} }
...@@ -1668,8 +1668,12 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1668,8 +1668,12 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
getCurrentActivity().startActivity(intent); getCurrentActivity().startActivity(intent);
} }
// プシュメッセージからチャットに入る /**
public void startChatWebViewActivity(Long roomId, String roomName) { * プシュメッセージからチャットに遷移する
* @param roomId
* @param roomName
*/
public void startChatWebViewActivity(Long roomId, String roomName, String nextActivityName) {
String className = ChatWebViewActivity.class.getName(); String className = ChatWebViewActivity.class.getName();
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL; boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
Intent intent = new Intent(); Intent intent = new Intent();
...@@ -1682,7 +1686,19 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1682,7 +1686,19 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
intent.putExtra(AppDefType.ChatPushMessageKey.shopName, shopName); intent.putExtra(AppDefType.ChatPushMessageKey.shopName, shopName);
intent.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId); intent.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId);
intent.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName); intent.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName);
intent.setClassName(mContext.getPackageName(), className);
String nextActivity = className;
//if (fromClassName.equals(HTMLWebViewActivity.class.getName())) {
// フォームからきたら
//nextActivity = OperationListActivity.class.getName();
//} else if(fromClassName.equals(ContentViewActivity.class.getName())){
// 資料からきたら
//nextActivity = OperationRelatedContentActivity.class.getName();
//}
//intent.setClassName(mContext.getPackageName(), className);
intent.setClassName(mContext.getPackageName(), nextActivity);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getCurrentActivity().startActivity(intent); getCurrentActivity().startActivity(intent);
} }
...@@ -1912,7 +1928,14 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1912,7 +1928,14 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
this.previousOfSettingActivity2 = activity; this.previousOfSettingActivity2 = activity;
} }
public void startChatWebViewActivityWithCollaboration(Long roomId, String roomName, String collaborationType, String roomType) { /**
* プッシュメッセージから協業に遷移する
* @param roomId
* @param roomName
* @param collaborationType
* @param roomType
*/
public void startChatWebViewActivityWithCollaboration(Long roomId, String roomName, String collaborationType, String roomType, String fromClassName) {
String className = ChatWebViewActivity.class.getName(); String className = ChatWebViewActivity.class.getName();
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL; boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
Intent intent = new Intent(); Intent intent = new Intent();
......
...@@ -94,6 +94,7 @@ import jp.agentec.abook.abv.bl.acms.type.OperationType; ...@@ -94,6 +94,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.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.exception.ExceptionHandler; import jp.agentec.abook.abv.bl.common.exception.ExceptionHandler;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
...@@ -3829,7 +3830,16 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3829,7 +3830,16 @@ public class ContentViewActivity extends ABVContentViewActivity {
Uri[] result = null; Uri[] result = null;
Uri dataUri = null; Uri dataUri = null;
if (intent != null && resultCode == RESULT_OK) { // プッシュメッセージダイアログのリザルトだった場合
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK) {
finishActivity();
goChatRoom(intent, "");
}
return;
}
if (intent != null && resultCode == RESULT_OK) {
String dataString = intent.getDataString(); String dataString = intent.getDataString();
if (dataString != null) { if (dataString != null) {
dataUri = Uri.parse(dataString); dataUri = Uri.parse(dataString);
...@@ -3844,7 +3854,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3844,7 +3854,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
isAnotherViewOpenFlg = false; isAnotherViewOpenFlg = false;
// playPageBGMSound(mCurrentPageNumber); //프리뷰 모드 일때 음악재생 Bug // playPageBGMSound(mCurrentPageNumber); //프리뷰 모드 일때 음악재생 Bug
break; break;
case ABOOK_CHECK_TASK_IMAGE: case ABookCommConstants.ABOOK_CHECK_TASK_IMAGE:
if (mUploadMessage == null) { if (mUploadMessage == null) {
return; return;
} }
...@@ -3865,7 +3875,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3865,7 +3875,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107); ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107);
} }
break; break;
case ABOOK_CHECK_TASK_VIDEO: case ABookCommConstants.ABOOK_CHECK_TASK_VIDEO:
if (mUploadMessage == null) { if (mUploadMessage == null) {
return; return;
} }
......
...@@ -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,7 @@ import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification; ...@@ -42,6 +43,7 @@ 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.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;
...@@ -49,6 +51,8 @@ import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; ...@@ -49,6 +51,8 @@ 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.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow; import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.adf.util.StringUtil;
//TODO: later 遠隔連動関連はContentView,NoPdfViewと共通しているので要集約 //TODO: later 遠隔連動関連はContentView,NoPdfViewと共通しているので要集約
public class HTMLWebViewActivity extends ParentWebViewActivity { public class HTMLWebViewActivity extends ParentWebViewActivity {
...@@ -219,10 +223,10 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -219,10 +223,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) {
...@@ -683,8 +687,18 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -683,8 +687,18 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
} }
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) { protected void onActivityResult(int requestCode, int resultCode, final 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) {
finishActivity();
goChatRoom(intent, this.getClass().getName());
}
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 +709,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -695,7 +709,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,12 +729,12 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -715,12 +729,12 @@ 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]);
} }
......
...@@ -257,7 +257,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -257,7 +257,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
ActivityHandlingHelper.getInstance().finishAllLinkContentViewActivity(); ActivityHandlingHelper.getInstance().finishAllLinkContentViewActivity();
} else { } else {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity(); ActivityHandlingHelper.getInstance().finishAllContentViewActivity();
} }
} }
} }
......
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