| | |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.widget.TextView; |
| | | |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; |
| | |
| | | import com.hdl.photovoltaic.enums.MessageFunctionTabSwitch; |
| | | import com.hdl.photovoltaic.enums.MessageStateType; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.other.HdlMessageLogic; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | |
| | | this.messageRecoverAdapter.setList(mList); |
| | | this.messageRecoverAdapter.notifyDataSetChanged(); |
| | | } |
| | | |
| | | //刷新【已恢复】信息数量总数 |
| | | this.refreshRecoverCount(); |
| | | this.nullDataUpdateUi(); |
| | | } |
| | | |
| | | /** |
| | | * 刷新【已恢复】信息数量总数 |
| | | */ |
| | | private void refreshRecoverCount() { |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | TextView textView = _mActivity.findViewById(R.id.message_tab_recover_title_tv); |
| | | if (textView != null) { |
| | | textView.setText(getText(R.string.message_recover)); |
| | | if (mList.size() > 0) { |
| | | String s = getText(R.string.message_recover) + "(" + mList.size() + ")"; |
| | | textView.setText(s); |
| | | } |
| | | } |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @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())) { |
| | |
| | | //消息详情回调 |
| | | initData(); |
| | | updateListData(); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 没有电站列表的样式 |
| | | */ |
| | | private void nullDataUpdateUi() { |
| | | HdlCommonLogic.getInstance().nullDataUpdateUi(_mActivity, |
| | | viewBinding.nullDataIc.getRoot(), |
| | | viewBinding.nullDataIc.nullDataGifAnimationIv, |
| | | viewBinding.nullDataIc.nullDataTv, getString(R.string.message_alarm_data_null), mList.size() > 0); |
| | | } |
| | | } |