修复首次启动切换年视图无动画的问题

始终组合年视图 HorizontalPager 层(通过 graphicsLayer.alpha=0 隐藏),
避免首次进入时 Pager 组合延迟导致动画首帧丢失。
This commit is contained in:
meyou 2026-05-16 16:59:27 +08:00
parent 142d0c235a
commit 216ebbf990

View File

@ -270,8 +270,7 @@ fun CalendarMonthView(
} }
} }
// 年视图层HorizontalPager 支持左右滑动切年 // 年视图层:始终组合以避免首次进入时的组合延迟导致动画丢失
if (viewModel.isYearView || yearProgress > 0.01f) {
HorizontalPager( HorizontalPager(
state = yearPagerState, state = yearPagerState,
beyondViewportPageCount = 1, beyondViewportPageCount = 1,
@ -311,7 +310,6 @@ fun CalendarMonthView(
} }
) )
} }
}
// BottomCard年视图时隐藏 // BottomCard年视图时隐藏
if (yearProgress < 0.01f) { if (yearProgress < 0.01f) {