| | |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.JsonObject; |
| | | import com.hdl.linkpm.sdk.core.exception.HDLException; |
| | | import com.hdl.photovoltaic.R; |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 读取消息【未读数量】 |
| | | */ |
| | | private void getUnreadCount() { |
| | | HdlMessageLogic.getInstance().getMessageUntreatedCount(new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(String data) { |
| | | |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | JSONObject jsonObject = JSON.parseObject(data); |
| | | if (jsonObject.containsKey("untreatedCount")) { |
| | | //未处理数量 |
| | | String untreatedCount = jsonObject.getString("untreatedCount"); |
| | | refreshCount(); |
| | | } |
| | | if (jsonObject.containsKey("unreadCount")) { |
| | | //未读数量 |
| | | String unreadCount = jsonObject.getString("unreadCount"); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | TextView textView = _mActivity.findViewById(R.id.my_message_bottom_il2).findViewById(R.id.red_count_tv); |
| | | if (textView != null) { |
| | | textView.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) |