From 77688e52fdc2761f17ce24be9704ee25bff2194d Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期三, 04 十二月 2024 13:55:21 +0800 Subject: [PATCH] Merge branch '1.5.0' of http://172.16.1.23:6688/r/~wjc/HDLPhotovoltaicDebugAPP into 1.5.0 --- aa_chart_core/src/main/java/com/github/AAChartModel/AAChartCore/AAChartCreator/AAOptionsConstructor.java | 250 +++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/com/hdl/photovoltaic/ui/StartActivity.java | 6 app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java | 7 app/src/main/res/layout/fragment_home_page.xml | 2 app/src/main/java/com/hdl/photovoltaic/ui/home/aachart/BasicChartComposer.java | 1 app/src/main/java/com/hdl/photovoltaic/other/HdlLogLogic.java | 22 +++- app/src/main/res/layout/activity_test_log.xml | 1 7 files changed, 273 insertions(+), 16 deletions(-) diff --git a/aa_chart_core/src/main/java/com/github/AAChartModel/AAChartCore/AAChartCreator/AAOptionsConstructor.java b/aa_chart_core/src/main/java/com/github/AAChartModel/AAChartCore/AAChartCreator/AAOptionsConstructor.java index 4cec63a..ffc54eb 100644 --- a/aa_chart_core/src/main/java/com/github/AAChartModel/AAChartCore/AAChartCreator/AAOptionsConstructor.java +++ b/aa_chart_core/src/main/java/com/github/AAChartModel/AAChartCore/AAChartCreator/AAOptionsConstructor.java @@ -42,6 +42,231 @@ * SegmentFault : https://segmentfault.com/u/huanghunbieguan * <p> * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- + * <p> + * ------------------------------------------------------------------------------- + * <p> + * 馃寱 馃寲 馃寳 馃寴 鉂�鉂�鉂� WARM TIPS!!! 鉂�鉂�鉂� 馃寫 馃寬 馃寭 馃寯 + * <p> + * Please contact me on GitHub,if there are any problems encountered in use. + * GitHub Issues : https://github.com/AAChartModel/AAChartCore/issues + * ------------------------------------------------------------------------------- + * And if you want to contribute for this project, please contact me as well + * GitHub : https://github.com/AAChartModel + * StackOverflow : https://stackoverflow.com/users/7842508/codeforu + * JianShu : http://www.jianshu.com/u/f1e6753d4254 + * SegmentFault : https://segmentfault.com/u/huanghunbieguan + * <p> + * ------------------------------------------------------------------------------- */ /** @@ -113,11 +338,32 @@ .align(aaChartModel.subtitleAlign) //鍥捐〃鍓爣棰樻枃鏈按骞冲榻愭柟寮忋�傚彲閫夌殑鍊兼湁 鈥渓eft鈥濓紝鈥漜enter鈥滃拰鈥渞ight鈥濄�� 榛樿鏄細center. .style(aaChartModel.subtitleStyle); + AAStyle aaStyle = new AAStyle(); + aaStyle.fontSize(12); + aaStyle.width(183); + aaStyle.height(49); + aaStyle.color(AAColor.rgbaColor(255, 255, 255, 0.4f)); + + AATooltip aaTooltip = new AATooltip() .enabled(aaChartModel.tooltipEnabled) //鍚敤娴姩鎻愮ず妗� - .shared(true) //澶氱粍鏁版嵁鍏变韩涓�涓诞鍔ㄦ彁绀烘 +// .shared(true) //澶氱粍鏁版嵁鍏变韩涓�涓诞鍔ㄦ彁绀烘 + .backgroundColor(AAColor.rgbaColor(85, 88, 89, 1f)) + .borderRadius(8) + .borderWidth(0) + .style(aaStyle) .valueSuffix(aaChartModel.tooltipValueSuffix) //娴姩鎻愮ず妗嗙殑鍗曚綅鍚嶇О鍚庣紑 - ; + .useHTML(true) + .formatter(" function () {\n" + + " return ' 馃寱 馃寲 馃寳 馃寴 馃寫 馃寬 馃寭 馃寯 <br/> '\n" + + " + ' Support JavaScript Function Just Right Now !!! <br/> '\n" + + " + ' The Gold Price For <b>2020 '\n" + + " + this.x\n" + + " + ' </b> Is <b style='color:#333738'> '\n" + + " + this.y\n" + + " + ' </b> Dollars ';\n" + + " }"); + aaTooltip.valueSuffix(aaChartModel.tooltipValueSuffix).style(new AAStyle().color("#FFFFFF")); AAPlotOptions aaPlotOptions = new AAPlotOptions() .series(new AASeries() diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlLogLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlLogLogic.java index ff3cde6..357d044 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlLogLogic.java +++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlLogLogic.java @@ -12,13 +12,18 @@ */ public class HdlLogLogic { - //鏄惁闇�瑕佹墦鍗板埌Logcat涓�(false涓嶉渶瑕佹墦鍗�) - public static boolean isPrintLogcat = true; + //鏄惁鍚姩鎵撳嵃鍒癓ogcat涓婄殑鏍囩(true:琛ㄧず鎵撳嵃锛宖alse锛氳〃绀轰笉鎵撳嵃) + public static boolean isStartPrintLogcat = true; + + //鏄惁鍚姩鍔犲埌鍐呭瓨閲岄潰鐨勬爣绛�(true:琛ㄧず鍔犲叆锛宖alse锛氳〃绀轰笉鍔犲叆) + public static boolean isStartAddToMemory = false; //榛樿鎵撳嵃鏍囬 private static String logTitle = "鑷畾涔夎緭鍑烘墦鍗颁俊鎭�"; - private static Gson gson = new Gson(); + private static final Gson gson = new Gson(); + + private static final CustomLogObject customLogObject = new CustomLogObject(); /** * java鎵撳嵃 @@ -60,15 +65,18 @@ */ private static void printBase(String msg, String code, boolean isAddToMemory) { try { - CustomLogObject customLogObject = new CustomLogObject(); +// //濡傛灉杩欓噷棰戠箒鐨刵ew瀵硅薄鍙兘浼氬奖鍝嶅姞杞芥暟鎹�熷害 +// CustomLogObject customLogObject = new CustomLogObject(); customLogObject.setMsgOrData(msg); customLogObject.setCode(code); String json = logTitle + (UserConfigManage.getInstance().isBAccount() ? "(B绔�)==" : "(C绔�)==") + gson.toJson(customLogObject); - if (isPrintLogcat) { + if (isStartPrintLogcat) { System.out.println(json); } - if (isAddToMemory) { - writeLog(json); + if (isStartAddToMemory) { + if (isAddToMemory) { + writeLog(json); + } } } catch (Exception ignored) { } diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/StartActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/StartActivity.java index 6c3f431..94a43ce 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/StartActivity.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/StartActivity.java @@ -43,11 +43,11 @@ openActivity(intent); } else { //C绔敤鎴疯烦杞晫闈� - showLoading(); +// showLoading(); HdlResidenceLogic.getInstance().getResidenceIdList("", "", new CloudCallBeak<List<HouseIdBean>>() { @Override public void onSuccess(List<HouseIdBean> obj) { - hideLoading(); +// hideLoading(); HdlResidenceLogic.getInstance().setHouseIdList(obj); Intent intent = new Intent(); intent.setClass(StartActivity.this, CPowerStationActivity.class); @@ -56,7 +56,7 @@ @Override public void onFailure(HDLException e) { - hideLoading(); +// hideLoading(); Intent intent = new Intent(); intent.setClass(StartActivity.this, CPowerStationActivity.class); openActivity(intent); 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 15db7ab..28f214f 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 @@ -416,13 +416,14 @@ aaChartModel = configureColorfulColumnChart(getString(R.string.generation), fieldNames, fieldValues); } + if(needDelay) { viewBinding.autoSizeMyAAChart.setX(10000);//鐩存帴鎵撳紑鏈夐棯灞忥紝鍦ㄤ笉鏄剧ず鐨勫湴鏂瑰厛鏄剧ず锛屽啀绉诲姩鍒版甯哥殑浣嶇疆銆俆ODO 鍚庣画鎵惧埌鏍规簮闂鍚庡幓鎺夎繖涓敤娉� - aaChartView.aa_drawChartWithChartModel(aaChartModel); + aaChartView.aa_drawChartWithChartOptions(aaChartModel.aa_toAAOptions()); mHandler.sendEmptyMessageDelayed(100,800); } else{ - aaChartView.aa_drawChartWithChartModel(aaChartModel); + aaChartView.aa_drawChartWithChartOptions(aaChartModel.aa_toAAOptions()); } } @@ -667,4 +668,4 @@ } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/home/aachart/BasicChartComposer.java b/app/src/main/java/com/hdl/photovoltaic/ui/home/aachart/BasicChartComposer.java index 07db5b1..e322272 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/home/aachart/BasicChartComposer.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/home/aachart/BasicChartComposer.java @@ -79,6 +79,7 @@ AATooltip aaTooltip = new AATooltip() .enabled(true) + .backgroundColor(AAColor.rgbaColor(51, 55, 56, 1f)) .valueDecimals(2); AASeriesElement element1 = new AASeriesElement() diff --git a/app/src/main/res/layout/activity_test_log.xml b/app/src/main/res/layout/activity_test_log.xml index 8fad593..4747004 100644 --- a/app/src/main/res/layout/activity_test_log.xml +++ b/app/src/main/res/layout/activity_test_log.xml @@ -4,6 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:background="@color/text_FFFFFFFF" tools:context=".ui.test.TestLogActivity"> <RelativeLayout diff --git a/app/src/main/res/layout/fragment_home_page.xml b/app/src/main/res/layout/fragment_home_page.xml index 3185457..71a6dc3 100644 --- a/app/src/main/res/layout/fragment_home_page.xml +++ b/app/src/main/res/layout/fragment_home_page.xml @@ -55,7 +55,7 @@ <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingBottom="@dimen/dp_16" + android:paddingBottom="@dimen/dp_10" > -- Gitblit v1.8.0