From cae6ff870b1e9f1278a8fa21ab1013e68569607a Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期三, 15 五月 2024 19:31:33 +0800
Subject: [PATCH] 2024年05月15日19:31:32

---
 app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java |   50 +++++++++++++++++++++++++++-----------------------
 1 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java b/app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java
index 58309c2..0b72e9d 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java
@@ -1,7 +1,7 @@
 package com.hdl.photovoltaic.ui.home;
 
 
-import static com.hdl.photovoltaic.ui.powerstation.aachart.CustomStyleChartComposer.configureColorfulColumnChart;
+import static com.hdl.photovoltaic.ui.home.aachart.CustomStyleChartComposer.configureColorfulColumnChart;
 
 import android.os.Bundle;
 import android.text.TextUtils;
@@ -33,7 +33,7 @@
 import com.hdl.photovoltaic.ui.bean.DataOverBean;
 import com.hdl.photovoltaic.ui.bean.SocialContributionBean;
 import com.hdl.photovoltaic.ui.bean.StatisticsBean;
-import com.hdl.photovoltaic.ui.powerstation.aachart.BasicChartComposer;
+import com.hdl.photovoltaic.ui.home.aachart.BasicChartComposer;
 import com.hdl.photovoltaic.utils.TimeUtils;
 import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
 
@@ -54,7 +54,7 @@
 
     FragmentHomePageBinding viewBinding;
 
-    AAChartView aaChartView;
+    AutoSizeMyAAChart aaChartView;
 
     AAChartModel aaChartModel;
 
@@ -74,14 +74,15 @@
 
     @Override
     public void onBindView(Bundle savedInstanceState) {
+
         //鍒濆鍖�
         initView();
         //鍒濆鍖栫晫闈㈢洃鍚櫒
         initEvent();
         //璇诲彇鏁版嵁
         readDate();
-
     }
+
 
     /**
      * 璇诲彇鏁版嵁
@@ -121,13 +122,13 @@
                 viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_38C494));
 
                 viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.v1.setVisibility(View.GONE);
                 viewBinding.v2.setVisibility(View.VISIBLE);
@@ -150,16 +151,16 @@
                 }
                 timeType = TimeType.month;
                 viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_38c494));
                 viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_38C494));
 
                 viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.v1.setVisibility(View.GONE);
                 viewBinding.v2.setVisibility(View.GONE);
@@ -182,16 +183,16 @@
                 }
                 timeType = TimeType.year;
                 viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_38c494));
                 viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_38C494));
 
                 viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.v1.setVisibility(View.VISIBLE);
                 viewBinding.v2.setVisibility(View.GONE);
@@ -212,13 +213,13 @@
                 }
                 timeType = TimeType.all;
                 viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+                viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
 
                 viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_38c494));
                 viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_38C494));
@@ -275,6 +276,8 @@
                 readDate();
             }
         });
+
+
     }
 
     /**
@@ -318,12 +321,12 @@
                 .setTitleText(_mActivity.getString(R.string.time_selectd))//鏍囬鏂囧瓧
                 .setOutSideCancelable(true)//鐐瑰嚮灞忓箷锛岀偣鍦ㄦ帶浠跺閮ㄨ寖鍥存椂锛屾槸鍚﹀彇娑堟樉绀�
                 .isCyclic(false)//鏄惁寰幆婊氬姩
-                .setTitleColor(_mActivity.getColor(R.color.text_90000000))//鏍囬鏂囧瓧棰滆壊
+                .setTitleColor(_mActivity.getColor(R.color.text_E6000000))//鏍囬鏂囧瓧棰滆壊
                 .setSubmitColor(_mActivity.getColor(R.color.text_38C494))//纭畾鎸夐挳鏂囧瓧棰滆壊
-                .setCancelColor(_mActivity.getColor(R.color.text_40000000))//鍙栨秷鎸夐挳鏂囧瓧棰滆壊
+                .setCancelColor(_mActivity.getColor(R.color.text_66000000))//鍙栨秷鎸夐挳鏂囧瓧棰滆壊
                 .setTitleBgColor(_mActivity.getColor(R.color.text_FFFFFFFF))//鏍囬鑳屾櫙棰滆壊 Night mode
                 .setBgColor(_mActivity.getColor(R.color.text_FFFFFFFF))//婊氳疆鑳屾櫙棰滆壊 Night mode
-                .setTextColorCenter(_mActivity.getColor(R.color.text_90000000)).setDate(selectedDate)// 濡傛灉涓嶈缃殑璇濓紝榛樿鏄郴缁熸椂闂�*/
+                .setTextColorCenter(_mActivity.getColor(R.color.text_E6000000)).setDate(selectedDate)// 濡傛灉涓嶈缃殑璇濓紝榛樿鏄郴缁熸椂闂�*/
                 .setRangDate(startDate, endDate)//璧峰缁堟骞存湀鏃ヨ瀹�
                 .setLabel(_mActivity.getString(R.string.year), _mActivity.getString(R.string.month), _mActivity.getString(R.string.day), _mActivity.getString(R.string.hour), _mActivity.getString(R.string.minute), _mActivity.getString(R.string.seconds))//榛樿璁剧疆涓哄勾鏈堟棩鏃跺垎绉�
                 .isCenterLabel(false) //鏄惁鍙樉绀轰腑闂撮�変腑椤圭殑label鏂囧瓧锛宖alse鍒欐瘡椤筰tem鍏ㄩ儴閮藉甫鏈塴abel銆�
@@ -338,7 +341,7 @@
      * 鍥捐〃鍔犺浇
      */
     private void setUpAAChartView() {
-        aaChartView = viewBinding.AAChartView;
+        aaChartView = viewBinding.autoSizeMyAAChart;
         aaChartView.callBack = this;
         if (TimeType.day.equals(timeType)) {
             aaChartModel = BasicChartComposer.configureAreaChart("Pv鍙戠數鍔熺巼", fieldNames, fieldValues);
@@ -348,6 +351,7 @@
             aaChartModel = configureColorfulColumnChart("Pv鍙戠數鍔熺巼", fieldNames, fieldValues);
         }
         aaChartView.aa_drawChartWithChartModel(aaChartModel);
+
     }
 
     private void initView() {
@@ -371,11 +375,11 @@
         viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_38c494));
         viewBinding.dayTv.setTextColor(_mActivity.getColor(R.color.text_38C494));
         viewBinding.monthTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-        viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+        viewBinding.monthTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
         viewBinding.yearTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-        viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+        viewBinding.yearTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
         viewBinding.lifeCycleTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.color.text_00000000));
-        viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_40000000));
+        viewBinding.lifeCycleTv.setTextColor(_mActivity.getColor(R.color.text_66000000));
         viewBinding.v1.setVisibility(View.GONE);
         viewBinding.v2.setVisibility(View.VISIBLE);
         viewBinding.v3.setVisibility(View.VISIBLE);

--
Gitblit v1.8.0