refactor: 月→年视图切换时不再强制展开折叠态
折叠状态下直接切换视图,sharedElement 从周视图缩小到 MiniMonth 的转场更自然。同时修复了重复的 trace begin。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2028897ce3
commit
27ba4f9f54
@ -129,15 +129,7 @@ class CalendarViewModel(
|
|||||||
animJob.join()
|
animJob.join()
|
||||||
composeTraceEndSection()
|
composeTraceEndSection()
|
||||||
} else {
|
} else {
|
||||||
// 月 → 年:如果折叠,先展开
|
// 月 → 年:直接切换,折叠态下周视图的 sharedElement 缩小到 MiniMonth 更自然
|
||||||
if (isCollapsed) {
|
|
||||||
_collapseAnimatable.animateTo(
|
|
||||||
targetValue = 0f,
|
|
||||||
animationSpec = spring(dampingRatio = 0.8f, stiffness = 400f)
|
|
||||||
)
|
|
||||||
isCollapsed = false
|
|
||||||
}
|
|
||||||
// 先启动动画(月视图开始缩小),等一帧后翻转 isYearView(年视图开始组合)
|
|
||||||
composeTraceBeginSection("MonthView→YearView")
|
composeTraceBeginSection("MonthView→YearView")
|
||||||
yearViewYear = selectedDate.year
|
yearViewYear = selectedDate.year
|
||||||
_yearViewAnimatable.snapTo(0f)
|
_yearViewAnimatable.snapTo(0f)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user