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 c31ae8d..e89a2db 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 @@ -71,10 +71,6 @@ class HomeFragment : BaseFragment() { private lateinit var dotComplete: View /** 当前应显示红点的卡片集合(累积,只有显式操作才移除) */ private val activeDotCards = mutableSetOf() - /** 红点 View 映射 */ - private val dotViews: Map by lazy { - mapOf(2 to dotPool, 3 to dotPunch, 4 to dotComplete) - } // ===== 设置页 View 引用 ===== private lateinit var tvAvatarLetter: TextView @@ -575,9 +571,10 @@ class HomeFragment : BaseFragment() { /** 统一渲染红点:以 activeDotCards 为唯一数据源 */ private fun renderDots() { - dotViews.forEach { (status, dot) -> - dot.visibility = if (status in activeDotCards) View.VISIBLE else View.GONE - } + dotPool.visibility = if (2 in activeDotCards) View.VISIBLE else View.GONE + dotPunch.visibility = if (3 in activeDotCards) View.VISIBLE else View.GONE + dotComplete.visibility = if (4 in activeDotCards) View.VISIBLE else View.GONE + Timber.d("首页: renderDots 完成 pool=${dotPool.visibility==View.VISIBLE} punch=${dotPunch.visibility==View.VISIBLE} complete=${dotComplete.visibility==View.VISIBLE}") } /** 标记某个分类已查看:从 activeDotCards 移除 + 通知管理器记录 */