From 24250ef7a68547b155ba1901a40e8f99d4b63744 Mon Sep 17 00:00:00 2001 From: dongliang Date: Sat, 9 May 2026 21:37:44 +0930 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E6=AC=A1=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=90=8E=E7=BB=9F=E8=AE=A1=E6=95=B0=E5=AD=97=E6=98=BE=E7=A4=BA?= =?UTF-8?q?0=EF=BC=8ConResume=E5=A7=8B=E7=BB=88=E5=88=B7=E6=96=B0=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- .../java/com/xiaoqu/watch/ui/home/HomeFragment.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/xiaoqu/watch/ui/home/HomeFragment.kt b/app/src/main/java/com/xiaoqu/watch/ui/home/HomeFragment.kt index 2fb2e4d..ed41dfc 100644 --- a/app/src/main/java/com/xiaoqu/watch/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/xiaoqu/watch/ui/home/HomeFragment.kt @@ -166,13 +166,16 @@ class HomeFragment : BaseFragment() { // 检查版本更新(5分钟最小间隔) (activity as? com.xiaoqu.watch.app.MainActivity)?.checkForUpdate() - if (notificationManager.pendingCount <= 0) { + // 每次回到首页都刷新统计(解决首次绑定后数字为0、从子页返回数据过期的问题) + if (notificationManager.pendingCount > 0) { + // 有未读通知 → 刷新统计 + 红点 + fetchStatistics(checkDots = true) + } else { activeDotCards.clear() renderDots() - return + // 无通知也要刷新数字(首次绑定、任务列表操作后返回等场景) + fetchStatistics() } - // 有未读通知 → 刷新统计 + 红点 - fetchStatistics(checkDots = true) } override fun onDestroyView() {