| | |
| | | import android.text.style.ClickableSpan; |
| | | import android.text.style.ForegroundColorSpan; |
| | | import android.text.style.StyleSpan; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | |
| | |
| | | } else if (TimeType.month.equals(timeType) || TimeType.year.equals(timeType) || TimeType.all.equals(timeType)) { |
| | | aaChartModel = configureColorfulColumnChart(getString(R.string.generation), fieldNames, fieldValues); |
| | | } |
| | | |
| | | |
| | | if(needDelay) { |
| | | viewBinding.autoSizeMyAAChart.setX(10000);//直接打开有闪屏,在不显示的地方先显示,再移动到正常的位置。TODO 后续找到根源问题后去掉这个用法 |
| | | aaChartView.aa_drawChartWithChartOptions(aaChartModel.aa_toAAOptions()); |
| | | mHandler.sendEmptyMessageDelayed(100,800); |
| | | } |
| | | else{ |
| | | aaChartView.aa_drawChartWithChartOptions(aaChartModel.aa_toAAOptions()); |
| | | } |
| | | } |
| | | |
| | | FHandler mHandler=new FHandler(this); |
| | | |
| | | private static class FHandler extends Handler{ |
| | | //定义弱引用实例 |
| | | private WeakReference<HomePageFragment> reference; |
| | | |
| | | //在构造方法中传入需要持有的fragment实例 |
| | | public FHandler(HomePageFragment fragment) { |
| | | reference = new WeakReference<HomePageFragment>(fragment); } |
| | | |
| | | //通过复写handlerMessage()从而决定如何进行更新UI操作 |
| | | @Override |
| | | public void handleMessage(Message msg) { |
| | | //省略代码 |
| | | |
| | | switch (msg.what){ |
| | | case 100: |
| | | if(reference.get()!=null) { |
| | | reference.get().viewBinding.autoSizeMyAAChart.setX(0);//移动到正确的位置 |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | aaChartView.aa_drawChartWithChartOptions(aaChartModel.aa_toAAOptions()); |
| | | } |
| | | |
| | | @Override |
| | | public void onDestroy() { |
| | | super.onDestroy(); |
| | | mHandler.removeCallbacksAndMessages(null); |
| | | } |
| | | |
| | | private void initView() { |
| | |
| | | viewBinding.v2.setVisibility(View.VISIBLE); |
| | | viewBinding.v3.setVisibility(View.VISIBLE); |
| | | viewBinding.homePageStationSelectTimeLl.setVisibility(View.VISIBLE); |
| | | viewBinding.autoSizeMyAAChart.setBackgroundColor(_mActivity.getColor(R.color.text_FF1C1C1E)); |
| | | setUpAAChartView(true);//图表加载 |
| | | } |
| | | |
| | |
| | | } |
| | | viewBinding.stationAllTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getTotal())); |
| | | viewBinding.stationFaultsTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getFault())); |
| | | viewBinding.stationOfflineTitleTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getOffline())); |
| | | viewBinding.stationOfflineTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getOffline())); |
| | | viewBinding.stationConnectedTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getConnecting())); |
| | | } |
| | | |