Commit dd69043a by onuma

MRで指摘されたソースを修正した。

parent d901cb70
......@@ -110,31 +110,9 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
}
}
/*
private void showCollaborationPopUpMessage(
Long roomId,
String roomName,
String roomType,
String pushSendLoginId,
long pushSendDate,
String collaborationType)
{
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.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.collaborationType, collaborationType);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
startActivity(pushMsgDialog);
}
*/
/**
* プッシュメッセージをダイアログ表示する
* @param messageMap 受信したメッセージを格納したMapオブジェクト
*/
private void showChatRoomPopupMessage(Map<String, String> messageMap) {
String messageBody = messageMap.get(AppDefType.PushMessageKey.message);
......@@ -161,12 +139,12 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
currentActivity.getClass().equals(ImageViewActivity.class) ||
currentActivity.getClass().equals(VideoViewActivity.class)
){
// 呼び出し元のActivity名を保存しておく
// 呼び出し元のActivityの名前をmessageMapに追加する
messageMap.put(AppDefType.ChatPushMessageKey.fromActivityName, fromClassName);
messageMap.put(AppDefType.ChatPushMessageKey.isNewVersion, "true");
messageMap.put(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen, "true");
((ABVAuthenticatedActivity)currentActivity).showChatRoomPopupMessage((Context)currentActivity, messageMap);
} else {
// 既存の処理
// それ以外のActivityの場合の処理
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
pushMsgDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, getContentText(json.getMessage()));
......@@ -326,13 +304,4 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
}
return textMessage;
}
/**
* プッシュメッセージからJSONObjectを作成する。
* @param jsonText 受信したプッシュメッセージをJSONObjectにする。
* @return
*/
private JSONObject createMessageJsonObject(String jsonText) {
return new JSONObject(jsonText);
}
}
......@@ -163,7 +163,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// 遷移元のアクティビティ名
// PushMessage受信時に直接ChatRoomへ行かずに、ひとつまえのActivityに戻る為に使用する。
public String fromActivityName;
public String baseActivityName;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -1243,7 +1243,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
/**
* ッシュメッセージがあるので、チャットルームに遷移する。
* ッシュメッセージがあるので、チャットルームに遷移する。
*/
public boolean goChatRoom(final Intent intent, final String nextActivityName, final String fromActivityName) {
if (!StringUtil.isNullOrEmpty(intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
......@@ -1284,11 +1284,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
*/
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);
PushMessageJSON json = new PushMessageJSON(messageBody);
// 協業
String messageText = json.getMessage();
......@@ -1308,11 +1307,11 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, json.getCollaborationType());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.fromActivityName, messageMap.get(AppDefType.ChatPushMessageKey.fromActivityName));
String newVersion = messageMap.get(AppDefType.ChatPushMessageKey.isNewVersion);
String newVersion = messageMap.get(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen);
if (newVersion != null && newVersion.equals(new String("true"))) {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.isNewVersion, true);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen, true);
} else {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.isNewVersion, false);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen, false);
}
startActivityForResult(pushMsgDialog, ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE);
......
......@@ -160,7 +160,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1);
// 遷移元のActivity
fromActivityName = getIntent().getStringExtra(AppDefType.ChatPushMessageKey.fromActivityName);
baseActivityName = getIntent().getStringExtra(AppDefType.ChatPushMessageKey.fromActivityName);
if (!isLinkedContent) {
operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId);
......
......@@ -125,7 +125,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
isCollabration = MeetingManager.getInstance().isCollaboration();
Bundle extras = getIntent().getExtras();
if (extras != null && !isMeetingRoomConnected) {
boolean isNewVersion = extras.getBoolean(AppDefType.ChatPushMessageKey.isNewVersion);
boolean isNewVersion = extras.getBoolean(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen);
if (isNewVersion) {
setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK, getIntent());
finish();
......
......@@ -148,6 +148,6 @@ public interface AppDefType {
String shopName = "shopName";
String loginId = "loginId";
String fromActivityName = "fromActivityName";
String isNewVersion = "isNewVersion";
String needsDisplayOperationOrOperationRelatedContentScreen = "needsDisplayOperationOrOperationRelatedContentScreen";
}
}
......@@ -168,7 +168,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
chatData.setIsMobile(!isNormalSize());
// どのアクティビティから遷移してきたか保存
fromActivityName = intent.getStringExtra(AppDefType.ChatPushMessageKey.fromActivityName);
baseActivityName = intent.getStringExtra(AppDefType.ChatPushMessageKey.fromActivityName);
}
private void setupChatWebView() {
......@@ -788,7 +788,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
// 戻るの作業一覧か、関連資料のどちらかのActivityのみ
Intent intent = new Intent();
if (OperationListActivity.class.getName().equals(fromActivityName)) {
if (OperationListActivity.class.getName().equals(baseActivityName)) {
intent.setClass(ChatWebViewActivity.this, OperationListActivity.class);
} else {
intent.setClass(ChatWebViewActivity.this, OperationRelatedContentActivity.class);
......
......@@ -1632,7 +1632,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
//プシュメッセージ一覧からチャットに入る
public void startChatWebViewActivityWithPushMessage(PushMessageDto dto) {
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/");
......@@ -1654,7 +1653,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
//チャットに入る
public void startChatWebViewActivity() {
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;
......@@ -1670,11 +1668,12 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
/**
* プシュメッセージからチャットに遷移する
* @param roomId
* @param roomName
* @param roomId chatRoom の Id
* @param roomName chatRoom の名前
* @param targetActivityName 直接chatRoom に遷移する場合は、ChatWebViewActivity名。chatRoomに遷移する前に、別のActivityを経由する場合は、そのActivity名
* @param fromActivityName この関数を呼び出したActivity名
*/
public void startChatWebViewActivity(Long roomId, String roomName, String nextActivityName, String fromActivityName) {
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
public void startChatWebViewActivity(Long roomId, String roomName, String targetActivityName, String fromActivityName) {
Intent intent = new Intent();
intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/");
String sid = ABVDataCache.getInstance().getMemberInfo().sid;
......@@ -1686,7 +1685,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
intent.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId);
intent.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName);
intent.putExtra(AppDefType.ChatPushMessageKey.fromActivityName, fromActivityName);
intent.setClassName(mContext.getPackageName(), nextActivityName);
intent.setClassName(mContext.getPackageName(), targetActivityName);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getCurrentActivity().startActivity(intent);
}
......@@ -1924,9 +1923,8 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
* @param roomType
*/
public void startChatWebViewActivityWithCollaboration(Long roomId, String roomName, String collaborationType, String roomType, String nextActivityName, String fromActivityName) {
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/");
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;
......
......@@ -3826,16 +3826,16 @@ 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 && !StringUtil.isNullOrEmpty(fromActivityName)) {
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
// プッシュメッセージダイアログのリザルトだった場合
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK && !StringUtil.isNullOrEmpty(baseActivityName)) {
finishActivity();
goChatRoom(intent, fromActivityName, ContentViewActivity.class.getName());
}
return;
}
goChatRoom(intent, baseActivityName, ContentViewActivity.class.getName());
}
return;
}
if (intent != null && resultCode == RESULT_OK) {
if (intent != null && resultCode == RESULT_OK) {
String dataString = intent.getDataString();
if (dataString != null) {
dataUri = Uri.parse(dataString);
......@@ -3850,7 +3850,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
isAnotherViewOpenFlg = false;
// playPageBGMSound(mCurrentPageNumber); //프리뷰 모드 일때 음악재생 Bug
break;
case ABookCommConstants.ABOOK_CHECK_TASK_IMAGE:
case ABookCommConstants.ABOOK_CHECK_TASK_IMAGE:
if (mUploadMessage == null) {
return;
}
......@@ -3871,7 +3871,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107);
}
break;
case ABookCommConstants.ABOOK_CHECK_TASK_VIDEO:
case ABookCommConstants.ABOOK_CHECK_TASK_VIDEO:
if (mUploadMessage == null) {
return;
}
......
......@@ -690,9 +690,9 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
// プッシュメッセージダイアログのリザルトだった場合
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK && !StringUtil.isNullOrEmpty(fromActivityName)) {
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK && !StringUtil.isNullOrEmpty(baseActivityName)) {
finishActivity();
goChatRoom(intent, fromActivityName, HTMLWebViewActivity.class.getName());
goChatRoom(intent, baseActivityName, HTMLWebViewActivity.class.getName());
}
return;
}
......
......@@ -215,9 +215,9 @@ public class NoPdfViewActivity extends ABVContentViewActivity {
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
// プッシュメッセージダイアログのリザルトだった場合
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK && !StringUtil.isNullOrEmpty(fromActivityName)) {
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK && !StringUtil.isNullOrEmpty(baseActivityName)) {
finishActivity();
goChatRoom(intent, fromActivityName, getClass().getName());
goChatRoom(intent, baseActivityName, getClass().getName());
}
return;
}
......
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