| | |
| | | import com.hdl.photovoltaic.config.ConstantManage; |
| | | import com.hdl.photovoltaic.databinding.FragmentRecoverMessageBinding; |
| | | import com.hdl.photovoltaic.enums.MessageFunctionTabSwitch; |
| | | import com.hdl.photovoltaic.enums.MessageStateType; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.other.HdlMessageLogic; |
| | |
| | | public void onBindView(Bundle savedInstanceState) { |
| | | |
| | | //初始化数据 |
| | | initData(); |
| | | // initData(); |
| | | //初始化界面 |
| | | initView(); |
| | | //初始化监听器 |
| | |
| | | } |
| | | |
| | | private void initData() { |
| | | // for (int i = 0; i < 2; i++) { |
| | | // MessageBean messageBean = new MessageBean(); |
| | | //// messageBean.setContent("来了一条告警信息" + i); |
| | | // messageBean.setHomeName(i + ""); |
| | | //// messageBean.setTime("2023-12-06-15"); |
| | | // messageBean.setRead(false); |
| | | // mList.add(messageBean); |
| | | // } |
| | | mList.clear(); |
| | | mList.addAll(HdlMessageLogic.getInstance().getRecoverMessageMemoryList()); |
| | | } |
| | | |
| | | private void initEvent() { |
| | |
| | | messageRecoverAdapter.setNoOnclickListener(new MessageAdapter.OnclickListener() { |
| | | @Override |
| | | public void onClick(int position, MessageBean item) { |
| | | if (position < 0 || position > mList.size()) { |
| | | return; |
| | | } |
| | | Intent intent = new Intent(); |
| | | intent.putExtra("msgId", item.getMsgId().toString()); |
| | | intent.setClass(_mActivity, MessageInfoActivity.class); |
| | |
| | | if (eventBus.getTopic().equals(ConstantManage.message_function_tab_switch)) { |
| | | if (eventBus.getType().equals(MessageFunctionTabSwitch.recover.toString())) { |
| | | HdlLogLogic.print("正在点击【已恢复】"); |
| | | initData(); |
| | | getRecoverMessageList(true); |
| | | } |
| | | } else if (eventBus.getTopic().equals(ConstantManage.message_function_push_post)) { |
| | | if (eventBus.getType().equals(MessageStateType.processed)) { |
| | | initData(); |
| | | updateListData(); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (isShowLoading) { |
| | | showLoading(); |
| | | } |
| | | HdlMessageLogic.getInstance().getMessageList(HdlMessageLogic.MessageStatus.processed, new CloudCallBeak<List<MessageBean>>() { |
| | | HdlMessageLogic.getInstance().getRecoverMessageList(new CloudCallBeak<List<MessageBean>>() { |
| | | @Override |
| | | public void onSuccess(List<MessageBean> list) { |
| | | if (isShowLoading) { |