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
78c5c903
Commit
78c5c903
authored
Feb 20, 2024
by
NGUYEN HOANG SON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement auto sync for push message
parent
3ec8094a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
8 deletions
+26
-8
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ShowPushMessageDailogActivity.java
+8
-3
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+17
-3
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OperationListHelper.java
+1
-2
No files found.
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ShowPushMessageDailogActivity.java
View file @
78c5c903
...
@@ -55,14 +55,18 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
...
@@ -55,14 +55,18 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
ErrorMessage
.
showErrorMessageToast
(
ShowPushMessageDailogActivity
.
this
,
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
ErrorMessage
.
showErrorMessageToast
(
ShowPushMessageDailogActivity
.
this
,
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
msg_routineTask_report_disable_no_operation
,
R
.
string
.
msg_routineTask_report_disable_no_operation
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
}
else
if
(
operationDto
.
needSyncFlg
)
{
}
else
{
OperationListActivity
operationListActivity
=
ActivityHandlingHelper
.
getInstance
().
getPreviousOperationListActivity
();
if
(
operationListActivity
!=
null
&&
operationListActivity
.
needAutoSync
())
{
operationListActivity
.
autoSyncOperationId
(
operationId
);
return
;
}
if
(
operationDto
.
needSyncFlg
)
{
// リソースパターンの適用
// リソースパターンの適用
ErrorMessage
.
showErrorMessageToast
(
ShowPushMessageDailogActivity
.
this
,
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
ErrorMessage
.
showErrorMessageToast
(
ShowPushMessageDailogActivity
.
this
,
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
msg_routineTask_report_disable_not_updated
,
R
.
string
.
msg_routineTask_report_disable_not_updated
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
}
else
{
}
else
{
OperationListActivity
operationListActivity
=
ActivityHandlingHelper
.
getInstance
().
getPreviousOperationListActivity
();
if
(
operationListActivity
!=
null
)
{
if
(
operationListActivity
!=
null
)
{
operationListActivity
.
startTaskDirectionOrReportView
(
operationDto
);
operationListActivity
.
startTaskDirectionOrReportView
(
operationDto
);
}
else
{
}
else
{
...
@@ -73,6 +77,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
...
@@ -73,6 +77,7 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
}
}
}
}
}
}
}
dialog
.
dismiss
();
dialog
.
dismiss
();
}
}
});
});
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
78c5c903
...
@@ -498,7 +498,6 @@ public class OperationListActivity extends OperationActivity {
...
@@ -498,7 +498,6 @@ public class OperationListActivity extends OperationActivity {
}
}
}
}
}
}
needSyncOperationList
.
addAll
(
mOperationDao
.
getAllOperation
());
if
(
needSyncOperationList
.
size
()
>
0
)
{
if
(
needSyncOperationList
.
size
()
>
0
)
{
categoryBatchSync
(
needSyncOperationList
);
categoryBatchSync
(
needSyncOperationList
);
}
else
{
}
else
{
...
@@ -1444,8 +1443,7 @@ public class OperationListActivity extends OperationActivity {
...
@@ -1444,8 +1443,7 @@ public class OperationListActivity extends OperationActivity {
return
;
return
;
}
}
if
(
needAutoSync
())
{
if
(
needAutoSync
())
{
autoSyncOpenOperationId
=
operationId
;
autoSyncOperationId
(
operationId
);
autoSyncOperation
();
return
;
return
;
}
}
if
(
operationDto
.
needSyncFlg
)
{
if
(
operationDto
.
needSyncFlg
)
{
...
@@ -2450,6 +2448,9 @@ public class OperationListActivity extends OperationActivity {
...
@@ -2450,6 +2448,9 @@ public class OperationListActivity extends OperationActivity {
return
(
isAutoSync
()
&&
ABVEnvironment
.
getInstance
().
networkAdapter
.
isNetworkConnected
());
return
(
isAutoSync
()
&&
ABVEnvironment
.
getInstance
().
networkAdapter
.
isNetworkConnected
());
}
}
/**
* Run refresh data and batch sync if need
*/
public
void
autoSyncOperation
()
{
public
void
autoSyncOperation
()
{
if
(
isAutoSyncing
)
{
if
(
isAutoSyncing
)
{
return
;
return
;
...
@@ -2469,6 +2470,19 @@ public class OperationListActivity extends OperationActivity {
...
@@ -2469,6 +2470,19 @@ public class OperationListActivity extends OperationActivity {
});
});
}
}
/**
* Auto sync and open operation if success
* @param operationId
*/
public
void
autoSyncOperationId
(
Long
operationId
)
{
autoSyncOpenOperationId
=
operationId
;
autoSyncOperation
();
}
/**
* Auto sync done
* @param isSuccess
*/
public
void
autoSyncOperationDone
(
boolean
isSuccess
)
{
public
void
autoSyncOperationDone
(
boolean
isSuccess
)
{
isAutoSyncing
=
false
;
isAutoSyncing
=
false
;
closeProgressPopup
();
closeProgressPopup
();
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OperationListHelper.java
View file @
78c5c903
...
@@ -265,8 +265,7 @@ public abstract class OperationListHelper {
...
@@ -265,8 +265,7 @@ public abstract class OperationListHelper {
public
void
onClickReport
(
OperationDto
operationDto
)
{
public
void
onClickReport
(
OperationDto
operationDto
)
{
if
(
mAppActivity
.
needAutoSync
())
{
if
(
mAppActivity
.
needAutoSync
())
{
mAppActivity
.
autoSyncOpenOperationId
=
operationDto
.
operationId
;
mAppActivity
.
autoSyncOperationId
(
operationDto
.
operationId
);
mAppActivity
.
autoSyncOperation
();
return
;
return
;
}
}
if
(
operationDto
.
contentId
!=
null
&&
operationDto
.
contentId
!=
0
)
{
if
(
operationDto
.
contentId
!=
null
&&
operationDto
.
contentId
!=
0
)
{
...
...
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