| | |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.other.HdlUniLogic; |
| | | import com.hdl.photovoltaic.ui.bean.MessageBean; |
| | | import com.hdl.photovoltaic.ui.bean.UnCountBean; |
| | | import com.hdl.photovoltaic.ui.message.MessageInfoActivity; |
| | | import com.hdl.photovoltaic.ui.newC.adapter.MessageCenterListAdapter; |
| | | import com.hdl.photovoltaic.uni.HDLUniMP; |
| | |
| | | |
| | | @Override |
| | | public void onBindView(Bundle savedInstanceState) { |
| | | setNotificationBarBackgroundColor(CustomColor.white); |
| | | setStatusBarTextColor(); |
| | | setStatusBarTranslucent(); |
| | | getWindow().setNavigationBarColor(getColor(R.color.text_FF333738)); |
| | | //初始化数据 |
| | | initData(); |
| | | //初始化 |
| | | initView(); |
| | | //初始化界面监听器 |
| | | initEvent(); |
| | | getUnreadCount(); |
| | | //进来读取一次数据(为了更新currentPage,currentTotal这个值) |
| | | loadNextPageMessageList(1, true, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected void onResume() { |
| | |
| | | } |
| | | |
| | | private void initView() { |
| | | viewBinding.toolbarTopMessageCenterListRl.getRoot().setBackgroundColor(getColor(R.color.text_FFFFFFFF)); |
| | | viewBinding.toolbarTopMessageCenterListRl.topBackLl.setVisibility(View.VISIBLE); |
| | | viewBinding.toolbarTopMessageCenterListRl.topLeftIv.setImageResource(R.drawable.back_c); |
| | | viewBinding.toolbarTopMessageCenterListRl.topTitleTv.setText(R.string.set_message_center); |
| | | viewBinding.toolbarTopMessageCenterListRl.topMoreBtn.setVisibility(View.VISIBLE); |
| | | viewBinding.toolbarTopMessageCenterListRl.topMoreIv.setImageResource(R.drawable.clearall); |
| | | viewBinding.toolbarTopMessageCenterListRl.topMoreIv.setImageResource(R.drawable.clear_all); |
| | | //默认选中全部设备 |
| | | viewBinding.allDeviceTitleIv.setBackgroundResource(R.drawable.down); |
| | | viewBinding.allGradeTitleIv.setBackgroundResource(R.drawable.down); |
| | |
| | | viewBinding.messageContentRl.setLayoutManager(mLayoutManager); |
| | | viewBinding.messageContentRl.setAdapter(messageCenterListAdapter); |
| | | messageCenterListAdapter.setList(mList); |
| | | this.nullDataUpdateUi(); |
| | | // this.nullDataUpdateUi(); |
| | | } |
| | | |
| | | private void initData() { |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 读取消息【未读数量,未处理总数量,已处理总数量】 |
| | | */ |
| | | private void getUnreadCount() { |
| | | HdlMessageLogic.getInstance().getMessageUntreatedCount(UserConfigManage.getInstance().getHomeId(), new CloudCallBeak<UnCountBean>() { |
| | | @Override |
| | | public void onSuccess(UnCountBean unCountBean) { |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (unCountBean == null) { |
| | | return; |
| | | } |
| | | mTotalCount1 = unCountBean.getUntreatedCount(); |
| | | mTotalCount2 = unCountBean.getProcessedCount(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) |
| | | public void onEventMessage(BaseEventBus eventBus) { |
| | |
| | | @Override |
| | | public void run() { |
| | | if (typeClick) { |
| | | viewBinding.messageBottomAlarmDeviceTitleTv.setTextColor(getColor(R.color.text_191919)); |
| | | viewBinding.messageBottomAlarmDeviceLineV.setVisibility(View.VISIBLE); |
| | | viewBinding.messageBottomAlarmRecordTitleTv.setTextColor(getColor(R.color.text_B2B2B2)); |
| | | viewBinding.messageBottomAlarmRecordLineV.setVisibility(View.GONE); |
| | | |
| | | |
| | | } else { |
| | | viewBinding.messageBottomAlarmDeviceTitleTv.setTextColor(getColor(R.color.text_B2B2B2)); |
| | | viewBinding.messageBottomAlarmDeviceLineV.setVisibility(View.GONE); |
| | | viewBinding.messageBottomAlarmRecordTitleTv.setTextColor(getColor(R.color.text_191919)); |
| | | viewBinding.messageBottomAlarmRecordLineV.setVisibility(View.VISIBLE); |
| | | } |
| | | |