Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
1bb4f6ed
Commit
1bb4f6ed
authored
Aug 23, 2021
by
onuma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
プッシュメッセージからチャットと協業に遷移する時、iOSと同じ遷移にした。
parent
09e97798
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
70 additions
and
28 deletions
+70
-28
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookCommConstants.java
+2
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/push/ABVFcmListenerService.java
+4
-5
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/push/PushMessageJSON.java
+21
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
+29
-10
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+4
-3
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationRelatedContentActivity.java
+4
-2
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ActivityHandlingHelper.java
+3
-4
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ContentViewActivity.java
+1
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/HTMLWebViewActivity.java
+2
-1
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookCommConstants.java
View file @
1bb4f6ed
...
...
@@ -169,8 +169,9 @@ public interface ABookCommConstants {
String
CONTACT_URL
=
"file:///android_asset/chat/public_new/contact.html"
;
String
COLLABORATION_PAGE_URL
=
"file:///android_asset/chat/public_new/collaboration.html"
;
String
DEFAULT_CHECKSUM
=
"0000000000"
;
String
PLATFORM_NAME
=
"android"
;
String
CHAT_MESSAGE_SEPERATOR
=
"<::split>"
;
String
INVITE_COLLABORATION
=
"inviteCollaboration"
+
CHAT_MESSAGE_SEPERATOR
;
int
PUSH_MESSAGE_DLG_REQUEST_CODE
=
200
;
interface
PUSH_MESSAGE_DLG_RESULT
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/push/ABVFcmListenerService.java
View file @
1bb4f6ed
...
...
@@ -19,6 +19,7 @@ import org.json.adf.JSONObject;
import
java.util.Map
;
import
java.util.Objects
;
import
jp.agentec.abook.abv.bl.common.constant.ABookCommConstants
;
import
jp.agentec.abook.abv.bl.common.exception.ABVException
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.dto.MemberInfoDto
;
...
...
@@ -42,8 +43,6 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
private
static
final
String
TAG
=
"ABVFcmListenerService"
;
private
NotificationManager
mNotificationManager
;
private
static
int
mNotificationConnect
=
0
;
private
final
String
CHAT_MESSAGE_SEPERATOR
=
"<::split>"
;
private
final
String
INVITE_COLLABORATION
=
"inviteCollaboration"
+
CHAT_MESSAGE_SEPERATOR
;
@Override
public
void
onCreate
()
{
...
...
@@ -260,9 +259,9 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
String
roomType
=
""
;
String
collaborationType
=
""
;
if
(
textMessage
.
contains
(
INVITE_COLLABORATION
))
{
if
(
textMessage
.
contains
(
ABookCommConstants
.
INVITE_COLLABORATION
))
{
roomType
=
Integer
.
toString
(
json
.
getInt
(
AppDefType
.
ChatPushMessageKey
.
roomType
));
String
[]
inviteMessage
=
textMessage
.
split
(
CHAT_MESSAGE_SEPERATOR
);
String
[]
inviteMessage
=
textMessage
.
split
(
ABookCommConstants
.
CHAT_MESSAGE_SEPERATOR
);
collaborationType
=
inviteMessage
[
1
];
}
String
roomName
=
json
.
getString
(
AppDefType
.
ChatPushMessageKey
.
roomName
);
...
...
@@ -315,7 +314,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
* @return 表示するテキスト
*/
private
String
getContentText
(
String
textMessage
)
{
if
(!
StringUtil
.
isNullOrEmpty
(
textMessage
)
&&
textMessage
.
contains
(
INVITE_COLLABORATION
))
{
if
(!
StringUtil
.
isNullOrEmpty
(
textMessage
)
&&
textMessage
.
contains
(
ABookCommConstants
.
INVITE_COLLABORATION
))
{
return
getString
(
R
.
string
.
msg_invite_collaboration
);
}
return
textMessage
;
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/cl/push/PushMessageJSON.java
View file @
1bb4f6ed
package
jp
.
agentec
.
abook
.
abv
.
cl
.
push
;
import
android.content.Intent
;
import
org.json.adf.JSONObject
;
import
jp.agentec.abook.abv.bl.common.constant.ABookCommConstants
;
import
jp.agentec.abook.abv.launcher.android.R
;
import
jp.agentec.abook.abv.ui.common.appinfo.AppDefType
;
import
jp.agentec.adf.util.StringUtil
;
/**
* プッシュメッセージをJSONにしたクラス
...
...
@@ -56,7 +62,8 @@ public class PushMessageJSON {
public
String
getRoomType
()
{
try
{
return
jsonObject
.
getString
(
AppDefType
.
ChatPushMessageKey
.
roomType
);
int
roomType
=
jsonObject
.
getInt
(
AppDefType
.
ChatPushMessageKey
.
roomType
);
return
Integer
.
toString
(
roomType
);
}
catch
(
Exception
e
){
return
""
;
}
...
...
@@ -78,8 +85,21 @@ public class PushMessageJSON {
}
}
public
boolean
isCollaboration
()
{
String
message
=
getMessage
();
if
(
message
.
contains
(
ABookCommConstants
.
INVITE_COLLABORATION
))
{
return
true
;
}
return
false
;
}
public
String
getCollaborationType
()
{
try
{
String
message
=
getMessage
();
if
(
message
.
contains
(
ABookCommConstants
.
INVITE_COLLABORATION
))
{
String
[]
inviteMessage
=
message
.
split
(
ABookCommConstants
.
CHAT_MESSAGE_SEPERATOR
);
return
inviteMessage
[
1
];
}
return
jsonObject
.
getString
(
AppDefType
.
ChatPushMessageKey
.
collaborationType
);
}
catch
(
Exception
e
)
{
return
""
;
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
View file @
1bb4f6ed
...
...
@@ -162,11 +162,11 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
// ABookCommunicationでチャットの情報を格納しておく
private
Long
roomId
=
new
Long
(
0
);
private
String
roomName
=
""
;
private
String
collaborationType
=
""
;
private
String
roomType
=
""
;
private
String
fromClassName
=
""
;
//
private Long roomId = new Long(0);
//
private String roomName = "";
//
private String collaborationType = "";
//
private String roomType = "";
//
private String fromClassName = "";
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -1309,7 +1309,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
/**
* ッシュメッセージがあるので、チャットルームに遷移する。
*/
public
void
goChatRoom
(
final
Intent
intent
,
final
String
fromClassName
)
{
public
boolean
goChatRoom
(
final
Intent
intent
,
final
String
nextActivity
)
{
if
(!
StringUtil
.
isNullOrEmpty
(
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomName
))
&&
intent
.
getLongExtra
(
AppDefType
.
ChatPushMessageKey
.
roomId
,
'0'
)
>
0
)
{
...
...
@@ -1317,7 +1317,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
@Override
public
void
run
()
{
Logger
.
d
(
TAG
,
"fromClassName = "
+
fromClassName
);
Logger
.
d
(
TAG
,
"fromClassName = "
+
nextActivity
);
if
(!
StringUtil
.
isNullOrEmpty
(
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomType
))
&&
!
StringUtil
.
isNullOrEmpty
(
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
collaborationType
))
...
...
@@ -1328,15 +1328,18 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomName
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
collaborationType
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomType
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
fromClassName
)
);
nextActivity
);
}
else
{
ActivityHandlingHelper
.
getInstance
().
startChatWebViewActivity
(
intent
.
getLongExtra
(
AppDefType
.
ChatPushMessageKey
.
roomId
,
'0'
),
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomName
),
""
);
intent
.
getStringExtra
(
AppDefType
.
ChatPushMessageKey
.
roomName
),
nextActivity
);
}
}
},
500
);
return
true
;
}
return
false
;
}
/**
...
...
@@ -1352,14 +1355,30 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
json
=
new
PushMessageJSON
(
messageBody
);
/**
String textMessage = json.getMessage();
if (textMessage.contains(ABookCommConstants.INVITE_COLLABORATION)) {
// 協業
textMessage = getString(R.string.msg_invite_collaboration);
}
*/
// 協業
String
messageText
=
json
.
getMessage
();
if
(
json
.
isCollaboration
())
{
messageText
=
getString
(
R
.
string
.
msg_invite_collaboration
);
}
Intent
pushMsgDialog
=
new
Intent
(
context
,
ShowPushMessageDailogActivity
.
class
);
pushMsgDialog
.
putExtra
(
AppDefType
.
PushMessageKey
.
message
,
json
.
getMessage
()
);
pushMsgDialog
.
putExtra
(
AppDefType
.
PushMessageKey
.
message
,
messageText
);
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
.
roomType
,
json
.
getRoomType
());
pushMsgDialog
.
putExtra
(
AppDefType
.
ChatPushMessageKey
.
collaborationType
,
json
.
getCollaborationType
());
pushMsgDialog
.
putExtra
(
AppDefType
.
ChatPushMessageKey
.
fromClassName
,
messageMap
.
get
(
AppDefType
.
ChatPushMessageKey
.
fromClassName
));
/**
this.roomId = roomID;
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
1bb4f6ed
...
...
@@ -517,8 +517,9 @@ public class OperationListActivity extends ABVUIActivity {
refreshOperationList
();
// プッシュメッセージがある場合の処理
getIntent
().
putExtra
(
AppDefType
.
ChatPushMessageKey
.
fromClassName
,
this
.
getClass
().
getName
());
goChatRoom
(
getIntent
(),
""
);
if
(
goChatRoom
(
getIntent
(),
ChatWebViewActivity
.
class
.
getName
()))
{
return
;
}
// 報告画面から作業一覧へ戻った時の同期処理
final
long
operationId
=
getUserPref
(
AppDefType
.
UserPrefKey
.
SYNC_TARGET_OPERATION_ID
,
-
1L
);
...
...
@@ -1284,7 +1285,7 @@ public class OperationListActivity extends ABVUIActivity {
// プッシュメッセージダイアログのリザルトだった場合
if
(
requestCode
==
ABookCommConstants
.
PUSH_MESSAGE_DLG_REQUEST_CODE
)
{
if
(
resultCode
==
ABookCommConstants
.
PUSH_MESSAGE_DLG_RESULT
.
OK
)
{
goChatRoom
(
intent
,
""
);
goChatRoom
(
intent
,
ChatWebViewActivity
.
class
.
getName
()
);
}
return
;
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationRelatedContentActivity.java
View file @
1bb4f6ed
...
...
@@ -545,6 +545,9 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
updateCollaborationInfo
();
refreshCollaborationUI
();
super
.
onResume
();
if
(
goChatRoom
(
getIntent
(),
ChatWebViewActivity
.
class
.
getName
()))
{
return
;
}
showOperationRelatedContentList
();
}
...
...
@@ -602,9 +605,8 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
if
(
requestCode
==
ABookCommConstants
.
PUSH_MESSAGE_DLG_REQUEST_CODE
)
{
if
(
resultCode
==
ABookCommConstants
.
PUSH_MESSAGE_DLG_RESULT
.
OK
)
{
//backToHome();
finish
();
goChatRoom
(
intent
,
""
);
goChatRoom
(
intent
,
ChatWebViewActivity
.
class
.
getName
()
);
}
return
;
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ActivityHandlingHelper.java
View file @
1bb4f6ed
...
...
@@ -1674,7 +1674,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
* @param roomName
*/
public
void
startChatWebViewActivity
(
Long
roomId
,
String
roomName
,
String
nextActivityName
)
{
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/"
);
...
...
@@ -1687,7 +1686,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
intent
.
putExtra
(
AppDefType
.
ChatPushMessageKey
.
roomId
,
roomId
);
intent
.
putExtra
(
AppDefType
.
ChatPushMessageKey
.
roomName
,
roomName
);
String
nextActivity
=
className
;
//
String nextActivity = className;
//if (fromClassName.equals(HTMLWebViewActivity.class.getName())) {
// フォームからきたら
//nextActivity = OperationListActivity.class.getName();
...
...
@@ -1698,7 +1697,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
//intent.setClassName(mContext.getPackageName(), className);
intent
.
setClassName
(
mContext
.
getPackageName
(),
nextActivity
);
intent
.
setClassName
(
mContext
.
getPackageName
(),
nextActivity
Name
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
);
getCurrentActivity
().
startActivity
(
intent
);
}
...
...
@@ -1935,7 +1934,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
* @param collaborationType
* @param roomType
*/
public
void
startChatWebViewActivityWithCollaboration
(
Long
roomId
,
String
roomName
,
String
collaborationType
,
String
roomType
,
String
fromClass
Name
)
{
public
void
startChatWebViewActivityWithCollaboration
(
Long
roomId
,
String
roomName
,
String
collaborationType
,
String
roomType
,
String
nextActivity
Name
)
{
String
className
=
ChatWebViewActivity
.
class
.
getName
();
boolean
isNormalSize
=
(
mContext
.
getResources
().
getConfiguration
().
screenLayout
&
Configuration
.
SCREENLAYOUT_SIZE_MASK
)
==
Configuration
.
SCREENLAYOUT_SIZE_NORMAL
;
Intent
intent
=
new
Intent
();
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ContentViewActivity.java
View file @
1bb4f6ed
...
...
@@ -3834,7 +3834,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
if
(
requestCode
==
ABookCommConstants
.
PUSH_MESSAGE_DLG_REQUEST_CODE
)
{
if
(
resultCode
==
ABookCommConstants
.
PUSH_MESSAGE_DLG_RESULT
.
OK
)
{
finishActivity
();
goChatRoom
(
intent
,
""
);
goChatRoom
(
intent
,
OperationRelatedContentActivity
.
class
.
getName
()
);
}
return
;
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/HTMLWebViewActivity.java
View file @
1bb4f6ed
...
...
@@ -51,6 +51,7 @@ 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.AlertDialogUtil
;
import
jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow
;
import
jp.agentec.abook.abv.ui.home.activity.OperationListActivity
;
import
jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper
;
import
jp.agentec.adf.util.StringUtil
;
...
...
@@ -694,7 +695,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
if
(
requestCode
==
ABookCommConstants
.
PUSH_MESSAGE_DLG_REQUEST_CODE
)
{
if
(
resultCode
==
ABookCommConstants
.
PUSH_MESSAGE_DLG_RESULT
.
OK
)
{
finishActivity
();
goChatRoom
(
intent
,
this
.
getClass
()
.
getName
());
goChatRoom
(
intent
,
OperationListActivity
.
class
.
getName
());
}
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment