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
3329f676
Commit
3329f676
authored
Aug 29, 2019
by
Lee Jaebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一括同期処理(レビュー後修正)
parent
3e2de8d8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
195 additions
and
178 deletions
+195
-178
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationDao.java
+10
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVActivity.java
+1
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
+1
-20
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/view/ABVBatchSyncView.java
+87
-18
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+94
-139
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OperationGroupMasterListHelper.java
+2
-0
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/OperationDao.java
View file @
3329f676
...
...
@@ -401,6 +401,16 @@ public class OperationDao extends AbstractDao {
}
/**
* 作業グループに紐づく同期可能な作業リストが存在するかチェック
* @param operationGroupMasterId
* @return
*/
public
boolean
hasNeedSyncOperationByGroupMasterId
(
Integer
operationGroupMasterId
)
{
List
<
OperationDto
>
operationDtoList
=
getNeedSyncOperationByGroupMasterId
(
operationGroupMasterId
);
return
operationDtoList
!=
null
&&
operationDtoList
.
size
()
>
0
;
}
/**
* 定期点検で同期が必要な作業を取得
* @return
*/
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVActivity.java
View file @
3329f676
...
...
@@ -800,7 +800,7 @@ public abstract class ABVActivity extends Activity {
showSimpleAlertDialog
(
getString
(
titleResId
),
getString
(
bodyResId
));
}
p
rotected
void
showSimpleAlertDialog
(
final
String
title
,
final
String
body
)
{
p
ublic
void
showSimpleAlertDialog
(
final
String
title
,
final
String
body
)
{
handler
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
View file @
3329f676
...
...
@@ -659,26 +659,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
return
result
;
}
/**
* 作業用コンテンツダウンロード時、ダウンロードかダウンロード再開か判定して行う。
* @param contentDto
* @return
*/
public
boolean
operationContentDownload
(
final
ContentDto
contentDto
)
{
if
(
contentDto
.
isDownloadPaused
())
{
// ダウンロード途中で通信が切れた場合、一時停止のステータスに変更になるため、再開させる
try
{
contentDownloader
.
resume
(
contentDto
.
contentId
);
contentDownloader
.
addContentDownloadListener
(
this
);
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
"downloadContent failed. contentId="
+
contentDto
.
contentId
,
e
);
return
false
;
}
}
else
{
return
contentDownload
(
contentDto
.
contentId
,
false
,
false
);
}
return
true
;
}
// Wifi非接続時のアラート表示
public
void
showWifiDisconnectAlert
(
final
int
messageId
,
final
DialogInterface
.
OnClickListener
positive
,
final
DialogInterface
.
OnClickListener
negative
)
throws
NetworkDisconnectedException
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/view/ABVBatchSyncView.java
View file @
3329f676
...
...
@@ -6,25 +6,42 @@ import android.graphics.PixelFormat;
import
java.util.Stack
;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.Callback
;
import
jp.agentec.abook.abv.bl.common.CommonExecutor
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.data.dao.AbstractDao
;
import
jp.agentec.abook.abv.bl.data.dao.ContentDao
;
import
jp.agentec.abook.abv.bl.dto.ContentDto
;
import
jp.agentec.abook.abv.bl.dto.OperationDto
;
import
jp.agentec.abook.abv.launcher.android.R
;
import
jp.agentec.abook.abv.ui.home.activity.OperationListActivity
;
/**
* Created by leej on 2019/08/26.
*/
public
class
ABVBatchSyncView
extends
ProgressDialog
{
private
static
final
String
TAG
=
"ABVBatchSyncView"
;
private
Stack
<
OperationDto
>
mBatchSyncOperationStack
=
new
Stack
<>();
private
ContentDao
contentDao
=
AbstractDao
.
getDao
(
ContentDao
.
class
);
private
OperationListActivity
mOperationListActivity
;
// Activityが破棄された場合、処理を中止するフラグ
private
boolean
isDestroy
=
false
;
public
ABVBatchSyncView
(
Context
context
)
{
super
(
context
);
mOperationListActivity
=
(
OperationListActivity
)
context
;
init
();
isDestroy
=
false
;
}
// 初期化
private
void
init
()
{
if
(
getWindow
()
!=
null
)
{
setIndeterminate
(
false
);
// キャンセルできないように設定・ナビゲーションバーのバックボタンも無効してくれる
setCancelable
(
false
);
setProgressStyle
(
ProgressDialog
.
STYLE_HORIZONTAL
);
//プログレスバー表示
getWindow
().
setFormat
(
PixelFormat
.
TRANSPARENT
);
...
...
@@ -42,39 +59,91 @@ public class ABVBatchSyncView extends ProgressDialog {
}
/**
* 参照のみ、stackには保存状態
* @return
* 閉じる処理
*/
public
OperationDto
getOperationStackPeek
()
{
return
mBatchSyncOperationStack
.
peek
();
public
void
closeProgressDialog
()
{
// プログレス値を0に初期化
setProgress
(
0
);
dismiss
();
}
/**
*
stackからOperationDtoを取り出す
*
スタック中の空チェック
* @return
*/
public
OperationDto
getOperationStackPop
()
{
return
mBatchSyncOperationStack
.
pop
();
public
boolean
isStackEmpty
()
{
return
mBatchSyncOperationStack
.
empty
();
}
public
boolean
checkMaxProgress
()
{
return
getMax
()
==
getProgress
()
+
1
;
/**
* 一括同期処理(stackの中を全て同期する)
* ベース資料ダウンロードチェックして、未ダウンロードであればダウンロードして同期
*/
public
void
batchOperationSyncForCheckDonwload
()
{
if
(
isDestroy
||
isStackEmpty
())
{
// Activity破棄フラグがtrue、またはスタックが存在しなければ、全て完了と見做す
closeProgressDialog
();
Logger
.
d
(
TAG
,
"---batchSync is end"
);
return
;
}
// ベース資料のダウンロードチェック
OperationDto
peekOperationDto
=
mBatchSyncOperationStack
.
peek
();
ContentDto
contentDto
=
contentDao
.
getContent
(
peekOperationDto
.
contentId
);
if
(
contentDto
==
null
)
{
Logger
.
e
(
TAG
,
"contentDto is null !"
);
closeProgressDialog
();
return
;
}
if
(!
contentDto
.
downloadedFlg
||
contentDto
.
updatedFlg
)
{
if
(!
mOperationListActivity
.
operationContentDownload
(
contentDto
))
{
// error
showBatchSyncErrorAlert
(
peekOperationDto
,
mOperationListActivity
.
getString
(
R
.
string
.
msg_batch_sync_content_download_fail
));
}
return
;
}
// 同期処理
batchOperationSync
();
}
/**
*
閉じる処理
*
一括同期処理(ベース資料はダウンロード済み)
*/
public
void
closeProgressDialog
()
{
// プログレス値を0に初期化
setProgress
(
0
);
dismiss
();
public
void
batchOperationSync
()
{
final
OperationDto
operationDto
=
mBatchSyncOperationStack
.
pop
();
String
errorMessage
=
mOperationListActivity
.
syncOperation
(
operationDto
.
operationId
,
operationDto
.
reportType
,
false
);
if
(
errorMessage
!=
null
)
{
showBatchSyncErrorAlert
(
operationDto
,
errorMessage
);
}
else
{
// 正常
// 次のスタックがなければ、カウントしない
if
(!
isStackEmpty
())
{
setProgress
(
getProgress
()
+
1
);
}
// 次の作業を同期処理
batchOperationSyncForCheckDonwload
();
}
}
// Activityが破棄された場合呼ばれる
public
void
setActivityDestroy
()
{
isDestroy
=
true
;
}
/**
* スタック中の空チェック
* @return
* 一括同期処理時、エラーアラート表示
* 一括同期中のプログレスバーは非表示にする
* @param operationDto
* @param errorMessage
*/
public
boolean
isStackEmpty
()
{
return
mBatchSyncOperationStack
.
empty
();
public
void
showBatchSyncErrorAlert
(
OperationDto
operationDto
,
String
errorMessage
)
{
// 異常
closeProgressDialog
();
if
(
ABVEnvironment
.
getInstance
().
networkAdapter
.
isNetworkConnected
())
{
String
convertErrorMsg
=
String
.
format
(
mOperationListActivity
.
getString
(
R
.
string
.
msg_batch_sync_error
),
operationDto
.
operationName
)
+
errorMessage
;
mOperationListActivity
.
showSimpleAlertDialog
(
mOperationListActivity
.
getString
(
R
.
string
.
app_name
),
convertErrorMsg
);
}
else
{
// ネットワーク通信エラー
mOperationListActivity
.
showSimpleAlertDialog
(
mOperationListActivity
.
getString
(
R
.
string
.
app_name
),
mOperationListActivity
.
getString
(
R
.
string
.
msg_batch_sync_disconnect_network
));
}
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
3329f676
...
...
@@ -387,8 +387,7 @@ public class OperationListActivity extends ABVUIActivity {
alertDialog
.
show
();
}
}
// 一括同期を設定
batchSyncView
=
new
ABVBatchSyncView
(
this
);
mAllOperationReportTypes
=
getOperationReportTypeList
(
true
);
// リスト更新
setOperationListView
();
...
...
@@ -442,15 +441,17 @@ public class OperationListActivity extends ABVUIActivity {
// フィルターボタンを無効にする
mFilterButton
.
setImageDrawable
(
getRDrawable
(
R
.
drawable
.
ic_filter
));
setEnabledImageButton
(
mFilterButton
);
setEnabledImageButton
(
mFilterButton
,
false
);
// 検索ボタンを無効にする
mSearchButton
.
setImageDrawable
(
getRDrawable
(
R
.
drawable
.
ic_operation_search
));
setEnabledImageButton
(
mSearchButton
);
setEnabledImageButton
(
mSearchButton
,
false
);
// 一括同期ボタン表示
mOperationBatchSyncButton
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
// 全て
cancelToolbarEnabledIcon
();
// ボタンを活性化
setEnabledImageButton
(
mFilterButton
,
true
);
setEnabledImageButton
(
mSearchButton
,
true
);
// 一括同期ボタン非表示
mOperationBatchSyncButton
.
setVisibility
(
View
.
GONE
);
}
...
...
@@ -459,7 +460,11 @@ public class OperationListActivity extends ABVUIActivity {
}
else
{
// アイコン非表示
mLocationTypeRadioGroup
.
setVisibility
(
View
.
GONE
);
cancelToolbarEnabledIcon
();
// 一括同期ボタンを非表示
mOperationBatchSyncButton
.
setVisibility
(
View
.
GONE
);
// ボタンを活性化
setEnabledImageButton
(
mFilterButton
,
true
);
setEnabledImageButton
(
mSearchButton
,
true
);
}
// ツールバーの検索結果レイアウトの表示・非表示
...
...
@@ -473,19 +478,17 @@ public class OperationListActivity extends ABVUIActivity {
mEndDateStr
=
null
;
clearData
();
}
// イメージボタンを無効にする
private
void
setEnabledImageButton
(
ImageButton
button
)
{
button
.
setEnabled
(
false
);
button
.
setColorFilter
(
0xaa808080
);
}
/**
* ツールバーのアイコンを有効にする
*/
private
void
cancelToolbarEnabledIcon
()
{
mFilterButton
.
setEnabled
(
true
);
mFilterButton
.
setColorFilter
(
null
);
mSearchButton
.
setEnabled
(
true
);
mSearchButton
.
setColorFilter
(
null
);
// イメージボタンを無効/有効にする
private
void
setEnabledImageButton
(
ImageButton
button
,
boolean
enabled
)
{
if
(
enabled
)
{
// 活性化
button
.
setEnabled
(
true
);
button
.
setColorFilter
(
null
);
}
else
{
// 非活性化
button
.
setEnabled
(
false
);
button
.
setColorFilter
(
0xaa808080
);
}
}
/**
...
...
@@ -568,7 +571,7 @@ public class OperationListActivity extends ABVUIActivity {
Logger
.
d
(
TAG
,
"onResume Sync operationId : "
+
operationId
);
if
(
operationDto
!=
null
&&
operationDto
.
needSyncFlg
)
{
// 同期処理後、直列処理で新着更新を行う。
syncOperation
(
operationId
,
operationDto
.
reportType
);
s
ingleS
yncOperation
(
operationId
,
operationDto
.
reportType
);
}
else
{
closeProgressPopup
();
}
...
...
@@ -821,16 +824,17 @@ public class OperationListActivity extends ABVUIActivity {
if
(
isShowingBatchSync
())
{
// 一括同期からの同期処理
Logger
.
d
(
TAG
,
"[onDownloadingContentZip] batchOperationSync start"
);
batch
OperationSync
(
true
);
batch
SyncView
.
batchOperationSync
(
);
}
else
{
OperationDto
operationDto
=
mOperationLogic
.
getOperation
(
operationContentDto
.
operationId
);
syncOperation
(
operationContentDto
.
operationId
,
operationDto
.
reportType
,
true
);
s
ingleS
yncOperation
(
operationContentDto
.
operationId
,
operationDto
.
reportType
,
true
);
}
}
else
if
(
notification
.
downloadStatus
==
DownloadStatusType
.
Failed
||
notification
.
downloadStatus
==
DownloadStatusType
.
Canceled
||
notification
.
downloadStatus
==
DownloadStatusType
.
Paused
)
{
Logger
.
d
(
TAG
,
"syncOperation update is failed downloadStatus : "
+
notification
.
downloadStatus
);
if
(
isShowingBatchSync
())
{
// 一括同期からのダウンロード失敗時、エラーメッセージ表示
showBatchSyncErrorAlert
(
getString
(
R
.
string
.
msg_batch_sync_content_download_fail
));
OperationDto
operationDto
=
mOperationLogic
.
getOperation
(
operationContentDto
.
operationId
);
batchSyncView
.
showBatchSyncErrorAlert
(
operationDto
,
getString
(
R
.
string
.
msg_batch_sync_content_download_fail
));
}
closeProgressPopup
();
}
...
...
@@ -838,34 +842,22 @@ public class OperationListActivity extends ABVUIActivity {
}
// 作業の自動同期処理(onresumeで呼ばれる同期処理)
public
void
syncOperation
(
final
long
operationId
,
int
operationReportType
)
{
syncOperation
(
operationId
,
operationReportType
,
false
);
public
void
s
ingleS
yncOperation
(
final
long
operationId
,
int
operationReportType
)
{
s
ingleS
yncOperation
(
operationId
,
operationReportType
,
false
);
}
/**
* 作業同期処理
* 作業同期処理
(単一)
* @param operationId
* @param operationReportType
*/
public
void
syncOperation
(
final
long
operationId
,
int
operationReportType
,
boolean
buttonEventFlg
)
{
// TODO callback or return errorMsg どっちを使用すればいいか検討
syncOperation
(
operationId
,
operationReportType
,
buttonEventFlg
,
new
Callback
()
{
@Override
public
Object
callback
(
Object
ret
)
{
final
String
errorMessage
=
(
String
)
ret
;
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
errorMessage
!=
null
)
{
// エラーメッセージ表示
showSimpleAlertDialog
(
getString
(
R
.
string
.
app_name
),
errorMessage
);
closeProgressPopup
();
}
}
});
return
null
;
}
});
public
void
singleSyncOperation
(
final
long
operationId
,
int
operationReportType
,
boolean
buttonEventFlg
)
{
String
errorMessage
=
syncOperation
(
operationId
,
operationReportType
,
buttonEventFlg
);
if
(
errorMessage
!=
null
)
{
closeProgressPopup
();
// エラーメッセージ表示
showSimpleAlertDialog
(
getString
(
R
.
string
.
app_name
),
errorMessage
);
}
}
/**
...
...
@@ -873,9 +865,9 @@ public class OperationListActivity extends ABVUIActivity {
* @param operationId
* @param reportType
* @param buttonEventFlag
* @return result
true 正常 false 異常
* @return result
errorMessage
*/
public
void
syncOperation
(
final
long
operationId
,
int
reportType
,
boolean
buttonEventFlag
,
final
Callback
errorCallback
)
{
public
String
syncOperation
(
final
long
operationId
,
int
reportType
,
boolean
buttonEventFlag
)
{
final
StringBuilder
errorMsg
=
new
StringBuilder
();
Logger
.
i
(
TAG
,
"---sync start"
);
...
...
@@ -961,12 +953,11 @@ public class OperationListActivity extends ABVUIActivity {
mOperationLastEditDate
=
null
;
refreshOperationList
();
closeProgressPopup
();
// コールバック
errorCallback
.
callback
(
errorMsg
.
length
()
>
0
?
errorMsg
.
toString
()
:
null
);
}
});
Logger
.
i
(
TAG
,
"---sync end"
);
}
return
errorMsg
.
length
()
>
0
?
errorMsg
.
toString
()
:
null
;
}
// 設定画面へ遷移
...
...
@@ -1881,7 +1872,7 @@ public class OperationListActivity extends ABVUIActivity {
closeProgressPopup
();
}
}
else
{
syncOperation
(
operationDto
.
operationId
,
operationDto
.
reportType
,
true
);
s
ingleS
yncOperation
(
operationDto
.
operationId
,
operationDto
.
reportType
,
true
);
}
}
});
...
...
@@ -2279,9 +2270,9 @@ public class OperationListActivity extends ABVUIActivity {
dialog
.
setPositiveButton
(
R
.
string
.
ok
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
// 一括同期開始
categoryBatchSync
();
dialog
.
dismiss
();
}
});
dialog
.
setNegativeButton
(
R
.
string
.
cancel
,
new
DialogInterface
.
OnClickListener
()
{
...
...
@@ -2302,106 +2293,28 @@ public class OperationListActivity extends ABVUIActivity {
*/
public
void
categoryBatchSync
()
{
Logger
.
i
(
TAG
,
"---batch sync start"
);
// ネットワーク通信チェック
if
(!
ABVEnvironment
.
getInstance
().
networkAdapter
.
isNetworkConnected
())
{
showSimpleAlertDialog
(
getString
(
R
.
string
.
app_name
),
getString
(
R
.
string
.
request_network_connection
));
return
;
}
// 作業種別に関連する作業リストを取得
List
<
OperationDto
>
operationList
=
mOperationDao
.
getNeedSyncOperationByGroupMasterId
(
getABVUIDataCache
().
getOperationGroupMasterId
());
// 一覧に作業が存在しない場合
if
(
operationList
==
null
||
operationList
.
isEmpty
())
{
Logger
.
w
(
TAG
,
"categoryBatchSync operation is null or Empty"
);
return
;
}
// 作業リストをスタックにセット
Stack
<
OperationDto
>
operationDtoStack
=
new
Stack
<
OperationDto
>();
for
(
OperationDto
operationDto
:
operationList
)
{
operationDtoStack
.
push
(
operationDto
);
}
operationDtoStack
.
addAll
(
operationList
);
// 一括同期を設定
batchSyncView
=
new
ABVBatchSyncView
(
this
);
// batchSyncViewにスタックをセットして表示
batchSyncView
.
setStack
(
operationDtoStack
);
batchSyncView
.
show
();
// 一括同期処理
batchOperationSync
(
false
);
}
/**
* 一括同期処理(stackの中を全て同期する)
* @param downloadedFlg
*/
private
void
batchOperationSync
(
final
boolean
downloadedFlg
)
{
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
batchSyncView
.
isStackEmpty
())
{
batchSyncView
.
closeProgressDialog
();
return
;
}
if
(!
downloadedFlg
)
{
Logger
.
d
(
TAG
,
"batchOperation sync -- base file not downloaded"
);
// ベースファイルのダウンロードチェック
OperationDto
peekOperationDto
=
batchSyncView
.
getOperationStackPeek
();
ContentDto
contentDto
=
contentDao
.
getContent
(
peekOperationDto
.
contentId
);
if
(
contentDto
==
null
)
{
Logger
.
e
(
TAG
,
"contentDto is null !"
);
return
;
}
if
(!
contentDto
.
downloadedFlg
||
contentDto
.
updatedFlg
)
{
if
(!
operationContentDownload
(
contentDto
))
{
// error
showBatchSyncErrorAlert
(
getString
(
R
.
string
.
msg_batch_sync_content_download_fail
));
}
return
;
}
}
final
OperationDto
operationDto
=
batchSyncView
.
getOperationStackPop
();
// TODO callback or return errorMsg どっちを使用すればいいか検討
syncOperation
(
operationDto
.
operationId
,
operationDto
.
reportType
,
false
,
new
Callback
()
{
@Override
public
Object
callback
(
Object
ret
)
{
final
String
errorMessage
=
(
String
)
ret
;
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
errorMessage
!=
null
)
{
// error
if
(
ABVEnvironment
.
getInstance
().
networkAdapter
.
isNetworkConnected
())
{
showBatchSyncErrorAlert
(
String
.
format
(
getString
(
R
.
string
.
msg_batch_sync_error
),
operationDto
.
operationName
)
+
errorMessage
);
}
else
{
// ネットワーク通信エラー
showBatchSyncErrorAlert
(
getString
(
R
.
string
.
msg_batch_sync_disconnect_network
));
}
}
else
{
if
(
batchSyncView
.
checkMaxProgress
())
{
// 最後の処理が完了したと見做す
batchSyncView
.
closeProgressDialog
();
Logger
.
d
(
TAG
,
"---batchSync is end"
);
}
else
{
// プログレスバーに作業1つ完了をセット
batchSyncView
.
setProgress
(
batchSyncView
.
getProgress
()
+
1
);
// 次の作業を同期処理
batchOperationSync
(
false
);
}
}
}
});
return
null
;
}
});
}
});
}
/**
* 一括同期処理時、エラーアラート表示
* 一括同期中のプログレスバーは非表示にする
* @param msg
*/
private
void
showBatchSyncErrorAlert
(
String
msg
)
{
showSimpleAlertDialog
(
getString
(
R
.
string
.
app_name
),
msg
);
batchSyncView
.
closeProgressDialog
();
batchSyncView
.
batchOperationSyncForCheckDonwload
();
}
/**
...
...
@@ -2422,4 +2335,46 @@ public class OperationListActivity extends ABVUIActivity {
}
}
}
/**
* 作業用コンテンツダウンロード時、ダウンロードかダウンロード再開か判定して行う。
* @param contentDto
* @return
*/
public
boolean
operationContentDownload
(
final
ContentDto
contentDto
)
{
if
(
contentDto
.
isDownloadPaused
())
{
// ダウンロード途中で通信が切れた場合、一時停止のステータスに変更になるため、再開させる
try
{
contentDownloader
.
resume
(
contentDto
.
contentId
);
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
"downloadContent failed. contentId="
+
contentDto
.
contentId
,
e
);
return
false
;
}
}
else
{
// ダウンロード
return
contentDownload
(
contentDto
.
contentId
,
false
,
false
);
}
return
true
;
}
/**
* 一括同期の活性化・非活性化チェック
*/
public
void
checkBatchNeedSyncButton
(
Integer
operationGroupMasterId
)
{
if
(
mOperationDao
.
hasNeedSyncOperationByGroupMasterId
(
operationGroupMasterId
))
{
// 選択したカテゴリ一覧でneedSyncFlgがtrueの作業が存在すれば、活性化する
setEnabledImageButton
(
mOperationBatchSyncButton
,
true
);
}
else
{
// 一括同期ボタンを非活性化する
setEnabledImageButton
(
mOperationBatchSyncButton
,
false
);
}
}
@Override
public
void
onDestroy
()
{
Logger
.
d
(
TAG
,
"onDestroy"
);
contentDownloader
.
removeContentDownloadListener
(
this
);
batchSyncView
.
setActivityDestroy
();
super
.
onDestroy
();
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OperationGroupMasterListHelper.java
View file @
3329f676
...
...
@@ -74,6 +74,8 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
mAppActivity
.
closeOperationGroupMasterDialog
();
}
OperationGroupMasterDto
peekOperationGroupMasterDto
=
stack
.
peek
();
mAppActivity
.
checkBatchNeedSyncButton
(
peekOperationGroupMasterDto
.
operationGroupMasterId
);
// 作業種別IDで紐づく作業リストを取得
return
mOperationGroupMasterLogic
.
getOperationByOperationGroupMasterId
(
peekOperationGroupMasterDto
.
operationGroupMasterId
);
}
...
...
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