| | |
| | | |
| | | import android.content.DialogInterface; |
| | | import android.content.Intent; |
| | | import android.graphics.Typeface; |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | import android.widget.TextView; |
| | |
| | | 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 :事件(提示)); |
| | |
| | | // * timeType(TODAY :今天;LAST_3_DAYS: 近3天;LAST_7_DAYS :近7天;LAST_30_DAYS :近30天); |
| | | private boolean isLoadingMore = false; // 标记正在加载更多数据 |
| | | LinearLayoutManager mLayoutManager; |
| | | |
| | | |
| | | @Override |
| | | public Object getContentView() { |
| | |
| | | //初始化界面监听器 |
| | | 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 |
| | |
| | | if (isAlarmDeviceClick) { |
| | | return;//防止多次点击 |
| | | } |
| | | mDeviceTypeFilterKye = FilterType.all; |
| | | mDeviceTypeFilterValue = FilterType.all; |
| | | mTypeFilterKye = FilterType.all; |
| | | mTypeFilterValue = FilterType.all; |
| | | mTimeTypeFilterKye = FilterType.all; |
| | | mTimeTypeFilterValue = FilterType.all; |
| | | viewBinding.allDeviceTitleTv.setText(getString(R.string.alarm_all_device)); |
| | | viewBinding.allGradeTitleTv.setText(getString(R.string.alarm_all_grade)); |
| | | viewBinding.allTimeTitleTv.setText(getString(R.string.alarm_all_time)); |
| | | isAlarmDeviceClick = true; |
| | | refreshBottomStyle(true); |
| | | loadNextPageMessageList(1, true, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue); |
| | |
| | | if (!isAlarmDeviceClick) { |
| | | return;//防止多次点击 |
| | | } |
| | | mDeviceTypeFilterKye = FilterType.all; |
| | | mDeviceTypeFilterValue = FilterType.all; |
| | | mTypeFilterKye = FilterType.all; |
| | | mTypeFilterValue = FilterType.all; |
| | | mTimeTypeFilterKye = FilterType.all; |
| | | mTimeTypeFilterValue = FilterType.all; |
| | | viewBinding.allDeviceTitleTv.setText(getString(R.string.alarm_all_device)); |
| | | viewBinding.allGradeTitleTv.setText(getString(R.string.alarm_all_grade)); |
| | | viewBinding.allTimeTitleTv.setText(getString(R.string.alarm_all_time)); |
| | | isAlarmDeviceClick = false; |
| | | refreshBottomStyle(false); |
| | | loadNextPageMessageList(1, true, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue); |
| | |
| | | } |
| | | |
| | | 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); |
| | |
| | | viewBinding.messageContentRl.setLayoutManager(mLayoutManager); |
| | | viewBinding.messageContentRl.setAdapter(messageCenterListAdapter); |
| | | messageCenterListAdapter.setList(mList); |
| | | this.nullDataUpdateUi(); |
| | | // this.nullDataUpdateUi(); |
| | | } |
| | | |
| | | 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) { |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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"); |
| | |
| | | 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: { |