mac
2024-10-14 82f93261d857fdc857dfe48dad33a8a1df356f24
app/src/main/java/com/hdl/photovoltaic/ui/newC/MessageCenterList.java
@@ -3,6 +3,7 @@
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
@@ -61,7 +62,7 @@
    private int mTotalCount1 = 0;//消息数量总数
    private int mTotalCount2 = 0;//消息数量总数
    private String mDeviceTypeFilterKye = FilterType.deviceType;//过滤类型 deviceType(INV :逆变器;BMS :BMS控制盒;BATTERY :电池单元)
    private String mDeviceTypeFilterKye = FilterType.all;//过滤类型 deviceType(INV :逆变器;BMS :BMS控制盒;BATTERY :电池单元)
    private String mDeviceTypeFilterValue = FilterType.all;//过滤类型值 deviceType(INV :逆变器;BMS :BMS控制盒;BATTERY :电池单元)
    private String mTypeFilterKye = FilterType.all;//过滤类型 type(FAULT :故障; WARN :告警; EVENT :事件(提示));
@@ -76,6 +77,7 @@
    //     *                                timeType(TODAY :今天;LAST_3_DAYS: 近3天;LAST_7_DAYS :近7天;LAST_30_DAYS :近30天);
    private boolean isLoadingMore = false; // 标记正在加载更多数据
    LinearLayoutManager mLayoutManager;
    @Override
    public Object getContentView() {
@@ -94,7 +96,7 @@
        //初始化界面监听器
        initEvent();
        //进来读取一次数据(为了更新currentPage,currentTotal这个值)
        loadNextPageMessageList(1, true, FilterType.all, FilterType.all, FilterType.all, FilterType.all, FilterType.all, FilterType.all);
        loadNextPageMessageList(1, true, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue);
    }
    @Override
@@ -241,7 +243,7 @@
                if (isAlarmDeviceClick) {
                    return;//防止多次点击
                }
                mDeviceTypeFilterKye = FilterType.deviceType;
                mDeviceTypeFilterKye = FilterType.all;
                mDeviceTypeFilterValue = FilterType.all;
                mTypeFilterKye = FilterType.all;
                mTypeFilterValue = FilterType.all;
@@ -262,7 +264,7 @@
                if (!isAlarmDeviceClick) {
                    return;//防止多次点击
                }
                mDeviceTypeFilterKye = FilterType.deviceType;
                mDeviceTypeFilterKye = FilterType.all;
                mDeviceTypeFilterValue = FilterType.all;
                mTypeFilterKye = FilterType.all;
                mTypeFilterValue = FilterType.all;
@@ -324,7 +326,7 @@
    }
    private void initView() {
        viewBinding.toolbarTopMessageCenterListRl.getRoot().setBackgroundColor(getColor(R.color.text_FFFFFFFF));
        viewBinding.toolbarTopMessageCenterListRl.getRoot().setBackgroundColor(getColor(R.color.text_FFECECEC));
        viewBinding.toolbarTopMessageCenterListRl.topBackLl.setVisibility(View.VISIBLE);
        viewBinding.toolbarTopMessageCenterListRl.topLeftIv.setImageResource(R.drawable.back_c);
        viewBinding.toolbarTopMessageCenterListRl.topTitleTv.setText(R.string.set_message_center);
@@ -344,6 +346,23 @@
    }
    private void initData() {
        try {
            Intent intent = getIntent();
            if (intent != null) {
                String isShowFault = intent.getStringExtra("isShowFault");
                if (isShowFault != null && isShowFault.equals("true")) {
                    //默认故障全部
                    mDeviceTypeFilterKye = FilterType.all;
                    mDeviceTypeFilterValue = FilterType.all;
                    mTypeFilterKye = FilterType.type;
                    mTypeFilterValue = "FAULT";
                    mTimeTypeFilterKye = FilterType.all;
                    mTimeTypeFilterValue = FilterType.all;
                    viewBinding.allGradeTitleTv.setText(getString(R.string.alarm_all_grade_malfunction));
                }
            }
        } catch (Exception ignored) {
        }
    }
    /**
@@ -483,13 +502,15 @@
                    viewBinding.messageBottomAlarmDeviceLineV.setVisibility(View.VISIBLE);
                    viewBinding.messageBottomAlarmRecordTitleTv.setTextColor(getColor(R.color.text_B2B2B2));
                    viewBinding.messageBottomAlarmRecordLineV.setVisibility(View.GONE);
                    viewBinding.messageBottomAlarmDeviceTitleTv.setTypeface(null, Typeface.BOLD);
                    viewBinding.messageBottomAlarmRecordTitleTv.setTypeface(null, Typeface.NORMAL);
                } else {
                    viewBinding.messageBottomAlarmDeviceTitleTv.setTextColor(getColor(R.color.text_B2B2B2));
                    viewBinding.messageBottomAlarmDeviceLineV.setVisibility(View.GONE);
                    viewBinding.messageBottomAlarmRecordTitleTv.setTextColor(getColor(R.color.text_191919));
                    viewBinding.messageBottomAlarmRecordLineV.setVisibility(View.VISIBLE);
                    viewBinding.messageBottomAlarmDeviceTitleTv.setTypeface(null, Typeface.NORMAL);
                    viewBinding.messageBottomAlarmRecordTitleTv.setTypeface(null, Typeface.BOLD);
                }
            }
@@ -570,6 +591,7 @@
        map.put(getString(R.string.alarm_all_device_inverter), "INV");
        map.put(getString(R.string.alarm_all_device_bms), "BMS");
        map.put(getString(R.string.alarm_all_device_battery_cell), "BATTERY");
        map.put(getString(R.string.alarm_all_device_load_centre), "LOAD_CENTRE");
        map.put(getString(R.string.alarm_all_grade), "");//设等级全部
        map.put(getString(R.string.alarm_all_grade_malfunction), "FAULT");
        map.put(getString(R.string.alarm_all_grade_warning), "WARN");
@@ -602,6 +624,7 @@
                stringList.add(getString(R.string.alarm_all_device_inverter));
                stringList.add(getString(R.string.alarm_all_device_bms));
                stringList.add(getString(R.string.alarm_all_device_battery_cell));
                stringList.add(getString(R.string.alarm_all_device_load_centre));
            }
            break;
            case FilterType.type: {