From ce3b8953780d1cd77c8781befec6bf7dc22b42b1 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期二, 22 四月 2025 13:12:00 +0800 Subject: [PATCH] 2025年04月22日13:11:57 --- app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java | 41 +++++++++++++++++++++-------------------- 1 files changed, 21 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java b/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java index f1fe445..a78d845 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java @@ -8,6 +8,7 @@ import android.os.AsyncTask; import android.os.Bundle; import android.provider.Settings; +import android.util.Log; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; @@ -126,7 +127,7 @@ @Override public void onBindView(Bundle savedInstanceState) { - getStatusOverview(); +// getStatusOverview(); initData(); //鍒濆鍖� initView(); @@ -171,7 +172,7 @@ return; } powerStationStatusValue = PowerStationStatus.All; - stationStatusStyle(viewBinding.allLl,viewBinding.allDesTv); + stationStatusStyle(viewBinding.allLl, viewBinding.allDesTv); getStatusOverview(); loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } @@ -184,7 +185,7 @@ return; } powerStationStatusValue = PowerStationStatus.malfunction; - stationStatusStyle(viewBinding.faultsLl,viewBinding.faultsDesTv); + stationStatusStyle(viewBinding.faultsLl, viewBinding.faultsDesTv); getStatusOverview(); loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } @@ -197,7 +198,7 @@ return; } powerStationStatusValue = PowerStationStatus.off; - stationStatusStyle(viewBinding.offlineLl,viewBinding.offlineDesTv); + stationStatusStyle(viewBinding.offlineLl, viewBinding.offlineDesTv); getStatusOverview(); loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } @@ -210,7 +211,7 @@ return; } powerStationStatusValue = PowerStationStatus.connecting; - stationStatusStyle(viewBinding.connectedLl,viewBinding.connectedDesTv); + stationStatusStyle(viewBinding.connectedLl, viewBinding.connectedDesTv); getStatusOverview(); loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } @@ -507,7 +508,7 @@ viewBinding.powerStationLabelParent.setVisibility(View.VISIBLE); viewBinding.deviceLabelParent.setVisibility(View.GONE); - stationStatusStyle(viewBinding.allLl,viewBinding.allDesTv); + stationStatusStyle(viewBinding.allLl, viewBinding.allDesTv); //鐢电珯鏍囩 houseInfoAdapter = new HouseInfoAdapter(_mActivity); viewBinding.fragmentHouseSrlListRc.setLayoutManager(new LinearLayoutManager(_mActivity)); @@ -640,8 +641,8 @@ } String homeId = eventBus.getData().toString(); //杩涘幓浣忓畢璇︽儏uni璇诲彇閫嗗彉鍣ㄥ垪琛ㄦ垚鍔熷悗閫氱煡 - for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId).size(); i++) { - String gatewayId = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId).get(i).getGatewayId(); + for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId, null).size(); i++) { + String gatewayId = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId, null).get(i).getGatewayId(); //瀛楃涓叉槸鑷繁鎸夎鍒欐嫾鎺ョ殑,閲岄潰娉ㄥ唽涓婚鏃朵細瑙f瀽瀛楃涓�,鍙嬁getGatewayId()鍊�; String topic = "/user/" + gatewayId + "/#"; //杩涘幓浣忓畢璇︽儏寮�濮嬭闃呬富棰� @@ -667,27 +668,27 @@ isClickPowerStationLabel = true; selectedTitleLabelStyle(); initializationState(); + stationStatusStyle(viewBinding.allLl, viewBinding.allDesTv); getStatusOverview(); loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } else if (eventBus.getType().equals(ConstantManage.station_page)) { + // 鍙栨秷绮樻�т簨浠� + EventBus.getDefault().removeStickyEvent(eventBus); + isClickPowerStationLabel = true; + selectedTitleLabelStyle(); + powerStationStatusValue = eventBus.getData() == null ? "" : eventBus.getData().toString(); //閫氳繃棣栭〉鐢电珯杩涙潵鐨� if (eventBus.getData().equals(PowerStationStatus.All)) { - isClickPowerStationLabel = true; - selectedTitleLabelStyle(); - viewBinding.allLl.performClick(); + stationStatusStyle(viewBinding.allLl, viewBinding.allDesTv); } else if (eventBus.getData().equals(PowerStationStatus.malfunction)) { - isClickPowerStationLabel = true; - selectedTitleLabelStyle(); - viewBinding.faultsLl.performClick(); + stationStatusStyle(viewBinding.faultsLl, viewBinding.faultsDesTv); } else if (eventBus.getData().equals(PowerStationStatus.off)) { - isClickPowerStationLabel = true; - selectedTitleLabelStyle(); - viewBinding.offlineLl.performClick(); + stationStatusStyle(viewBinding.offlineLl, viewBinding.offlineDesTv); } else if (eventBus.getData().equals(PowerStationStatus.connecting)) { - isClickPowerStationLabel = true; - selectedTitleLabelStyle(); - viewBinding.connectedLl.performClick(); + stationStatusStyle(viewBinding.connectedLl, viewBinding.connectedDesTv); } + getStatusOverview(); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } else if (eventBus.getType().equals(ConstantManage.station_edit)) { //缂栬緫鍚庢洿鏂颁竴涓嬩綇瀹呭垪琛� //loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); -- Gitblit v1.8.0