|
|
@@ -20,6 +20,7 @@ import com.common.LogUtil;
|
|
|
import com.core.app.Constants;
|
|
|
import com.core.utils.CommonUtil;
|
|
|
import com.core.widget.DrawableCenterTextView;
|
|
|
+import com.core.widget.EmptyLayout;
|
|
|
import com.core.widget.view.MyGridView;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshBase;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshListView;
|
|
|
@@ -59,7 +60,11 @@ public class ReportStatisticsActivity extends BaseActivity {
|
|
|
private DrawableCenterTextView mSearchTextView;
|
|
|
private String mCurrentMaster;
|
|
|
private String mCurrentUser;
|
|
|
+ private EmptyLayout mEmptyLayout;
|
|
|
boolean flag = false;
|
|
|
+ private int[] mColors = new int[]{R.color.data_inquiry_gird_menu_color1, R.color.data_inquiry_gird_menu_color2
|
|
|
+ , R.color.data_inquiry_gird_menu_color3, R.color.data_inquiry_gird_menu_color4, R.color.data_inquiry_gird_menu_color5,
|
|
|
+ R.color.data_inquiry_gird_menu_color6};
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
@@ -196,6 +201,12 @@ public class ReportStatisticsActivity extends BaseActivity {
|
|
|
mReportStatisticsModulView.setBackgroundColor(getResources().getColor(R.color.black));
|
|
|
mReportStatisticsModulTitleTv.setText("最近查询业务");
|
|
|
|
|
|
+ mEmptyLayout = new EmptyLayout(this, mMenuListView.getRefreshableView());
|
|
|
+ mEmptyLayout.setShowLoadingButton(false);
|
|
|
+ mEmptyLayout.setShowEmptyButton(false);
|
|
|
+ mEmptyLayout.setShowErrorButton(false);
|
|
|
+ mEmptyLayout.setEmptyMessage("数据为空");
|
|
|
+
|
|
|
AbsListView.LayoutParams layoutParams = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, AbsListView.LayoutParams.WRAP_CONTENT);
|
|
|
mRecentBrowseLl.setLayoutParams(layoutParams);
|
|
|
|
|
|
@@ -239,6 +250,7 @@ public class ReportStatisticsActivity extends BaseActivity {
|
|
|
for (int k = 0; k < reportList.size(); k++) {
|
|
|
if (inquiryGirdItemBean.getIconText().equals(reportList.get(k).getTitle())) {
|
|
|
isExist = true;
|
|
|
+ inquiryGirdItemBean.setColor(mColors[(j) % mColors.length]);
|
|
|
break loop;
|
|
|
}
|
|
|
}
|
|
|
@@ -252,7 +264,7 @@ public class ReportStatisticsActivity extends BaseActivity {
|
|
|
|
|
|
}
|
|
|
|
|
|
- String recentJson = JSON.toJSON(recentBrowse).toString();
|
|
|
+ String recentJson = JSON.toJSON(resultBrowse).toString();
|
|
|
CommonUtil.setSharedPreferences(ReportStatisticsActivity.this
|
|
|
, mCurrentUser + mCurrentMaster + com.xzjmyk.pm.activity.ui.erp.activity.datainquiry.Constants.CONSTANT.REPORT_QUERY_MENU_RECENT_CACHE
|
|
|
, recentJson);
|
|
|
@@ -280,7 +292,8 @@ public class ReportStatisticsActivity extends BaseActivity {
|
|
|
public void handleMessage(Message msg) {
|
|
|
switch (msg.what) {
|
|
|
case GET_MENU_DATA:
|
|
|
- progressDialog.dismiss();
|
|
|
+ if (progressDialog.isShowing())
|
|
|
+ progressDialog.dismiss();
|
|
|
if (mMenuListView.isRefreshing())
|
|
|
mMenuListView.onRefreshComplete();
|
|
|
String result = msg.getData().getString("result");
|
|
|
@@ -292,10 +305,13 @@ public class ReportStatisticsActivity extends BaseActivity {
|
|
|
analysisMenuData(result);
|
|
|
break;
|
|
|
case Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
- progressDialog.dismiss();
|
|
|
+ if (progressDialog.isShowing())
|
|
|
+ progressDialog.dismiss();
|
|
|
if (mMenuListView.isRefreshing())
|
|
|
mMenuListView.onRefreshComplete();
|
|
|
ToastMessage(msg.getData().getString("result"));
|
|
|
+ mEmptyLayout.setErrorMessage(msg.getData().getString("result"));
|
|
|
+ mEmptyLayout.showError();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -339,9 +355,19 @@ public class ReportStatisticsActivity extends BaseActivity {
|
|
|
}
|
|
|
}
|
|
|
mReportStatisticsMenuListAdapter.notifyDataSetChanged();
|
|
|
- //setListViewHeightBasedOnChildren(mMenuListView);
|
|
|
+
|
|
|
+ if (mGridMenuReportStatisticsBeans.size() == 0) {
|
|
|
+ mSearchTextView.setVisibility(View.GONE);
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
+ } else {
|
|
|
+ mSearchTextView.setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
+
|
|
|
if (flag)
|
|
|
refreshRecentHeader();
|
|
|
+ } else {
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
+ mSearchTextView.setVisibility(View.GONE);
|
|
|
}
|
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|