aa_chart_core/src/main/java/com/github/AAChartModel/AAChartCore/AAChartCreator/AAChartModel.java
@@ -1,22 +1,22 @@ /** // AAChartModel.java // AAChartCore // // Created by AnAn on 2017/9/5. // Copyright © 2018年 An An. All rights reserved. * // AAChartModel.java * // AAChartCore * // * // Created by AnAn on 2017/9/5. * // Copyright © 2018年 An An. All rights reserved. * <p> * ◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉ ...... SOURCE CODE ......◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉ * ◉◉◉................................................... ◉◉◉ * ◉◉◉ https://github.com/AAChartModel/AAChartCore ◉◉◉ * ◉◉◉ https://github.com/AAChartModel/AAChartCore-Kotlin ◉◉◉ * ◉◉◉................................................... ◉◉◉ * ◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉ ...... SOURCE CODE ......◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉ * <p> * <p> * ------------------------------------------------------------------------------- * * 🌕 🌖 🌗 🌘 ❀❀❀ WARM TIPS!!! ❀❀❀ 🌑 🌒 🌓 🌔 * * <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 * ------------------------------------------------------------------------------- @@ -25,9 +25,8 @@ * StackOverflow : https://stackoverflow.com/users/7842508/codeforu * JianShu : http://www.jianshu.com/u/f1e6753d4254 * SegmentFault : https://segmentfault.com/u/huanghunbieguan * * <p> * ------------------------------------------------------------------------------- */ package com.github.AAChartModel.AAChartCore.AAChartCreator; @@ -44,51 +43,50 @@ public class AAChartModel { public String animationType; //动画类型 public String animationType; //动画类型 public Integer animationDuration; //动画时间 public String title; //标题内容 public String title; //标题内容 public AAStyle titleStyle; //标题文本风格样式 public String subtitle; //副标题内容 public String subtitleAlign; //副标题水平对齐方式 public String subtitle; //副标题内容 public String subtitleAlign; //副标题水平对齐方式 public AAStyle subtitleStyle; //副标题文本风格样式 public String axesTextColor; //x 轴和 y 轴文字颜色 public String chartType; //图表类型 public String stacking; //堆积样式 public String markerSymbol; //折线曲线连接点的类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" public String markerSymbolStyle; //折线曲线连接点的自定义风格样式 public String zoomType; //缩放类型 AAChartZoomTypeX表示可沿着 x 轴进行手势缩放 public String axesTextColor; //x 轴和 y 轴文字颜色 public String chartType; //图表类型 public String stacking; //堆积样式 public String markerSymbol; //折线曲线连接点的类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" public String markerSymbolStyle; //折线曲线连接点的自定义风格样式 public String zoomType; //缩放类型 AAChartZoomTypeX表示可沿着 x 轴进行手势缩放 public Boolean inverted; //x 轴是否翻转(垂直) public Boolean xAxisReversed; //x 轴翻转 public Boolean yAxisReversed; //y 轴翻转 public Boolean tooltipEnabled; //是否显示浮动提示框(默认显示) public String tooltipValueSuffix; //浮动提示框单位后缀 public String tooltipValueSuffix; //浮动提示框单位后缀 public Boolean gradientColorEnable; //是否要为渐变色 public Boolean polar; //是否极化图形(变为雷达图) public Number[]margin; //图表外边缘和绘图区域之间的边距 public Number[] margin; //图表外边缘和绘图区域之间的边距 public Boolean dataLabelsEnabled; //是否显示数据 public AAStyle dataLabelsStyle; //数据文本风格样式 public Boolean xAxisLabelsEnabled; //x 轴是否显示数据 public Integer xAxisTickInterval; //x 轴刻度点间隔数(设置每隔几个点显示一个 X轴的内容) public String[]categories; //x 轴是否显示数据 public Number xAxisGridLineWidth; //x 轴网格线的宽度 public String[] categories; //x 轴是否显示数据 public Number xAxisGridLineWidth; //x 轴网格线的宽度 public Boolean xAxisVisible; //x 轴是否显示 public Boolean yAxisVisible; //y 轴是否显示 public Boolean yAxisLabelsEnabled; //y 轴是否显示数据 public String yAxisTitle; //y 轴标题 public Number yAxisLineWidth; //y 轴轴线的宽度 public Number yAxisMin; //y 轴最小值 public Number yAxisMax; //y 轴最大值 public String yAxisTitle; //y 轴标题 public Number yAxisLineWidth; //y 轴轴线的宽度 public Number yAxisMin; //y 轴最小值 public Number yAxisMax; //y 轴最大值 public Boolean yAxisAllowDecimals; //y 轴是否允许显示小数 public Number yAxisGridLineWidth; //y 轴网格线的宽度 public Object[]colorsTheme; //图表主题颜色数组 public Number yAxisGridLineWidth; //y 轴网格线的宽度 public Object[] colorsTheme; //图表主题颜色数组 public Boolean legendEnabled; //是否显示图例 public Object backgroundColor; //图表背景色 public Number borderRadius; //柱状图长条图头部圆角半径(可用于设置头部的形状,仅对条形图,柱状图有效) public Number markerRadius; //折线连接点的半径长度 public Object[]series; //图表的数据列内容 public Object backgroundColor; //图表背景色 public Number borderRadius; //柱状图长条图头部圆角半径(可用于设置头部的形状,仅对条形图,柱状图有效) public Number markerRadius; //折线连接点的半径长度 public Object[] series; //图表的数据列内容 public Boolean touchEventEnabled; //是否支持用户触摸事件 public AAScrollablePlotArea scrollablePlotArea; public AAChartModel animationType(String prop) { @@ -317,29 +315,29 @@ } public AAChartModel() { chartType = AAChartType.Line; title = ""; yAxisTitle = ""; animationDuration = 500;//以毫秒为单位 animationType = AAChartAnimationType.Linear; inverted = false; stacking = AAChartStackingType.False; xAxisReversed = false; yAxisReversed = false; zoomType = AAChartZoomType.None; dataLabelsEnabled = false; markerSymbolStyle = AAChartSymbolStyleType.Normal; colorsTheme = new String[]{"#fe117c","#ffc069","#06caf4","#7dffc0"};//默认的颜色数组(必须要添加默认数组,否则就会出错) gradientColorEnable = false; polar = false; xAxisLabelsEnabled = true; xAxisGridLineWidth = 0f; yAxisLabelsEnabled = true; yAxisGridLineWidth = 1f; legendEnabled = true; backgroundColor = "#ffffff"; borderRadius = 0f;//柱状图长条图头部圆角半径(可用于设置头部的形状,仅对条形图,柱状图有效,设置为1000时,柱形图或者条形图头部为楔形) markerRadius = 6f;//折线连接点的半径长度,如果值设置为0,这样就相当于不显示了 chartType = AAChartType.Line; title = ""; yAxisTitle = ""; animationDuration = 500;//以毫秒为单位 animationType = AAChartAnimationType.Linear; inverted = false; stacking = AAChartStackingType.False; xAxisReversed = false; yAxisReversed = false; zoomType = AAChartZoomType.None; dataLabelsEnabled = false; markerSymbolStyle = AAChartSymbolStyleType.Normal; colorsTheme = new String[]{"#fe117c", "#ffc069", "#06caf4", "#7dffc0"};//默认的颜色数组(必须要添加默认数组,否则就会出错) gradientColorEnable = false; polar = false; xAxisLabelsEnabled = true; xAxisGridLineWidth = 0f; yAxisLabelsEnabled = true; yAxisGridLineWidth = 1f; legendEnabled = true; backgroundColor = "#FF333738"; borderRadius = 0f;//柱状图长条图头部圆角半径(可用于设置头部的形状,仅对条形图,柱状图有效,设置为1000时,柱形图或者条形图头部为楔形) markerRadius = 6f;//折线连接点的半径长度,如果值设置为0,这样就相当于不显示了 } } aa_chart_core/src/main/java/com/github/AAChartModel/AAChartCore/AAChartCreator/AAOptionsConstructor.java
@@ -27,6 +27,21 @@ * 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> * ------------------------------------------------------------------------------- */ /** app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -724,11 +724,15 @@ String s = HdlESLocalJsonLogic.getInstance().readHdlESLocalJson(url, deviceModel); //本地缓存数据 if (callback != null) { if (s.startsWith("{")) { uniSuccessCallback(type, new Gson().fromJson(s, JsonObject.class), callback); } else if (s.startsWith("[")) { uniSuccessCallback(type, new Gson().fromJson(s, JsonArray.class), callback); } else { try { if (s.startsWith("{")) { uniSuccessCallback(type, new Gson().fromJson(s, JsonObject.class), callback); } else if (s.startsWith("[")) { uniSuccessCallback(type, new Gson().fromJson(s, JsonArray.class), callback); } else { uniSuccessCallback(type, s, callback); } } catch (Exception e) { uniSuccessCallback(type, s, callback); } } @@ -744,11 +748,15 @@ } else { //本地缓存数据 if (callback != null) { if (json.startsWith("{")) { uniSuccessCallback(type, new Gson().fromJson(json, JsonObject.class), callback); } else if (json.startsWith("[")) { uniSuccessCallback(type, new Gson().fromJson(json, JsonArray.class), callback); } else { try { if (json.startsWith("{")) { uniSuccessCallback(type, new Gson().fromJson(json, JsonObject.class), callback); } else if (json.startsWith("[")) { uniSuccessCallback(type, new Gson().fromJson(json, JsonArray.class), callback); } else { uniSuccessCallback(type, json, callback); } } catch (Exception e) { uniSuccessCallback(type, json, callback); } } app/src/main/java/com/hdl/photovoltaic/ui/BPowerStationActivity.java
@@ -410,7 +410,7 @@ viewBinding.myPowerStationBottomIl0.titleTv.setTextColor(getColor(R.color.text_66FFFFFF)); viewBinding.myPowerStationBottomIl1.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.power_station_unselected)); viewBinding.myPowerStationBottomIl1.titleTv.setTextColor(getColor(R.color.text_66FFFFFF)); viewBinding.myMessageBottomIl2.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.message_select)); viewBinding.myMessageBottomIl2.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.message_selected)); viewBinding.myMessageBottomIl2.titleTv.setTextColor(getColor(R.color.text_E6FFFFFF)); viewBinding.myMeBottomIl3.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.me_unselected)); viewBinding.myMeBottomIl3.titleTv.setTextColor(getColor(R.color.text_66FFFFFF)); app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java
@@ -61,7 +61,7 @@ HouseIdBean houseIdBean = this.mList.get(position); holder.homeNameTv.setText(houseIdBean.getHomeName().trim()); //装机容量 String capacity = mContext.getString(R.string.string_capacity) + ":" + HdlCommonLogic.getConvertDoubleUnit(houseIdBean.getInstalledCapacity(), UnitType.kWp); String capacity = HdlCommonLogic.getConvertDoubleUnit(houseIdBean.getInstalledCapacity(), UnitType.kWp, false); holder.capacityTv.setText(capacity); //发电功率 holder.power_value_tv.setText(HdlCommonLogic.getConvertDoubleUnit(houseIdBean.getPower(), UnitType.kW)); @@ -160,7 +160,7 @@ private void setTextViewStyle(TextView textView, int state_value) { String text = mContext.getString(R.string.my_power_station_operation); Drawable drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_06b92a); Drawable drawable = AppCompatResources.getDrawable(mContext, R.drawable.device_state_ff38c494); if (mPowerStationStatus.equals(PowerStationStatus.All)) { switch (state_value) { case 1: { @@ -170,18 +170,18 @@ case 2: { text = mContext.getString(R.string.my_power_station_off_line); drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_b9b9b9); drawable = AppCompatResources.getDrawable(mContext, R.drawable.device_state_ffb9b9b9); } break; case 3: { text = mContext.getString(R.string.my_power_station_connecting); drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_ffb300); drawable = AppCompatResources.getDrawable(mContext, R.drawable.device_satte_ffb300); } break; case 4: case 5: { text = mContext.getString(R.string.my_power_station_malfunction); drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_e34343); drawable = AppCompatResources.getDrawable(mContext, R.drawable.device_state_fff55252); } //5:离线有故障Offline_fault break; @@ -193,13 +193,13 @@ } } else if (mPowerStationStatus.equals(PowerStationStatus.malfunction)) { text = mContext.getString(R.string.my_power_station_malfunction); drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_e34343); drawable = AppCompatResources.getDrawable(mContext, R.drawable.device_state_fff55252); } else if (mPowerStationStatus.equals(PowerStationStatus.off)) { text = mContext.getString(R.string.my_power_station_off_line); drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_b9b9b9); drawable = AppCompatResources.getDrawable(mContext, R.drawable.device_state_ffb9b9b9); } else if (mPowerStationStatus.equals(PowerStationStatus.connecting)) { text = mContext.getString(R.string.my_power_station_connecting); drawable = AppCompatResources.getDrawable(mContext, R.drawable.state_ffb300); drawable = AppCompatResources.getDrawable(mContext, R.drawable.device_satte_ffb300); } textView.setText(text); textView.setBackground(drawable); @@ -229,11 +229,11 @@ super(itemView); homeIconIv = itemView.findViewById(R.id.device_details_image_iv); homeNameTv = itemView.findViewById(R.id.device_details_name_tv); capacityTv = itemView.findViewById(R.id.device_details_sn_tv); capacityTv = itemView.findViewById(R.id.device_details_value_tv); power_value_tv = itemView.findViewById(R.id.power_value_tv); day_value_tv = itemView.findViewById(R.id.day_value_tv); month_value_tv = itemView.findViewById(R.id.month_value_tv); stateTv = itemView.findViewById(R.id.fragment_house_list_line_state_tv); stateTv = itemView.findViewById(R.id.device_state_tv); item_parent_rl = itemView.findViewById(R.id.item_parent_rl); move_home_ll = itemView.findViewById(R.id.move_ll); del_home_ll = itemView.findViewById(R.id.del_ll); app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java
@@ -432,7 +432,7 @@ // viewBinding.year.setText(R.string.year_power_generation); // viewBinding.Total.setText(R.string.cumulative_power_generation); // // viewBinding.unitTv.setText(UnitType.kW); viewBinding.unitTv.setText(UnitType.kW); viewBinding.dayTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.time_selected_38c494)); app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java
@@ -148,38 +148,50 @@ } }); //全部 viewBinding.powerStationAllIl.parentLl.setOnClickListener(new View.OnClickListener() { viewBinding.allLl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { powerStationStatusValue = PowerStationStatus.All; selectedStationStateStyle(viewBinding.powerStationAllIl.parentLl, viewBinding.powerStationAllIl.stationTotalTv, viewBinding.powerStationAllIl.stationTitleTv, true); viewBinding.allLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_yer_ffffff)); viewBinding.faultsLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.offlineLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.connectedLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); } }); //故障 viewBinding.powerStationFaultsIl.parentLl.setOnClickListener(new View.OnClickListener() { viewBinding.faultsLl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { powerStationStatusValue = PowerStationStatus.malfunction; selectedStationStateStyle(viewBinding.powerStationFaultsIl.parentLl, viewBinding.powerStationFaultsIl.stationTotalTv, viewBinding.powerStationFaultsIl.stationTitleTv, true); viewBinding.allLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.faultsLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_yer_ffffff)); viewBinding.offlineLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.connectedLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); } }); //离线 viewBinding.powerStationOfflineIl.parentLl.setOnClickListener(new View.OnClickListener() { viewBinding.offlineLl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { powerStationStatusValue = PowerStationStatus.off; selectedStationStateStyle(viewBinding.powerStationOfflineIl.parentLl, viewBinding.powerStationOfflineIl.stationTotalTv, viewBinding.powerStationOfflineIl.stationTitleTv, true); viewBinding.allLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.faultsLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.offlineLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_yer_ffffff)); viewBinding.connectedLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); } }); //待接入 viewBinding.powerStationConnectedIl.parentLl.setOnClickListener(new View.OnClickListener() { viewBinding.connectedLl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { powerStationStatusValue = PowerStationStatus.connecting; selectedStationStateStyle(viewBinding.powerStationConnectedIl.parentLl, viewBinding.powerStationConnectedIl.stationTotalTv, viewBinding.powerStationConnectedIl.stationTitleTv, true); viewBinding.allLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.faultsLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.offlineLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.connectedLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_yer_ffffff)); loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); } }); @@ -259,7 +271,7 @@ public void onClick(int position, HouseIdBean houseIdBean) { //点击住宅详情 HdlLogLogic.print("点击住宅详情---" + new Gson().toJson(houseIdBean), false); HdlResidenceLogic.getInstance().switchHouse(houseIdBean,true); HdlResidenceLogic.getInstance().switchHouse(houseIdBean, true); String path = HDLUniMP.UNI_EVENT_OPEN_HOME_DETAILS + "?homeId=" + houseIdBean.getHomeId() + "&homeName=" + houseIdBean.getHomeName() + "&powerStationStatus=" + houseIdBean.getPowerStationStatus(); HdlUniLogic.getInstance().openUniMP(path, null); @@ -496,13 +508,10 @@ private void initView() { viewBinding.powerStationLabelParent.setVisibility(View.VISIBLE); viewBinding.deviceLabelParent.setVisibility(View.GONE); viewBinding.powerStationAllIl.stationTitleTv.setText(getString(R.string.message_all)); viewBinding.powerStationFaultsIl.stationTitleTv.setText(getString(R.string.my_power_station_malfunction)); viewBinding.powerStationOfflineIl.stationTitleTv.setText(getString(R.string.my_power_station_off_line)); viewBinding.powerStationConnectedIl.stationTitleTv.setText(getString(R.string.to_be_added)); selectedStationStateStyle(viewBinding.powerStationAllIl.parentLl, viewBinding.powerStationAllIl.stationTotalTv, viewBinding.powerStationAllIl.stationTitleTv, true); viewBinding.allLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_yer_ffffff)); viewBinding.faultsLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.offlineLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.connectedLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); //电站标签 houseInfoAdapter = new HouseInfoAdapter(_mActivity); viewBinding.fragmentHouseSrlListRc.setLayoutManager(new LinearLayoutManager(_mActivity)); @@ -522,8 +531,8 @@ */ private void selectedTitleLabelStyle() { if (isClickPowerStationLabel) { viewBinding.powerStationLabel.setTextAppearance(R.style.Text20Style); viewBinding.deviceLabel.setTextAppearance(R.style.Text16Style); viewBinding.powerStationLabel.setTextAppearance(R.style.Text18Style); viewBinding.deviceLabel.setTextAppearance(R.style.Text14Style); // viewBinding.editIv.setVisibility(View.VISIBLE);//编辑图标隐藏 viewBinding.addIv.setVisibility(View.VISIBLE);//添加图标隐藏 viewBinding.powerStationLabelParent.setVisibility(View.VISIBLE);//电站标签【父容器】显示 @@ -532,8 +541,8 @@ viewBinding.deviceNullDataIc.getRoot().setVisibility(View.GONE); } } else { viewBinding.deviceLabel.setTextAppearance(R.style.Text20Style); viewBinding.powerStationLabel.setTextAppearance(R.style.Text16Style); viewBinding.deviceLabel.setTextAppearance(R.style.Text18Style); viewBinding.powerStationLabel.setTextAppearance(R.style.Text14Style); // viewBinding.editIv.setVisibility(View.GONE);//编辑图标隐藏 viewBinding.addIv.setVisibility(View.GONE);//添加图标隐藏 viewBinding.powerStationLabelParent.setVisibility(View.GONE);//电站标签【父容器】隐藏 @@ -545,40 +554,6 @@ } /** * 显示选中状态样式 * * @param linearLayout 组件 * @param numberTv 组件 * @param titleTv 组件 * @param isShowSelectedStatus 是否显示状态样式 */ private void selectedStationStateStyle(LinearLayout linearLayout, TextView numberTv, TextView titleTv, boolean isShowSelectedStatus) { viewBinding.powerStationAllIl.parentLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.powerStationFaultsIl.parentLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.powerStationOfflineIl.parentLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.powerStationConnectedIl.parentLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.powerStationAllIl.stationTotalTv.setTextColor(getResources().getColor(R.color.text_E6000000, null)); viewBinding.powerStationAllIl.stationTitleTv.setTextColor(getResources().getColor(R.color.text_66000000, null)); viewBinding.powerStationFaultsIl.stationTotalTv.setTextColor(getResources().getColor(R.color.text_E6000000, null)); viewBinding.powerStationFaultsIl.stationTitleTv.setTextColor(getResources().getColor(R.color.text_66000000, null)); viewBinding.powerStationOfflineIl.stationTotalTv.setTextColor(getResources().getColor(R.color.text_E6000000, null)); viewBinding.powerStationOfflineIl.stationTitleTv.setTextColor(getResources().getColor(R.color.text_66000000, null)); viewBinding.powerStationConnectedIl.stationTotalTv.setTextColor(getResources().getColor(R.color.text_E6000000, null)); viewBinding.powerStationConnectedIl.stationTitleTv.setTextColor(getResources().getColor(R.color.text_66000000, null)); if (isShowSelectedStatus) { linearLayout.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.selected_8_38c494)); numberTv.setTextColor(getResources().getColor(R.color.text_FFFFFFFF, null)); titleTv.setTextColor(getResources().getColor(R.color.text_FFFFFFFF, null)); } } private void initData() { if (isClickPowerStationLabel) { @@ -610,7 +585,7 @@ Gson gson = new Gson(); String json = eventBus.getData().toString(); HouseIdBean houseIdBean = gson.fromJson(json, HouseIdBean.class); HdlResidenceLogic.getInstance().switchHouse(houseIdBean,true); HdlResidenceLogic.getInstance().switchHouse(houseIdBean, true); } } else if (HDLUniMP.UNI_EVENT_REPLY_HOME_EDIT.equals(eventBus.getType())) { @@ -697,19 +672,19 @@ if (eventBus.getData().equals(PowerStationStatus.All)) { isClickPowerStationLabel = true; selectedTitleLabelStyle(); viewBinding.powerStationAllIl.parentLl.performClick(); viewBinding.allLl.performClick(); } else if (eventBus.getData().equals(PowerStationStatus.malfunction)) { isClickPowerStationLabel = true; selectedTitleLabelStyle(); viewBinding.powerStationFaultsIl.parentLl.performClick(); viewBinding.faultsLl.performClick(); } else if (eventBus.getData().equals(PowerStationStatus.off)) { isClickPowerStationLabel = true; selectedTitleLabelStyle(); viewBinding.powerStationOfflineIl.parentLl.performClick(); viewBinding.offlineLl.performClick(); } else if (eventBus.getData().equals(PowerStationStatus.connecting)) { isClickPowerStationLabel = true; selectedTitleLabelStyle(); viewBinding.powerStationConnectedIl.parentLl.performClick(); viewBinding.connectedLl.performClick(); } } else if (eventBus.getType().equals(ConstantManage.station_edit)) { //编辑后更新一下住宅列表 @@ -735,10 +710,10 @@ if (statusOverviewBean == null) { return; } viewBinding.powerStationAllIl.stationTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getTotal())); viewBinding.powerStationFaultsIl.stationTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getFault())); viewBinding.powerStationOfflineIl.stationTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getOffline())); viewBinding.powerStationConnectedIl.stationTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getConnecting())); viewBinding.allTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getTotal())); viewBinding.faultsTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getFault())); viewBinding.offlineTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getOffline())); viewBinding.connectedTotalTv.setText(HdlCommonLogic.convertString(statusOverviewBean.getConnecting())); } @Override app/src/main/res/drawable/default_condition.pngapp/src/main/res/drawable/device_satte_ffb300.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="3.5dp" /> <solid android:color="#FFB300" /> </shape> app/src/main/res/drawable/device_state_ff38c494.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="3.5dp"/> <solid android:color="#FF38C494"/> </shape> app/src/main/res/drawable/device_state_ffb9b9b9.xml
New file @@ -0,0 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="3.5dp" /> <solid android:color="#FFB9B9B9" /> </shape> app/src/main/res/drawable/device_state_fff55252.xml
New file @@ -0,0 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="3.5dp"/> <solid android:color="#FFF55252"/> </shape> app/src/main/res/drawable/message_select.pngBinary files differ
app/src/main/res/drawable/search_bj_ff05000000.xml
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="@dimen/dp_17" /> <solid android:color="#0D000000" /> <solid android:color="@color/text_FF333738" /> </shape> app/src/main/res/drawable/search_path.pngapp/src/main/res/drawable/social_contribution_1.pngapp/src/main/res/drawable/social_contribution_2.pngapp/src/main/res/drawable/social_contribution_3.pngapp/src/main/res/drawable/station_status_no_ffffff.xml
@@ -1,5 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="@dimen/dp_8" /> <solid android:color="#FFFFFF" /> <stroke android:width="@dimen/dp_1" android:color="@color/text_FF5C5F60" /> </shape> app/src/main/res/drawable/station_status_yer_ffffff.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="@dimen/dp_8" /> <solid android:color="@color/text_FF555859" /> </shape> app/src/main/res/layout/fragment_home_page.xml
@@ -525,6 +525,7 @@ android:layout_marginStart="@dimen/dp_16" android:layout_marginTop="@dimen/dp_10" android:layout_marginEnd="@dimen/dp_16" android:paddingBottom="@dimen/dp_16" android:background="@drawable/bj_ff333738" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -702,7 +703,7 @@ android:layout_height="match_parent" android:layout_alignParentStart="true" android:layout_marginStart="18.5dp" android:textColor="@color/text_66000000" android:textColor="@color/text_66FFFFFF" android:textSize="@dimen/text_12" /> <TextView app/src/main/res/layout/fragment_house_list.xml
@@ -23,23 +23,22 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_centerVertical="true" android:gravity="center_vertical" android:gravity="center" android:text="@string/power_station" android:textColor="@color/text_E6000000" android:textSize="@dimen/text_20" android:textStyle="bold" /> android:textColor="@color/text_E6FFFFFF" android:textSize="@dimen/text_18" /> <TextView android:id="@+id/device_label" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_centerVertical="true" android:layout_marginStart="17dp" android:layout_marginEnd="-339dp" android:layout_toEndOf="@+id/power_station_label" android:gravity="start|center_vertical" android:gravity="center" android:text="@string/device" android:textColor="@color/text_66000000" android:textSize="@dimen/text_16" android:textColor="@color/text_66FFFFFF" android:textSize="@dimen/text_14" /> @@ -84,7 +83,7 @@ <!--搜索--> <RelativeLayout android:id="@+id/power_station_search_cl" android:layout_width="match_parent" android:layout_width="0dp" android:layout_height="@dimen/dp_35" android:layout_marginStart="@dimen/dp_16" android:layout_marginEnd="@dimen/dp_16" @@ -118,7 +117,7 @@ android:layout_marginStart="@dimen/dp_11" android:layout_toEndOf="@+id/power_station_search_iv" android:text="@string/search_station" android:textColor="@color/text_66000000" android:textColor="@color/text_66FFFFFF" android:textSize="@dimen/text_14" /> </RelativeLayout> @@ -133,34 +132,160 @@ </RelativeLayout> <!--条件筛选--> <!--条件筛选 全部,故障,离线,待接入--> <LinearLayout android:id="@+id/screening_condition_ll" android:layout_width="match_parent" android:layout_width="0dp" android:layout_height="@dimen/dp_56" android:layout_marginStart="@dimen/dp_16" android:layout_marginTop="@dimen/dp_21" android:layout_marginTop="@dimen/dp_20" android:layout_marginEnd="@dimen/dp_16" android:orientation="horizontal" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/power_station_search_cl"> <!--全部--> <LinearLayout android:id="@+id/all_ll" android:layout_width="@dimen/dp_74" android:layout_height="match_parent" android:background="@drawable/station_status_no_ffffff" android:orientation="vertical"> <include android:id="@+id/power_station_all_il" layout="@layout/item_station" /> <TextView android:id="@+id/all_total_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8.5dp" android:gravity="center" android:paddingStart="@dimen/dp_2" android:paddingEnd="@dimen/dp_2" android:text="0" android:textColor="@color/text_E6FFFFFF" android:textSize="@dimen/text_16" /> <include android:id="@+id/power_station_faults_il" layout="@layout/item_station" /> <TextView android:id="@+id/all_des_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:paddingStart="@dimen/dp_2" android:paddingEnd="@dimen/dp_2" android:text="@string/message_all" android:textColor="@color/text_66FFFFFF" android:textSize="@dimen/text_12" /> </LinearLayout> <include android:id="@+id/power_station_offline_il" layout="@layout/item_station" /> <View android:id="@+id/v1" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" /> <!--故障--> <LinearLayout android:id="@+id/faults_ll" android:layout_width="@dimen/dp_74" android:layout_height="match_parent" android:background="@drawable/station_status_no_ffffff" android:orientation="vertical"> <include android:id="@+id/power_station_connected_il" layout="@layout/item_station" /> <TextView android:id="@+id/faults_total_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8.5dp" android:gravity="center" android:paddingStart="@dimen/dp_2" android:paddingEnd="@dimen/dp_2" android:text="0" android:textColor="@color/text_E6FFFFFF" android:textSize="@dimen/text_16" /> <TextView android:id="@+id/faults_des_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:paddingStart="@dimen/dp_2" android:paddingEnd="@dimen/dp_2" android:text="@string/my_power_station_malfunction" android:textColor="@color/text_66FFFFFF" android:textSize="@dimen/text_12" /> </LinearLayout> <View android:id="@+id/v2" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" /> <!--离线--> <LinearLayout android:id="@+id/offline_ll" android:layout_width="@dimen/dp_74" android:layout_height="match_parent" android:background="@drawable/station_status_no_ffffff" android:orientation="vertical"> <TextView android:id="@+id/offline_total_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8.5dp" android:gravity="center" android:paddingStart="@dimen/dp_2" android:paddingEnd="@dimen/dp_2" android:text="0" android:textColor="@color/text_E6FFFFFF" android:textSize="@dimen/text_16" /> <TextView android:id="@+id/offline_des_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:paddingStart="@dimen/dp_2" android:paddingEnd="@dimen/dp_2" android:text="@string/my_power_station_off_line" android:textColor="@color/text_66FFFFFF" android:textSize="@dimen/text_12" /> </LinearLayout> <View android:id="@+id/v3" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" /> <!--待接入--> <LinearLayout android:id="@+id/connected_ll" android:layout_width="@dimen/dp_74" android:layout_height="match_parent" android:background="@drawable/station_status_no_ffffff" android:orientation="vertical"> <TextView android:id="@+id/connected_total_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8.5dp" android:gravity="center" android:paddingStart="@dimen/dp_2" android:paddingEnd="@dimen/dp_2" android:text="0" android:textColor="@color/text_E6FFFFFF" android:textSize="@dimen/text_16" /> <TextView android:id="@+id/connected_des_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:paddingStart="@dimen/dp_2" android:paddingEnd="@dimen/dp_2" android:text="@string/to_be_added" android:textColor="@color/text_66FFFFFF" android:textSize="@dimen/text_12" /> </LinearLayout> </LinearLayout> @@ -168,10 +293,10 @@ <LinearLayout android:id="@+id/ascending_order_descending_order_parent_ll" android:layout_width="0dp" android:layout_height="@dimen/dp_17" android:layout_height="@dimen/dp_20" android:layout_marginStart="@dimen/dp_16" android:layout_marginTop="@dimen/dp_21" android:layout_marginEnd="@dimen/dp_12" android:layout_marginTop="@dimen/dp_19" android:layout_marginEnd="@dimen/dp_16" android:orientation="horizontal" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -187,10 +312,10 @@ <TextView android:id="@+id/station_name_tv" android:layout_width="wrap_content" android:layout_height="@dimen/dp_17" android:layout_height="match_parent" android:text="@string/station_name" android:textColor="@color/text_E6000000" android:textSize="@dimen/text_12" android:textColor="@color/text_E6FFFFFF" android:textSize="@dimen/text_14" /> @@ -198,6 +323,7 @@ android:id="@+id/station_name_iv" android:layout_width="@dimen/dp_18" android:layout_height="@dimen/dp_18" android:layout_centerVertical="true" android:layout_toEndOf="@+id/station_name_tv" android:background="@drawable/ascending_descending_order_select" /> @@ -219,10 +345,10 @@ <TextView android:id="@+id/station_power_tv" android:layout_width="wrap_content" android:layout_height="@dimen/dp_17" android:layout_height="match_parent" android:text="@string/generated_power" android:textColor="@color/text_E6000000" android:textSize="@dimen/text_12" /> android:textColor="@color/text_E6FFFFFF" android:textSize="@dimen/text_14" /> <ImageView android:id="@+id/station_power_iv" @@ -248,10 +374,10 @@ <TextView android:id="@+id/station_day_tv" android:layout_width="wrap_content" android:layout_height="@dimen/dp_17" android:layout_height="match_parent" android:text="@string/day_power_generation" android:textColor="@color/text_E6000000" android:textSize="@dimen/text_12" /> android:textColor="@color/text_E6FFFFFF" android:textSize="@dimen/text_14" /> <ImageView android:id="@+id/station_day_iv" @@ -278,10 +404,10 @@ <TextView android:id="@+id/station_month_tv" android:layout_width="wrap_content" android:layout_height="@dimen/dp_17" android:layout_height="match_parent" android:text="@string/month_power_generation" android:textColor="@color/text_E6000000" android:textSize="@dimen/text_12" /> android:textColor="@color/text_E6FFFFFF" android:textSize="@dimen/text_14" /> <ImageView android:id="@+id/station_month_iv" @@ -299,7 +425,7 @@ android:id="@+id/fragment_house_srl" android:layout_width="match_parent" android:layout_height="0dp" android:layout_marginTop="@dimen/dp_21" android:layout_marginTop="18.5dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app/src/main/res/layout/item_plant_details.xml
@@ -20,7 +20,7 @@ android:layout_height="@dimen/dp_148" android:layout_marginStart="@dimen/dp_16" android:layout_marginEnd="@dimen/dp_16" android:background="@drawable/ffffff_13"> android:background="@drawable/bj_ff333738"> <ImageView android:id="@+id/device_details_image_iv" @@ -32,45 +32,66 @@ android:scaleType="centerCrop" /> <TextView android:id="@+id/device_details_name_tv" android:layout_width="0dp" android:layout_height="@dimen/dp_19" android:id="@+id/device_state_tv" android:layout_width="7dp" android:layout_height="7dp" android:layout_marginStart="@dimen/dp_11" android:layout_marginTop="@dimen/dp_21" android:layout_toEndOf="@+id/device_details_image_iv" android:background="@drawable/device_state_ff38c494" /> <TextView android:id="@+id/device_details_name_tv" android:layout_width="match_parent" android:layout_height="@dimen/dp_20" android:layout_marginStart="@dimen/dp_6" android:layout_marginTop="@dimen/dp_15" android:layout_marginEnd="10dp" android:layout_toStartOf="@+id/fragment_house_list_line_state_tv" android:layout_toEndOf="@+id/device_details_image_iv" android:layout_toEndOf="@+id/device_state_tv" android:ellipsize="end" android:gravity="center_vertical|start" android:singleLine="true" android:text="@string/power_station" android:textColor="@color/text_E6000000" android:textSize="@dimen/text_16" android:textStyle="bold" /> android:textColor="@color/text_E6FFFFFF" android:textSize="@dimen/text_14" /> <TextView android:id="@+id/device_details_sn_tv" android:layout_width="wrap_content" android:layout_height="@dimen/dp_17" android:layout_height="wrap_content" android:layout_below="@+id/device_details_name_tv" android:layout_alignStart="@+id/device_details_name_tv" android:layout_alignStart="@+id/device_state_tv" android:layout_marginTop="@dimen/dp_3" android:gravity="center_vertical" android:text="@string/string_capacity" android:textColor="@color/text_66000000" android:textColor="@color/text_66FFFFFF" android:textSize="@dimen/text_12" /> <TextView android:id="@+id/fragment_house_list_line_state_tv" android:layout_width="69dp" android:layout_height="@dimen/dp_33" android:layout_alignParentTop="true" android:layout_alignParentEnd="true" android:background="@drawable/state_ffb300" android:gravity="center" android:text="@string/my_power_station_connecting" android:textColor="@color/text_FFFFFFFF" android:textSize="@dimen/text_12" /> android:id="@+id/device_details_value_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/device_details_name_tv" android:layout_marginStart="3dp" android:layout_toEndOf="@+id/device_details_sn_tv" android:layout_marginTop="1.5dp" android:text="0.00" android:textColor="@color/text_E6FFFFFF" android:textSize="@dimen/text_14" /> <TextView android:id="@+id/kwp_unit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/device_details_value_tv" android:layout_marginStart="4dp" android:layout_marginBottom="2dp" android:layout_toEndOf="@+id/device_details_value_tv" android:text="kWp" android:textColor="@color/text_66FFFFFF" android:textSize="@dimen/text_10" /> <LinearLayout android:id="@+id/screening_condition_ll" app/src/main/res/values-en/strings.xml
@@ -283,7 +283,7 @@ <string name="no_equipment">No equipment!</string> <string name="filtering">Select</string> <string name="reset">Reset</string> <string name="string_capacity">String capacity</string> <string name="string_capacity">String capacity:</string> <string name="grid_connected_state">Grid-connected state</string> <string name="grid_connected">Grid-tied</string> <string name="off_network">Off-grid</string> app/src/main/res/values-zh/strings.xml
@@ -281,7 +281,7 @@ <string name="no_equipment">暂无设备!</string> <string name="filtering">筛选</string> <string name="reset">重置</string> <string name="string_capacity">组串容量</string> <string name="string_capacity">组串容量:</string> <string name="grid_connected_state">并网状态</string> <string name="grid_connected">并网</string> <string name="off_network">离网</string> app/src/main/res/values/colors.xml
@@ -61,5 +61,6 @@ <color name="text_FF36FFBA">#FF36FFBA</color> <color name="text_33FFFFFF">#33FFFFFF</color> <color name="text_FF555859">#FF555859</color> <color name="text_FF5C5F60">#FF5C5F60</color> </resources> app/src/main/res/values/strings.xml
@@ -281,7 +281,7 @@ <string name="no_equipment">暂无设备!</string> <string name="filtering">筛选</string> <string name="reset">重置</string> <string name="string_capacity">组串容量</string> <string name="string_capacity">组串容量:</string> <string name="grid_connected_state">并网状态</string> <string name="grid_connected">并网</string> <string name="off_network">离网</string> app/src/main/res/values/styles.xml
@@ -14,6 +14,13 @@ <item name="android:textStyle">bold</item> <item name="android:textColor">@color/text_FFFFFFFF</item> <!-- <item name="android:fontFamily"></item>--> </style> <!-- 自定义字体样式 页面一级标题--> <style name="Text18Style"> <item name="android:textSize">@dimen/text_18</item> <item name="android:textColor">@color/text_E6FFFFFF</item> <!-- <item name="android:fontFamily"></item>--> </style> <!-- 自定义字体样式 内容一级标题--> @@ -26,8 +33,9 @@ <!-- 自定义字体样式 --> <style name="Text14Style"> <item name="android:textSize">@dimen/text_14</item> <item name="android:textColor">@color/text_66000000</item> <item name="android:textColor">@color/text_66FFFFFF</item> </style> <style name="Text12Style"> <item name="android:textSize">@dimen/text_12</item> <item name="android:textColor">@color/text_66FFFFFF</item>