From 68db344081c103c94832b8d0a06be6c6888d66e4 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期三, 26 三月 2025 17:34:14 +0800 Subject: [PATCH] 2025年03月26日17:34:12 --- app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java | 70 ++++++++++++++++++++++++----------- 1 files changed, 48 insertions(+), 22 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 f4a5ad6..65ec710 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 @@ -31,6 +31,7 @@ import com.hdl.photovoltaic.config.UserConfigManage; import com.hdl.photovoltaic.databinding.FragmentHouseListBinding; import com.hdl.photovoltaic.base.CustomBaseFragment; +import com.hdl.photovoltaic.enums.DebugStatus; import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch; import com.hdl.photovoltaic.enums.LowerTagType; import com.hdl.photovoltaic.enums.PowerStationStatus; @@ -102,7 +103,7 @@ private String value = SortValue.all;//descending:闄嶅簭,ascending:鍗囧簭 private String installedCapacityMinValue = "";//鏈�灏忕粍涓插閲�(瑁呮満瀹归噺) private String installedCapacityMaxValue = "";//鏈�澶х粍涓插閲�(瑁呮満瀹归噺) - private String gridTypeValue = "";//骞剁綉鐘舵��(鍏ㄩ儴 涓嶄紶璇ヨ繃婊ゅ弬鏁�,FULL_GRID:骞剁綉,OFFLINE:绂荤綉) + private String screeningConditionStatus = DebugStatus.All;//绛涢�夋潯浠剁姸鎬� private String powerStationStatusValue = PowerStationStatus.All;//鐢电珯鐘舵��(鍏ㄩ儴 涓嶄紶璇ヨ繃婊ゅ弬鏁�,1:姝e父(杩愯),2:绂荤嚎,3:寰呮帴鍏�,4:鏁呴殰) private final long pageSize = 20;//椤垫暟 @@ -115,7 +116,7 @@ value = SortValue.all; installedCapacityMinValue = ""; installedCapacityMaxValue = ""; - gridTypeValue = ""; + screeningConditionStatus = DebugStatus.All; powerStationStatusValue = PowerStationStatus.All; } @@ -148,7 +149,7 @@ selectedTitleLabelStyle(); initializationState(); getStatusOverview(); - loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } }); @@ -173,7 +174,12 @@ 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.allDesTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF)); + viewBinding.faultsDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + viewBinding.offlineDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + viewBinding.connectedDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } }); //鏁呴殰 @@ -185,7 +191,12 @@ viewBinding.faultsLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_yes_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.allDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + viewBinding.faultsDesTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF)); + viewBinding.offlineDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + viewBinding.connectedDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } }); //绂荤嚎 @@ -197,7 +208,12 @@ viewBinding.faultsLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); viewBinding.offlineLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_yes_ffffff)); viewBinding.connectedLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff)); - loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + + viewBinding.allDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + viewBinding.faultsDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + viewBinding.offlineDesTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF)); + viewBinding.connectedDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } }); //寰呮帴鍏� @@ -209,7 +225,11 @@ 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_yes_ffffff)); - loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + viewBinding.allDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + viewBinding.faultsDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + viewBinding.offlineDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + viewBinding.connectedDesTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF)); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } }); @@ -243,14 +263,14 @@ public void onClick(View v) { DefaultFilteringDialog defaultFilteringDialog = new DefaultFilteringDialog(_mActivity); defaultFilteringDialog.show(); - defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue); + defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus); defaultFilteringDialog.setOnClickListener(new DefaultFilteringDialog.OnClickListener() { @Override public void confirm(String min, String max, String state) { installedCapacityMinValue = min;//鏈�灏忕粍涓插閲�(瑁呮満瀹归噺) installedCapacityMaxValue = max;//鏈�澶х粍涓插閲�(瑁呮満瀹归噺) - gridTypeValue = state;//骞剁綉鐘舵��(鍏ㄩ儴 涓嶄紶璇ヨ繃婊ゅ弬鏁�,FULL_GRID:骞剁綉,OFFLINE:绂荤綉) - loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + screeningConditionStatus = state;//璋冭瘯鐘舵��(鍏ㄩ儴;璋冭瘯涓�;璋冭瘯瀹屾垚;宸蹭氦浠�;鎺堟潈璋冭瘯) + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } }); } @@ -263,7 +283,7 @@ @Override public void onRefresh() { viewBinding.fragmentHouseSrl.setRefreshing(false); - loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); getStatusOverview(); } }); @@ -284,7 +304,7 @@ if (!isHouseLoadingMore) { // 婊戝姩鍒颁簡搴曢儴锛屾墽琛岀浉搴旂殑鎿嶄綔 HdlLogLogic.print("---婊戝姩鍒颁簡搴曢儴"); - loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, ++currentHouseListPage, false); + loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, ++currentHouseListPage, false); } } } @@ -401,7 +421,7 @@ screenIconState(viewBinding.stationNameRl, viewBinding.stationNameIv, isSelected); key = SortType.homeNameSort; value = isSelected ? SortValue.ascending : SortValue.descending; - loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } }); //鐢电珯鍙戠數鍔熺巼绛涢�� @@ -412,7 +432,7 @@ screenIconState(viewBinding.stationPowerRl, viewBinding.stationPowerIv, isSelected); key = SortType.powerSort; value = isSelected ? SortValue.ascending : SortValue.descending; - loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } }); //鐢电珯褰撴棩鍙戠數閲忕瓫閫� @@ -423,18 +443,18 @@ screenIconState(viewBinding.stationDayRl, viewBinding.stationDayIv, isSelected); key = SortType.todayElectricitySort; value = isSelected ? SortValue.ascending : SortValue.descending; - loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } }); - //鐢电珯褰撴湀鍙戠數閲忕瓫閫� + //鐢电珯鐢垫睜瀹归噺绛涢�� viewBinding.stationMonthRl.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { boolean isSelected = !v.isSelected(); screenIconState(viewBinding.stationMonthRl, viewBinding.stationMonthIv, isSelected); - key = SortType.monthElectricitySort; + key = SortType.batteryCapacitySort; value = isSelected ? SortValue.ascending : SortValue.descending; - loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } }); //璁惧鐐瑰嚮 @@ -552,6 +572,11 @@ 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)); + + viewBinding.allDesTv.setTextColor(getResources().getColor(R.color.text_E6FFFFFF)); + viewBinding.faultsDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + viewBinding.offlineDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); + viewBinding.connectedDesTv.setTextColor(getResources().getColor(R.color.text_66FFFFFF)); //鐢电珯鏍囩 houseInfoAdapter = new HouseInfoAdapter(_mActivity); viewBinding.fragmentHouseSrlListRc.setLayoutManager(new LinearLayoutManager(_mActivity)); @@ -620,7 +645,7 @@ // 鍙栨秷绮樻�т簨浠� EventBus.getDefault().removeStickyEvent(eventBus); //uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡 - loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); if (eventBus.getData() != null) { Gson gson = new Gson(); String json = eventBus.getData().toString(); @@ -664,7 +689,7 @@ // if (MqttRecvClient.getInstance() != null) { // MqttRecvClient.getInstance().removeAllTopic(); // } - loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST.equals(eventBus.getType())) { // 鍙栨秷绮樻�т簨浠� @@ -706,7 +731,7 @@ selectedTitleLabelStyle(); initializationState(); getStatusOverview(); - loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); + loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); } else if (eventBus.getType().equals(ConstantManage.station_page)) { //閫氳繃棣栭〉鐢电珯杩涙潵鐨� if (eventBus.getData().equals(PowerStationStatus.All)) { @@ -771,11 +796,12 @@ * @param key 鍙戠數鍔熺巼鎺掑簭(powerSort); * 浠婃棩鍙戠數閲忔帓搴�(todayElectricitySort); * 鍒涘缓鏃堕棿鎺掑簭(createTimeSort); + * 鐢垫睜瀹归噺鎺掑簭(batteryCapacitySort); * @param keyValue (descending:闄嶅簭 * ascending:鍗囧簭), * @param installedCapacityMin 鏈�灏忕粍涓插閲�(瑁呮満瀹归噺) * @param installedCapacityMax 鏈�澶х粍涓插閲�(瑁呮満瀹归噺) - * @param gridType 骞剁綉鐘舵�� (鍏ㄩ儴 锛�"";FULL_GRID 锛� 骞剁綉;OFFLINE 锛氱缃�) + * @param gridType 璋冭瘯鐘舵��(鍏ㄩ儴;璋冭瘯涓�;璋冭瘯瀹屾垚;宸蹭氦浠�;鎺堟潈璋冭瘯) * @param powerStationStatus 鐢电珯鐘舵�� (鍏ㄩ儴 锛�"";1 锛� 姝e父;2 锛� 绂荤嚎; 3 锛� 寰呮帴鍏�;4 锛� 鏁呴殰) * @param pageNo 椤电爜 * @param isClear 鏄惁娓呴櫎鏁版嵁 -- Gitblit v1.8.0