From a0e8f81afc4fe2a21a5c504d53e569ea50d463d6 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期五, 15 三月 2024 11:51:23 +0800 Subject: [PATCH] 2024年03月15日11:51:17 --- app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java | 47 +++++++++++++++++++++++++++++++++++++---------- 1 files changed, 37 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java index c9d4164..80d727b 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/message/MessageInfoActivity.java @@ -1,6 +1,7 @@ package com.hdl.photovoltaic.ui.message; +import android.annotation.SuppressLint; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.View; @@ -11,6 +12,7 @@ import com.hdl.photovoltaic.R; import com.hdl.photovoltaic.base.CustomBaseActivity; import com.hdl.photovoltaic.config.ConstantManage; +import com.hdl.photovoltaic.config.UserConfigManage; import com.hdl.photovoltaic.databinding.ActivityMessageInfoBinding; import com.hdl.photovoltaic.enums.MessageAlarmStateType; import com.hdl.photovoltaic.enums.MessageStateType; @@ -113,42 +115,60 @@ } private void initEvent() { + //鍚庨��鐨勪簨浠� viewBinding.toolbarTopIn.topBackBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mMessageBean == null) { + finish(); return; } - //鎭㈠杩涙潵鍙槸鏌ョ湅鐨� + //鏈鐞� if (mMessageBean.getStatus().equals(MessageStateType.untreated)) { - HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.untreated); BaseEventBus baseEventBus = new BaseEventBus(); baseEventBus.setTopic(ConstantManage.message_function_push_post); - baseEventBus.setType(MessageStateType.untreated); + //鏀瑰彉缂撳瓨鐘舵�� + if (mMessageBean.getType().equals(MessageAlarmStateType.fault)) { + HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.untreated); + baseEventBus.setType(MessageStateType.untreated); + } else { + //闄も�滄晠闅溾�濆锛屽叾浠栫瓑绾т俊鎭�滃凡璇烩�濆悗锛岃嚜鍔ㄧЩ鍑衡�滃彂鐢熶腑鈥濆垪琛ㄥ苟鍔犲叆鈥滃巻鍙茶褰曗�濆垪琛� + HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.processed); + baseEventBus.setType(MessageStateType.processed); + } EventBus.getDefault().post(baseEventBus); } finish(); } }); - + //杩斿洖鐨勪簨浠� viewBinding.messageInfoBackTv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mMessageBean == null) { + finish(); return; } - //鎭㈠杩涙潵鍙槸鏌ョ湅鐨� + //鏈鐞� if (mMessageBean.getStatus().equals(MessageStateType.untreated)) { - HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.untreated); BaseEventBus baseEventBus = new BaseEventBus(); baseEventBus.setTopic(ConstantManage.message_function_push_post); - baseEventBus.setType(MessageStateType.untreated); + //鏀瑰彉缂撳瓨鐘舵�� + if (mMessageBean.getType().equals(MessageAlarmStateType.fault)) { + HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.untreated); + baseEventBus.setType(MessageStateType.untreated); + } else { + //闄も�滄晠闅溾�濆锛屽叾浠栫瓑绾т俊鎭�滃凡璇烩�濆悗锛岃嚜鍔ㄧЩ鍑衡�滃彂鐢熶腑鈥濆垪琛ㄥ苟鍔犲叆鈥滃巻鍙茶褰曗�濆垪琛� + HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.processed); + baseEventBus.setType(MessageStateType.processed); + } EventBus.getDefault().post(baseEventBus); } finish(); } }); + //宸插鐞嗙殑浜嬩欢 viewBinding.messageInfoSolveTv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -158,16 +178,16 @@ if (mMessageBean == null) { return; } - //鎭㈠杩涙潵鍙槸鏌ョ湅鐨� + //鏈鐞� if (mMessageBean.getStatus().equals(MessageStateType.untreated)) { HdlMessageLogic.getInstance().setMessageState(mMessageBean.getMsgId(), true, MessageStateType.processed); - //宸插鐞嗚鏇存柊鏁版嵁 + //閫氱煡宸插鐞嗚鏇存柊鏁版嵁 BaseEventBus processedBus = new BaseEventBus(); processedBus.setTopic(ConstantManage.message_function_push_post); processedBus.setType(MessageStateType.processed); EventBus.getDefault().post(processedBus); - //鏈鐞嗚鏇存柊鏁版嵁 + //閫氱煡鏈鐞嗚鏇存柊鏁版嵁 BaseEventBus untreatedBus = new BaseEventBus(); untreatedBus.setTopic(ConstantManage.message_function_push_post); untreatedBus.setType(MessageStateType.untreated); @@ -190,6 +210,7 @@ } + private void initView() { viewBinding.toolbarTopIn.topTitleTv.setText(R.string.message_alarm_info); @@ -197,6 +218,12 @@ viewBinding.toolbarTopIn.topBackBtn.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)); + viewBinding.messageInfoBackTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.fillet_line_38c494)); + viewBinding.messageInfoSolveTv.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.checked_38c494)); + } + viewBinding.messageInfoAlarmContentIn.leftTitleTv.setText(R.string.messagealarm_details_content); viewBinding.messageInfoAlarmDeviceIn.leftTitleTv.setText(R.string.messagealarm_details_device); viewBinding.messageInfoAlarmRangeIn.leftTitleTv.setText(R.string.message_alarm_detailsaffect_region); -- Gitblit v1.8.0