| | |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.other.HdlMessageLogic; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.ui.adapter.MessageAdapter; |
| | | import com.hdl.photovoltaic.ui.bean.BUserInfo; |
| | | import com.hdl.photovoltaic.ui.bean.MessageBean; |
| | | import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | import org.greenrobot.eventbus.ThreadMode; |
| | | |
| | |
| | | mList.clear();//表示强制重新请求消息列表 |
| | | updateListData();//清空之前缓存,因为遇到一个问题猛拉的时候报错; |
| | | getRecoverMessageList(false); |
| | | HdlLogLogic.print("RecoverMessageFragment下拉刷新", false); |
| | | } |
| | | }); |
| | | messageRecoverAdapter.setNoOnclickListener(new MessageAdapter.OnclickListener() { |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) |
| | | public void onEventMessage(BaseEventBus eventBus) { |
| | | super.onEventMessage(eventBus); |
| | | if (eventBus == null) { |
| | | return; |
| | | } |
| | | //接收外部点击事件 |
| | | if (eventBus.getTopic().equals(ConstantManage.message_function_tab_switch)) { |
| | | if (eventBus.getType().equals(MessageFunctionTabSwitch.recover.toString())) { |
| | | HdlLogLogic.print("正在点击【已恢复】"); |
| | | initData(); |
| | | getRecoverMessageList(true); |
| | | // 取消粘性事件 |
| | | EventBus.getDefault().removeStickyEvent(eventBus); |
| | | } |
| | | } else if (eventBus.getTopic().equals(ConstantManage.message_function_push_post)) { |
| | | if (eventBus.getType().equals(MessageStateType.processed)) { |
| | | //消息详情回调 |
| | | initData(); |
| | | updateListData(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | HdlMessageLogic.getInstance().getRecoverMessageList(new CloudCallBeak<List<MessageBean>>() { |
| | | @Override |
| | | public void onSuccess(List<MessageBean> list) { |
| | | if (isShowLoading) { |
| | | hideLoading(); |
| | | } |
| | | if (!isShowLoading) { |
| | | viewBinding.messageRecoverSrl.setRefreshing(false); |
| | | } |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (isShowLoading) { |
| | | hideLoading(); |
| | | } |
| | | if (!isShowLoading) { |
| | | viewBinding.messageRecoverSrl.setRefreshing(false); |
| | | } |
| | | |
| | | if (list != null && list.size() != 0) { |
| | | mList.addAll(list); |
| | | updateListData(); |
| | | } |
| | | if (list != null && list.size() != 0) { |
| | | mList.addAll(list); |
| | | updateListData(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |