From f91ef956cf482ed4ce0885dc47794b783c20c415 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 30 四月 2025 10:14:43 +0800
Subject: [PATCH] Merge branch '1.2.0' into 1.5.1_google
---
app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java | 124 +++++++++++++----------------------------
1 files changed, 40 insertions(+), 84 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java b/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java
index 118d590..1a98fbd 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java
@@ -14,12 +14,13 @@
import androidx.appcompat.content.res.AppCompatResources;
import androidx.recyclerview.widget.RecyclerView;
+import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.hdl.photovoltaic.R;
-import com.hdl.photovoltaic.enums.DebugStatus;
-import com.hdl.photovoltaic.enums.DeliverStatus;
import com.hdl.photovoltaic.enums.PowerStationStatus;
import com.hdl.photovoltaic.enums.UnitType;
import com.hdl.photovoltaic.other.HdlCommonLogic;
+import com.hdl.photovoltaic.other.HdlDeviceLogic;
+import com.hdl.photovoltaic.other.HdlLogLogic;
import com.hdl.photovoltaic.ui.bean.HouseIdBean;
import com.hdl.photovoltaic.utils.GlideUtils;
import com.hdl.photovoltaic.widget.SwipeLayout;
@@ -59,6 +60,9 @@
HouseIdBean houseIdBean = this.mList.get(position);
holder.homeNameTv.setText(houseIdBean.getHomeName().trim());
+ //瑁呮満瀹归噺
+ holder.capacityTv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getInstalledCapacity(), UnitType.kWp));
+ holder.capacity_kwp_unit.setText(HdlCommonLogic.convertKWPUnit(houseIdBean.getInstalledCapacity()));
//缁勪覆瀹归噺(鍒涘缓鐢电珯鏃惰緭鍏ョ殑缁勪覆瀹归噺)
holder.pv_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getInstalledCapacity(), UnitType.kWp));
@@ -73,10 +77,9 @@
holder.battery_storage_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getBatteryCapacity(), UnitType.kWh));
holder.battery_storage_kw_unit.setText(HdlCommonLogic.convertKWHUnit(houseIdBean.getBatteryCapacity()));
- holder.home_location_tv.setText(houseIdBean.getHomeAddress());
+ holder.plant_details_location_tv.setText(houseIdBean.getHomeAddress());
holder.item_parent_rl.setTag(position);
- setHomeStateTextViewStyle(holder.home_state_tv, houseIdBean.getPowerStationStatus());
- setHomeDebugStateTextViewStyle(holder.home_debug_state_tv, holder.home_debug_state_iv, houseIdBean.getDebugStatus());
+ setTextViewStyle(holder.stateTv, houseIdBean.getPowerStationStatus());
GlideUtils.getRoundedCornersImage(mContext, houseIdBean.getPowerStationImage(), holder.homeIconIv, 6);
// HdlLogLogic.print("---鐢电珯鍚嶇О:" + houseIdBean.getHomeName() + "---鍥剧墖url:" + houseIdBean.getPowerStationImage(), false);
holder.item_parent_rl.setOnClickListener(new View.OnClickListener() {
@@ -91,7 +94,7 @@
}
});
//绉诲姩鐢电珯浣嶇疆
- holder.home_move_ll.setOnClickListener(new View.OnClickListener() {
+ holder.move_home_ll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
@@ -106,11 +109,10 @@
if (houseIdBean.getDebugStatus().equals(DebugStatus.Debugging)) {
//鏈氦浠樺畬瑕佹樉绀哄垹闄ゆ寜閽�
- holder.home_del_ll.setVisibility(View.VISIBLE);
+ holder.del_home_ll.setVisibility(View.VISIBLE);
}
-
//鍒犻櫎鐢电珯
- holder.home_del_ll.setOnClickListener(new View.OnClickListener() {
+ holder.del_home_ll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
@@ -155,47 +157,7 @@
}
/**
- * 璁剧疆銆愮數绔欒皟璇曠姸鎬併�戠粍浠舵牱寮�
- *
- * @param textView 鏄剧ず浣忓畢鐘舵�佹枃鏈粍浠�
- * @param imageView 鏄剧ず浣忓畢鐘舵�佸浘鏍囩粍浠�
- * @param stateValue 鐢电珯鐘舵��(1:姝e父(杩愯),2:绂荤嚎,3:杩炴帴涓�,4:鏁呴殰,5:绂荤嚎鏈夋晠闅�)
- */
- private void setHomeDebugStateTextViewStyle(TextView textView, ImageView imageView, String stateValue) {
-
- String text = mContext.getString(R.string.be_debugging);
- Drawable drawable = AppCompatResources.getDrawable(mContext, R.drawable.debugging);
- switch (stateValue) {
- case DebugStatus.Debugging: {
- text = mContext.getString(R.string.be_debugging);
- drawable = AppCompatResources.getDrawable(mContext, R.drawable.debugging);
- }
- break;
-
- case DebugStatus.WAIT_DELIVERED: {
- text = mContext.getString(R.string.debugging_completed);
- drawable = AppCompatResources.getDrawable(mContext, R.drawable.done);
- }
- break;
- case DebugStatus.Delivered: {
- text = mContext.getString(R.string.delivered);
- drawable = AppCompatResources.getDrawable(mContext, R.drawable.delivered);
- }
- break;
- case DebugStatus.SECONDARY_DEBUGGIN: {
- text = mContext.getString(R.string.authorization_debugging);
- drawable = AppCompatResources.getDrawable(mContext, R.drawable.authorization_debugging);
- }
- break;
- }
- textView.setText(text);
- imageView.setBackground(drawable);
-
-
- }
-
- /**
- * 璁剧疆銆愮數绔欑姸鎬併�戠粍浠舵牱寮�
+ * 鏀瑰彉缁勪欢鏍峰紡
*
* @param textView 鏄剧ず缁勪欢
* 濡傛灉璁惧浠庢潵娌′笂鎶ヨ繃鏁版嵁鏁版嵁 鐘舵�侊細杩炴帴涓�
@@ -204,7 +166,7 @@
* 璁惧绂荤嚎 鐘舵�侊細绂荤嚎
* @param state_value 鐢电珯鐘舵��(1:姝e父(杩愯),2:绂荤嚎,3:杩炴帴涓�,4:鏁呴殰,5:绂荤嚎鏈夋晠闅�,6:閮ㄥ垎绂荤嚎)
*/
- private void setHomeStateTextViewStyle(TextView textView, int state_value) {
+ 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.device_state_ff38c494);
@@ -262,44 +224,38 @@
public ImageView homeIconIv;//浣忓畢鍥剧墖
public TextView homeNameTv;//浣忓畢鍚嶇О
-
- public ImageView home_debug_state_iv;//浣忓畢璋冭瘯鐘舵�佸浘鏍�
- public TextView home_debug_state_tv;//浣忓畢璋冭瘯鐘舵��
-
- public TextView pv_value_tv;//缁勪覆瀹归噺
- public TextView pv_kw_unit;//鍙戠數鍔熺巼鍗曚綅
- public TextView generation_today_value_tv;//褰撴棩鍙戠數
- public TextView generation_today_kw_unit;//褰撴棩鍙戠數鍗曚綅
- public TextView output_value_tv;//棰濆畾鍔熺巼
- public TextView output_kw_unit;//棰濆畾鍔熺巼鍗曚綅
- public TextView battery_storage_value_tv;//鐢垫睜鑳介噺
- public TextView battery_storage_kw_unit;//鐢垫睜鑳介噺鍗曚綅
- public TextView home_state_tv;//鐢电珯鐘舵��(杩炴帴涓�,杩愯,绂荤嚎,鏁呴殰);
+ public TextView capacityTv;//瑁呮満瀹归噺
+ public TextView capacity_kwp_unit;//瑁呮満瀹归噺鍗曚綅
+ public TextView power_value_tv;//鍙戠數鍔熺巼
+ public TextView power_kw_unit;//鍙戠數鍔熺巼鍗曚綅
+ public TextView day_value_tv;//褰撴棩鍙戠數閲�
+ public TextView day_kwh_unit;//褰撴棩鍙戠數閲忓崟浣�
+ public TextView month_value_tv;//褰撴湀鍙戠數閲�
+ public TextView month_kwh_unit;//褰撴湀鍙戠數閲忓崟浣�
+ public TextView stateTv;//鐢电珯鐘舵��(杩炴帴涓�,杩愯,绂荤嚎,鏁呴殰);
public RelativeLayout item_parent_rl;//鏉$洰鐖跺鍣�
- public LinearLayout home_move_ll;//绉诲姩鐢电珯浣嶇疆
- public LinearLayout home_del_ll;//鍒犻櫎鐢电珯
- public TextView home_location_tv;//鐢电珯鍦板潃
+ public LinearLayout move_home_ll;//绉诲姩鐢电珯浣嶇疆
+ public LinearLayout del_home_ll;//鍒犻櫎鐢电珯
+ public TextView plant_details_location_tv;//鐢电珯鍦板潃
public SwipeLayout item_parent_swipeLayout;//鐖跺鍣�
public MyViewHolder(@NonNull View itemView) {
super(itemView);
- homeIconIv = itemView.findViewById(R.id.home_image_iv);
- homeNameTv = itemView.findViewById(R.id.home_name_tv);
- home_debug_state_iv = itemView.findViewById(R.id.home_debug_state_iv);
- home_debug_state_tv = itemView.findViewById(R.id.home_debug_state_tv);
- pv_value_tv = itemView.findViewById(R.id.pv_value_tv);
- pv_kw_unit = itemView.findViewById(R.id.pv_kw_unit);
- generation_today_value_tv = itemView.findViewById(R.id.generation_today_value_tv);
- generation_today_kw_unit = itemView.findViewById(R.id.generation_today_kw_unit);
- output_value_tv = itemView.findViewById(R.id.output_value_tv);
- output_kw_unit = itemView.findViewById(R.id.output_kw_unit);
- battery_storage_value_tv = itemView.findViewById(R.id.battery_storage_value_tv);
- battery_storage_kw_unit = itemView.findViewById(R.id.battery_storage_kw_unit);
- home_state_tv = itemView.findViewById(R.id.home_state_tv);
+ 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_value_tv);
+ capacity_kwp_unit = itemView.findViewById(R.id.capacity_kwp_unit);
+ power_value_tv = itemView.findViewById(R.id.power_value_tv);
+ power_kw_unit = itemView.findViewById(R.id.power_kw_unit);
+ day_value_tv = itemView.findViewById(R.id.day_value_tv);
+ day_kwh_unit = itemView.findViewById(R.id.day_kwh_unit);
+ month_value_tv = itemView.findViewById(R.id.month_value_tv);
+ month_kwh_unit = itemView.findViewById(R.id.month_kwh_unit);
+ stateTv = itemView.findViewById(R.id.device_state_tv);
item_parent_rl = itemView.findViewById(R.id.item_parent_rl);
- home_move_ll = itemView.findViewById(R.id.move_ll);
- home_del_ll = itemView.findViewById(R.id.del_ll);
- home_location_tv = itemView.findViewById(R.id.home_location_tv);
+ move_home_ll = itemView.findViewById(R.id.move_ll);
+ del_home_ll = itemView.findViewById(R.id.del_ll);
+ plant_details_location_tv = itemView.findViewById(R.id.plant_details_location_tv);
item_parent_swipeLayout = itemView.findViewById(R.id.item_parent_swipeLayout);
}
}
@@ -313,4 +269,4 @@
}
-}
+}
\ No newline at end of file
--
Gitblit v1.8.0