Commit 33b4f843 by Lee Munkyeong

データ更新の時ローディング表示修正

parent 1e2c86f9
......@@ -238,9 +238,10 @@ public class ContentRefresher {
if (!isRefreshing()) {
updateRefreshContentListState(-1L, null, mProgressCallback);
}
mProgressCallback.callback(100);
} catch (Exception e) {
Logger.e("refreshContent failed.", e);
mProgressCallback.callback(100);
updateRefreshContentListState(-1L, e);
}
contentDownloader.kickTask();
......
......@@ -170,10 +170,6 @@ public class OperationListActivity extends ABVUIActivity {
private Long mSelectedOperationId;
private Integer mScanType;
private Handler mHandler;
public static final int TIME_OUT = 1001;
public static final int TIME_OUT_LIMIT = 3600000;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -218,16 +214,6 @@ public class OperationListActivity extends ABVUIActivity {
// サービスオプション(作業種別使用)をセット
mOperationGroupMasterServiceOperationFlg = ABVDataCache.getInstance().serviceOption.isOperationGroupMaster();
mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (msg.what == TIME_OUT) {
closeProgressPopup();
}
}
};
if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId))) {
final long operationId = Long.parseLong(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId));
String message = getIntent().getStringExtra(AppDefType.PushMessageKey.message);
......@@ -364,41 +350,7 @@ public class OperationListActivity extends ABVUIActivity {
break;
case ABookKeys.CMD_KEY.REFRESH_CONTENT:
handler.post(new Runnable() {
@Override
public void run() {
showProgressBar(getString(R.string.msg_common_processing));
showProgressBar(getString(R.string.msg_common_processing));
}
});
final Callback progressCallback = new Callback() {
@Override
public Object callback(Object ret) {
final int progress = (int)ret;
runOnUiThread(new Runnable() {
@Override
public void run() {
if ((progressDialogHorizontal.getProgress() + progress) < 100) {
progressDialogHorizontal.setProgress(progressDialogHorizontal.getProgress() + progress);
} else {
progressDialogHorizontal.setProgress(100);
}
}
});
return null;
}
};
try {
dataRefresh(true, progressCallback);
} catch (Exception e) {
handler.post(new Runnable() {
@Override
public void run() {
closeProgressPopup();
}
});
}
dateUpdate();
break;
case ABookKeys.CMD_KEY.CHANGE_OPERATION_GROUP_MASTER:
......@@ -477,12 +429,14 @@ public class OperationListActivity extends ABVUIActivity {
@JavascriptInterface
public void hideLoading() {
handler.post(new Runnable() {
@Override
public void run() {
closeProgressPopup();
}
});
if (!contentRefresher.isRefreshing()) {
handler.post(new Runnable() {
@Override
public void run() {
closeProgressPopup();
}
});
}
}
}
......@@ -602,39 +556,7 @@ public class OperationListActivity extends ABVUIActivity {
if (operationId == -1) {
if (firstFlg) {
handler.post(new Runnable() {
@Override
public void run() {
showProgressBar(getString(R.string.msg_common_processing));
}
});
final Callback progressCallback = new Callback() {
@Override
public Object callback(Object ret) {
final int progress = (int)ret;
runOnUiThread(new Runnable() {
@Override
public void run() {
if ((progressDialogHorizontal.getProgress() + progress) < 100) {
progressDialogHorizontal.setProgress(progressDialogHorizontal.getProgress() + progress);
} else {
progressDialogHorizontal.setProgress(100);
}
}
});
return null;
}
};
try {
dataRefresh(true, progressCallback);
} catch (Exception e) {
handler.post(new Runnable() {
@Override
public void run() {
closeProgressPopup();
}
});
}
dateUpdate();
firstFlg = false;
}
runOnUiThread(new Runnable() {
......@@ -1374,7 +1296,7 @@ public class OperationListActivity extends ABVUIActivity {
//screenRefresh();
//10秒(コンテンツ作成し、公開までの時間)に新着更新させる。
showProgressBar(getString(R.string.msg_common_processing));
showProgressView(getString(R.string.msg_common_processing));
handler.postDelayed(new Runnable() {
@Override
public void run() {
......@@ -2071,8 +1993,40 @@ public class OperationListActivity extends ABVUIActivity {
});
}
public void showProgressBar(String msg) {
showProgressView(msg);
mHandler.sendEmptyMessageDelayed(TIME_OUT, TIME_OUT_LIMIT);
public void dateUpdate() {
handler.post(new Runnable() {
@Override
public void run() {
showProgressView(getString(R.string.msg_common_processing));
}
});
final Callback progressCallback = new Callback() {
@Override
public Object callback(Object ret) {
final int progress = (int)ret;
runOnUiThread(new Runnable() {
@Override
public void run() {
if ((progressDialogHorizontal.getProgress() + progress) < 100) {
progressDialogHorizontal.setProgress(progressDialogHorizontal.getProgress() + progress);
} else {
progressDialogHorizontal.setProgress(100);
}
}
});
return null;
}
};
try {
dataRefresh(true, progressCallback);
} catch (Exception e) {
handler.post(new Runnable() {
@Override
public void run() {
closeProgressPopup();
}
});
}
}
}
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