| | |
| | | //已经解决掉的隐藏 |
| | | viewBinding.messageInfoBackTv.setVisibility(View.GONE); |
| | | viewBinding.messageInfoSolveTv.setVisibility(View.GONE); |
| | | } else { |
| | | if (mMessageBean.getType().equals(MessageAlarmStateType.fault)) { |
| | | return; |
| | | } |
| | | viewBinding.messageInfoBackTv.setVisibility(View.GONE); |
| | | viewBinding.messageInfoSolveTv.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | }); |
| | |
| | | private void initView() { |
| | | |
| | | viewBinding.toolbarTopIn.topTitleTv.setText(R.string.message_alarm_info); |
| | | viewBinding.toolbarTopIn.topTitleTv.setTextColor(getResources().getColor(R.color.text_030D1C, null)); |
| | | viewBinding.toolbarTopIn.topBackLl.setVisibility(View.VISIBLE); |
| | | viewBinding.toolbarTopIn.topBarView.setBackgroundColor(getResources().getColor(R.color.text_FFFFFFFF, null)); |
| | | |
| | | if (!UserConfigManage.getInstance().isBAccount()) { |
| | | viewBinding.messageInfoBackTv.setTextColor(getColor(R.color.text_38C494)); |
| | |
| | | stateStyle(viewBinding.messageInfoAlarmStateTv); |
| | | |
| | | |
| | | if (mMessageBean.getStatus().equals(MessageStateType.processed)) { |
| | | //已经解决掉的隐藏 |
| | | viewBinding.messageInfoBackTv.setVisibility(View.GONE); |
| | | viewBinding.messageInfoSolveTv.setVisibility(View.GONE); |
| | | if (mMessageBean.getStatus().equals(MessageStateType.untreated) && mMessageBean.getType().equals(MessageAlarmStateType.fault)) { |
| | | //发生中的消息且是故障才要显示 |
| | | viewBinding.messageInfoWorkOut.setVisibility(View.VISIBLE); |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | private void stateStyle(TextView textView) { |
| | | String type = "";//FAULT:故障,WARN:告警,EVENT:事件 |
| | | Drawable drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.alarm_ffb300); |
| | | Drawable drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.device_satte_ffb300); |
| | | if (mMessageBean.getType().equals(MessageAlarmStateType.fault)) { |
| | | type = _mActivity.getString(R.string.my_power_station_malfunction); |
| | | drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.alarm_e34343); |
| | | drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.device_state_fff55252); |
| | | } else if (mMessageBean.getType().equals(MessageAlarmStateType.warn)) { |
| | | type = _mActivity.getString(R.string.message_alarm); |
| | | drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.alarm_ffb300); |
| | | drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.device_satte_ffb300); |
| | | } else if (mMessageBean.getType().equals(MessageAlarmStateType.event)) { |
| | | type = _mActivity.getString(R.string.loading_title_tip); |
| | | drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.state_b9b9b9); |
| | | drawable = AppCompatResources.getDrawable(_mActivity, R.drawable.device_state_ffb9b9b9); |
| | | } |
| | | textView.setText(type); |
| | | textView.setBackground(drawable); |
| | | } |
| | | |
| | | @Override |
| | | public void onBackPressed() { |
| | | super.onBackPressed(); |
| | | if (mMessageBean == null) { |
| | | return; |
| | | } |
| | | //未处理 |
| | | if (mMessageBean.getStatus().equals(MessageStateType.untreated)) { |
| | | //改变缓存状态 |
| | | if (mMessageBean.getType().equals(MessageAlarmStateType.fault)) { |
| | | HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.untreated); |
| | | //通知未处理要更新数据 |
| | | HdlCommonLogic.getInstance().postEventBus(ConstantManage.message_function_push_post, MessageStateType.untreated); |
| | | } else { |
| | | //除“故障”外,其他等级信息“已读”后,自动移出“发生中”列表并加入“历史记录”列表 |
| | | HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.processed); |
| | | sendEventBus(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |