|
|
@@ -2,6 +2,7 @@ package com.usai.apex.mainframe;
|
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
+import android.app.ProgressDialog;
|
|
|
import android.content.BroadcastReceiver;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
@@ -366,6 +367,28 @@ public void checkDirty()
|
|
|
super.onHiddenChanged(hidden);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private ProgressDialog mProgressDialog;
|
|
|
+
|
|
|
+ public void showProgressDialog() {
|
|
|
+
|
|
|
+ if (mProgressDialog == null) {
|
|
|
+ if (getContext() == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ mProgressDialog = new ProgressDialog(getContext());
|
|
|
+ mProgressDialog.setCancelable(false);
|
|
|
+ mProgressDialog.setMessage("Loading...");
|
|
|
+ }
|
|
|
+ mProgressDialog.show();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void dismissProgressDialog() {
|
|
|
+ if (mProgressDialog != null && mProgressDialog.isShowing()) {
|
|
|
+ mProgressDialog.dismiss();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private boolean loading = false;
|
|
|
private void loadKPIData() {
|
|
|
|
|
|
@@ -374,8 +397,9 @@ public void checkDirty()
|
|
|
}
|
|
|
|
|
|
loading = true;
|
|
|
- mLoadIndicator.setVisibility(View.VISIBLE);
|
|
|
+// mLoadIndicator.setVisibility(View.VISIBLE);
|
|
|
|
|
|
+ showProgressDialog();
|
|
|
|
|
|
new Thread(new Runnable() {
|
|
|
@Override
|
|
|
@@ -392,6 +416,7 @@ public void checkDirty()
|
|
|
if (mSwipeRefresh.isRefreshing()) {
|
|
|
mSwipeRefresh.setRefreshing(false);
|
|
|
}
|
|
|
+ dismissProgressDialog();
|
|
|
prepareData();
|
|
|
// if (mKPIArr != null && mKPIArr.size() > 0) {
|
|
|
// mKPIPager.setCurrentItem(currentKPI,false);
|
|
|
@@ -570,6 +595,12 @@ public void checkDirty()
|
|
|
return view == object;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public int getItemPosition(Object object) {
|
|
|
+// return super.getItemPosition(object);
|
|
|
+ return POSITION_NONE;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void destroyItem(ViewGroup container, int position, Object object) {
|
|
|
|