| | |
| | | |
| | | import android.content.DialogInterface; |
| | | import android.content.Intent; |
| | | import android.graphics.Typeface; |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | import android.widget.TextView; |
| | |
| | | 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) { |
| | | setStatusBarTranslucent(); |
| | | getWindow().setNavigationBarColor(getColor(R.color.text_FF333738)); |
| | | getWindow().setNavigationBarColor(getColor(R.color.text_FF1C1C1E)); |
| | | //初始化数据 |
| | | initData(); |
| | | //初始化 |
| | | initView(); |
| | | //初始化界面监听器 |
| | | initEvent(); |
| | | getUnreadCount(); |
| | | //进来读取一次数据(为了更新currentPage,currentTotal这个值) |
| | | loadNextPageMessageList(1, true, mDeviceTypeFilterKye, mDeviceTypeFilterValue, mTypeFilterKye, mTypeFilterValue, mTimeTypeFilterKye, mTimeTypeFilterValue); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected void onResume() { |
| | |
| | | viewBinding.toolbarTopMessageCenterListRl.topBackLl.setVisibility(View.VISIBLE); |
| | | 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); |
| | |
| | | if (isShowLoading) { |
| | | hideLoading(); |
| | | } |
| | | HdlThreadLogic.toast(_mActivity, e.getMsg() + "(" + e.getCode() + ")"); |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 读取消息【未读数量,未处理总数量,已处理总数量】 |
| | | */ |
| | | 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) { |