更新优化

This commit is contained in:
2026-11-03 09:04:54 +08:00
parent f67f062bfe
commit 5c1a3dc059
199 changed files with 2562 additions and 439 deletions
@@ -1,5 +1,6 @@
package cn.shangyu.gdxzExpert.netease.bagder;
import android.content.Context;
import android.os.Handler;
import com.netease.nim.uikit.api.NimUIKit;
@@ -29,6 +30,22 @@ public class Badger {
SharePrefUtil.saveInt(UIUtils.getContext(),"unreadFollow",unreadFollow);
}
/**
* 清除桌面角标:随访未读计数、ShortcutBadger 角标,并同步为 0。
*/
public static void clearAllBadges(Context context) {
Context appContext = context != null ? context.getApplicationContext() : UIUtils.getContext();
unreadFollow = 0;
saveUnreadFollow();
support = true;
try {
ShortcutBadger.removeCount(appContext);
ShortcutBadger.applyCount(appContext, 0);
} catch (Exception ignore) {
}
updateBadgerCount(0);
}
public static void updateBadgerCount(final int unreadCount) {
if (!support) {
return; // O版本及以上不再支持