From 9d50ebeec9b481d3a32960165d64fb73f5b9adc8 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 02 四月 2025 18:30:21 +0800
Subject: [PATCH] 2025年04月02日18:24:17
---
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java | 119 +++++++++++++++++++++++++++++++++++------------------------
1 files changed, 70 insertions(+), 49 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 ec9501d..ac38b08 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
@@ -1,18 +1,13 @@
package com.hdl.photovoltaic.ui.powerstation;
import android.Manifest;
-import android.app.Dialog;
import android.content.Context;
-import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.LocationManager;
import android.os.Bundle;
-import android.os.SystemClock;
import android.provider.Settings;
-import android.util.Log;
import android.view.View;
-import android.view.Window;
import android.widget.ImageView;
import android.widget.RelativeLayout;
@@ -45,7 +40,6 @@
import com.hdl.photovoltaic.other.HdlDeviceLogic;
import com.hdl.photovoltaic.other.HdlDialogLogic;
import com.hdl.photovoltaic.other.HdlLogLogic;
-import com.hdl.photovoltaic.other.HdlOtaLogic;
import com.hdl.photovoltaic.other.HdlResidenceLogic;
import com.hdl.photovoltaic.other.HdlThreadLogic;
import com.hdl.photovoltaic.other.HdlUniLogic;
@@ -57,7 +51,6 @@
import com.hdl.photovoltaic.uni.HDLUniMP;
import com.hdl.photovoltaic.utils.GPSManagerUtils;
import com.hdl.photovoltaic.utils.PermissionUtils;
-import com.hdl.photovoltaic.utils.ProcessManagerUtils;
import com.hdl.photovoltaic.utils.URLEncodingUtils;
import com.hdl.photovoltaic.widget.ConfirmationCancelDialog;
import com.hdl.photovoltaic.widget.DefaultFilteringDialog;
@@ -103,7 +96,7 @@
private String value = SortValue.all;//descending:闄嶅簭,ascending:鍗囧簭
private String installedCapacityMinValue = "";//鏈�灏忕粍涓插閲�(瑁呮満瀹归噺)
private String installedCapacityMaxValue = "";//鏈�澶х粍涓插閲�(瑁呮満瀹归噺)
- private String debugStatus = DebugStatus.All;//绛涢�夋潯浠剁姸鎬�
+ private String screeningConditionStatus = DebugStatus.All;//绛涢�夋潯浠剁姸鎬�
private String powerStationStatusValue = PowerStationStatus.All;//鐢电珯鐘舵��(鍏ㄩ儴 涓嶄紶璇ヨ繃婊ゅ弬鏁�,1:姝e父(杩愯),2:绂荤嚎,3:寰呮帴鍏�,4:鏁呴殰)
private final long pageSize = 20;//椤垫暟
@@ -116,7 +109,7 @@
value = SortValue.all;
installedCapacityMinValue = "";
installedCapacityMaxValue = "";
- debugStatus = DebugStatus.All;
+ screeningConditionStatus = DebugStatus.All;
powerStationStatusValue = PowerStationStatus.All;
}
@@ -149,7 +142,7 @@
selectedTitleLabelStyle();
initializationState();
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
}
});
@@ -174,7 +167,13 @@
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, debugStatus, powerStationStatusValue, 1, true);
+
+ viewBinding.allDesTv.setTextColor(getResources().getColor(R.color.text_FFACACAC));
+ viewBinding.faultsDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ viewBinding.offlineDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ viewBinding.connectedDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ getStatusOverview();
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
}
});
//鏁呴殰
@@ -186,7 +185,13 @@
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, debugStatus, powerStationStatusValue, 1, true);
+
+ viewBinding.allDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ viewBinding.faultsDesTv.setTextColor(getResources().getColor(R.color.text_FFACACAC));
+ viewBinding.offlineDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ viewBinding.connectedDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ getStatusOverview();
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
}
});
//绂荤嚎
@@ -198,7 +203,13 @@
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, debugStatus, powerStationStatusValue, 1, true);
+
+ viewBinding.allDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ viewBinding.faultsDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ viewBinding.offlineDesTv.setTextColor(getResources().getColor(R.color.text_FFACACAC));
+ viewBinding.connectedDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ getStatusOverview();
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
}
});
//寰呮帴鍏�
@@ -210,7 +221,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_yes_ffffff));
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
+ viewBinding.allDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ viewBinding.faultsDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ viewBinding.offlineDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ viewBinding.connectedDesTv.setTextColor(getResources().getColor(R.color.text_FFACACAC));
+ getStatusOverview();
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
}
});
@@ -244,14 +260,15 @@
public void onClick(View v) {
DefaultFilteringDialog defaultFilteringDialog = new DefaultFilteringDialog(_mActivity);
defaultFilteringDialog.show();
- defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, debugStatus);
+ defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus);
defaultFilteringDialog.setOnClickListener(new DefaultFilteringDialog.OnClickListener() {
@Override
public void confirm(String min, String max, String state) {
installedCapacityMinValue = min;//鏈�灏忕粍涓插閲�(瑁呮満瀹归噺)
installedCapacityMaxValue = max;//鏈�澶х粍涓插閲�(瑁呮満瀹归噺)
- debugStatus = state;//璋冭瘯鐘舵��(鍏ㄩ儴;璋冭瘯涓�;璋冭瘯瀹屾垚;宸蹭氦浠�;鎺堟潈璋冭瘯)
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
+ screeningConditionStatus = state;//璋冭瘯鐘舵��(鍏ㄩ儴;璋冭瘯涓�;璋冭瘯瀹屾垚;宸蹭氦浠�;鎺堟潈璋冭瘯)
+ getStatusOverview();
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
}
});
}
@@ -264,7 +281,7 @@
@Override
public void onRefresh() {
viewBinding.fragmentHouseSrl.setRefreshing(false);
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
getStatusOverview();
}
});
@@ -285,7 +302,7 @@
if (!isHouseLoadingMore) {
// 婊戝姩鍒颁簡搴曢儴锛屾墽琛岀浉搴旂殑鎿嶄綔
HdlLogLogic.print("---婊戝姩鍒颁簡搴曢儴");
- loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, ++currentHouseListPage, false);
+ loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, ++currentHouseListPage, false);
}
}
}
@@ -387,44 +404,28 @@
}
});
- //鐢电珯缂栬緫鎸夐挳
- viewBinding.editIv.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- startActivity(HouseListEditActivity.class);
- }
- });
- //鐢电珯鍚嶇О绛涢��
+ //PV绛涢��
viewBinding.stationNameRl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean isSelected = !v.isSelected();
screenIconState(viewBinding.stationNameRl, viewBinding.stationNameIv, isSelected);
- key = SortType.homeNameSort;
+ key = SortType.installedCapacitySort;
value = isSelected ? SortValue.ascending : SortValue.descending;
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
+ getStatusOverview();
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
}
});
- //鐢电珯鍙戠數鍔熺巼绛涢��
+ //棰濆畾鍔熺巼绛涢��
viewBinding.stationPowerRl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean isSelected = !v.isSelected();
screenIconState(viewBinding.stationPowerRl, viewBinding.stationPowerIv, isSelected);
- key = SortType.powerSort;
+ key = SortType.invPowerSort;
value = isSelected ? SortValue.ascending : SortValue.descending;
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
- }
- });
- //鐢电珯褰撴棩鍙戠數閲忕瓫閫�
- viewBinding.stationDayRl.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- boolean isSelected = !v.isSelected();
- screenIconState(viewBinding.stationDayRl, viewBinding.stationDayIv, isSelected);
- key = SortType.todayElectricitySort;
- value = isSelected ? SortValue.ascending : SortValue.descending;
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
+ getStatusOverview();
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
}
});
//鐢电珯鐢垫睜瀹归噺绛涢��
@@ -435,7 +436,20 @@
screenIconState(viewBinding.stationMonthRl, viewBinding.stationMonthIv, isSelected);
key = SortType.batteryCapacitySort;
value = isSelected ? SortValue.ascending : SortValue.descending;
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
+ getStatusOverview();
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
+ }
+ });
+ //鐢电珯褰撴棩鍙戠數閲忕瓫閫�
+ viewBinding.stationDayRl.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ boolean isSelected = !v.isSelected();
+ screenIconState(viewBinding.stationDayRl, viewBinding.stationDayIv, isSelected);
+ key = SortType.todayElectricitySort;
+ value = isSelected ? SortValue.ascending : SortValue.descending;
+ getStatusOverview();
+ loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
}
});
//璁惧鐐瑰嚮
@@ -553,6 +567,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_FFACACAC));
+ viewBinding.faultsDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ viewBinding.offlineDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
+ viewBinding.connectedDesTv.setTextColor(getResources().getColor(R.color.text_FF5B5B5B));
//鐢电珯鏍囩
houseInfoAdapter = new HouseInfoAdapter(_mActivity);
viewBinding.fragmentHouseSrlListRc.setLayoutManager(new LinearLayoutManager(_mActivity));
@@ -621,7 +640,7 @@
// 鍙栨秷绮樻�т簨浠�
EventBus.getDefault().removeStickyEvent(eventBus);
//uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡
- loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, 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();
@@ -665,7 +684,8 @@
// if (MqttRecvClient.getInstance() != null) {
// MqttRecvClient.getInstance().removeAllTopic();
// }
- loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
+
+ loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
}
} else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST.equals(eventBus.getType())) {
// 鍙栨秷绮樻�т簨浠�
@@ -707,7 +727,7 @@
selectedTitleLabelStyle();
initializationState();
getStatusOverview();
- loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, 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)) {
@@ -745,7 +765,7 @@
* 鐢电珯鐘舵�佹瑙�
*/
private void getStatusOverview() {
- HdlResidenceLogic.getInstance().getStatusOverview(new CloudCallBeak<StatusOverviewBean>() {
+ HdlResidenceLogic.getInstance().getStatusOverview(screeningConditionStatus,installedCapacityMinValue,installedCapacityMaxValue,new CloudCallBeak<StatusOverviewBean>() {
@Override
public void onSuccess(StatusOverviewBean statusOverviewBean) {
if (statusOverviewBean == null) {
@@ -838,7 +858,7 @@
if (isRefreshing) {
hideLoading();
}
-
+ HdlThreadLogic.toast(_mActivity, e.getMsg() + "(" + e.getCode() + ")");
}
}, _mActivity, ShowErrorMode.YES);
}
@@ -907,6 +927,7 @@
if (isRefreshing) {
hideLoading();
}
+ HdlThreadLogic.toast(_mActivity, e.getMsg() + "(" + e.getCode() + ")");
}
}, _mActivity, ShowErrorMode.YES);
}
--
Gitblit v1.8.0