| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.homepage_title_tab_switch, ConstantManage.station_page, PowerStationStatus.All); |
| | | |
| | | } |
| | | }); |
| | | //故障 |
| | |
| | | viewBinding.homePageStationSelectTimeLl.setVisibility(View.VISIBLE); |
| | | viewBinding.autoSizeMyAAChart.setBackgroundColor(_mActivity.getColor(R.color.text_FF1C1C1E)); |
| | | setUpAAChartView(true);//图表加载 |
| | | processLogic(); |
| | | pullToRefresh(); |
| | | |
| | | } |
| | | |
| | | protected void processLogic() { |
| | | /** |
| | | * 下拉刷新的逻辑 |
| | | */ |
| | | protected void pullToRefresh() { |
| | | viewBinding.rsl.setDelegate(this); |
| | | HDLRefreshViewHolder hdlRefreshViewHolder = new HDLRefreshViewHolder(_mActivity, true); |
| | | hdlRefreshViewHolder.setPullDownImageResource(R.mipmap.loading_44); |
| | |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (list == null || list.size() == 0) { |
| | | if (list == null || list.isEmpty()) { |
| | | return; |
| | | } |
| | | String[] keys = new String[list.size()]; |
| | | Object[] values = new Object[list.size()]; |
| | | for (int i = 0; i < list.size(); i++) { |
| | | keys[i] = list.get(i).getFieldName(); |
| | | StatisticsBean statisticsBean = list.get(i); |
| | | keys[i] = statisticsBean.getFieldName(); |
| | | if (TimeType.day.equals(timeType)) { |
| | | values[i] = HdlCommonLogic.convertBigDecimal(list.get(i).getFieldValue(), 1000);// HdlCommonLogic.getBigDecimal(list.get(i).getFieldValue()).intValue();//获取整数部分 |
| | | if (statisticsBean.isFuture()) { |
| | | //未来时间不显示 |
| | | values[i] = null; |
| | | } else { |
| | | values[i] = HdlCommonLogic.convertBigDecimal(statisticsBean.getFieldValue(), 1000);// HdlCommonLogic.getBigDecimal(list.get(i).getFieldValue()).intValue();//获取整数部分 |
| | | } |
| | | } else { |
| | | values[i] = HdlCommonLogic.getBigDecimal(list.get(i).getFieldValue()); |
| | | if (statisticsBean.isFuture()) { |
| | | //未来时间不显示 |
| | | values[i] = null; |
| | | } else { |
| | | values[i] = HdlCommonLogic.getBigDecimal(statisticsBean.getFieldValue()); |
| | | } |
| | | } |
| | | } |
| | | fieldNames = keys; |