From be5c9f324ac1d31f4f262d288c5f72a7a0c10c47 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期五, 19 一月 2024 10:08:23 +0800
Subject: [PATCH] 2024年01月19日10:08:08
---
app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java b/app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java
index 00bded9..ec3c8a1 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/message/RecoverMessageFragment.java
@@ -2,6 +2,7 @@
import android.content.Intent;
import android.os.Bundle;
+import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
@@ -15,6 +16,7 @@
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;
@@ -103,11 +105,19 @@
this.messageRecoverAdapter.setList(mList);
this.messageRecoverAdapter.notifyDataSetChanged();
}
+
+ //鍒锋柊銆愬凡鎭㈠銆戜俊鎭暟閲忔�绘暟
+ this.refreshRecoverCount();
+ this.nullDataUpdateUi();
}
+
@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())) {
@@ -121,6 +131,7 @@
//娑堟伅璇︽儏鍥炶皟
initData();
updateListData();
+
}
}
}
@@ -170,4 +181,35 @@
});
}
}
+
+ /**
+ * 鍒锋柊銆愬凡鎭㈠銆戜俊鎭暟閲忔�绘暟
+ */
+ 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);
+ }
+ }
+
+ }
+ });
+ }
+
+ /**
+ * 娌℃湁鐢电珯鍒楄〃鐨勬牱寮�
+ */
+ 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);
+ }
+
}
--
Gitblit v1.8.0