113 Commits

Author SHA1 Message Date
xfy
0962d13216 gridHeightPx/calendarAreaHeightPx/cardHeightPx 包裹 derivedStateOf
将依赖 collapseProgress 的中间计算移入 derivedStateOf,
确保只在被读取时才计算,避免不必要的中间对象创建。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 15:06:04 +08:00
xfy
d5b7d2cd8a 预计算固定 dp→px 转换,避免每帧重复 density 计算
cardGapExpandedPx/cardGapCollapsedPx/rowPaddingPx/horizontalPaddingPx
移入 remember,每帧只做一次浮点插值而非完整 density 转换。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 15:04:31 +08:00
xfy
3b3988251a 年视图切换动画计算移入 graphicsLayer lambda 避免重组
monthScale/yearScale/targetAlpha 从 composable body 移入 graphicsLayer lambda,
state 读取只触发 draw-phase redraw 而非重组。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 14:58:16 +08:00
xfy
1ddba1881b 修复 weeks/anchorIndex remember 缓存失效
weeks = days.chunked(7) 每帧创建新列表导致 remember key 变化、缓存失效。
将 weeks 包裹在 remember(days) 中,anchorIndex 缓存才能正确生效。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 14:54:12 +08:00
xfy
5d6b2071e2 行偏移从 offset(Dp) 改为 graphicsLayer(translationY) 避免每帧 layout pass
offset 触发 layout-phase 重测量,trace 中 measure 最高 1266ms。
graphicsLayer 只触发 draw-phase redraw,跳过 layout。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 14:53:11 +08:00
xfy
72b591ab49 整理 import 排序和缩进格式
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 14:16:44 +08:00
xfy
7250d08fb7 年视图标题固定 + 交叉淡入淡出 + 移除 fadeIn/fadeOut
年视图标题行从 HorizontalPager 内移到外部,左右滑动时标题不随 pager 滚动。
年份切换时标题文字用垂直滑动动画(与 MonthHeader 一致,移除 fadeIn/fadeOut)。
月/年视图左右滑动改为交叉淡入淡出,修复原实现中间全白的问题。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 14:14:46 +08:00
xfy
302e6556dd MonthHeader 年月与周号垂直居中对齐
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 13:36:23 +08:00
xfy
62924eff3e FAB 固定在屏幕左下角,不再跟随 BottomCard 高度
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 13:29:25 +08:00
xfy
02730e54e8 实现缩放动画菜单和 Scrim 关闭
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 11:54:27 +08:00
xfy
5a7d1f1781 更新 KDoc: FAB 菜单切换视图描述
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 11:53:54 +08:00
xfy
a7bf59e42e 添加 FAB 浮动按钮和菜单状态
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 11:52:48 +08:00
xfy
37af18ad8d 实现缩放动画菜单和 Scrim 关闭
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 11:49:45 +08:00
xfy
ff3bd6629d 实现缩放动画菜单和 Scrim 关闭
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 11:46:43 +08:00
xfy
2b0bb7e1d8 移除 MonthHeader 点击切换年视图功能
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 11:41:33 +08:00
xfy
bad536617d 年视图网格: 改用 spacedBy 统一行列间距,月份顶部对齐
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 10:49:38 +08:00
xfy
d9326668a4 年视图布局优化: 月份填满视图、加大字号、添加间距
- 4行用 weight(1f) 等分网格区域高度,月份均匀撑高填满视图
- 纵向 Arrangement 从 SpaceEvenly 改为 Top,去掉首行前/末行后大间隙
- 横向 Arrangement 从 SpaceEvenly 改为 SpaceBetween
- 第1行上方加 8dp padding,第4行下方加 8dp padding
- 月份之间横向加 8dp 间距(col0 end=4dp + col2 start=4dp)
- 月份标题字号 9→10sp,星期行 6→8sp,日期数字 6→8sp
- 日期行高 9→12sp,日期行之间加 padding(vertical=2.dp)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 10:42:56 +08:00
xfy
17146e2bc0 格式化: import 排序、长行换行、空行规范
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 10:10:59 +08:00
meyou
c95f118daf DayCell 关闭默认 ripple,消除选中后残留的灰色状态层
clickable 默认 indication 会在 release 后慢慢淡出灰色波纹,
选中态视觉已由 reveal 圆形动画承担,关闭默认 indication 即可
让点击反馈立即结束,不留灰色残影。
2026-05-16 19:40:47 +08:00
meyou
275fc55c79 选中态动画从 250ms 缩短到 150ms 让圆环填充消失更利落 2026-05-16 19:37:00 +08:00
meyou
6618c1863a 排班在右侧时沿用法定调休样式:surface 底 + 彩色文字
默认布局(showLegalHoliday=false)下,右上角排班从实心胶囊改为
surface 背景圆 + 班=primary/休=error 彩色文字,与开启法定调休
时右上角角标视觉规范一致。左上角(showLegalHoliday=true)保持
实心胶囊样式不变,用于区分两类信息。
2026-05-16 19:32:44 +08:00
meyou
043bd9824b 新增法定调休开关,默认禁用,排班接管右上角
ViewModel 增加 showLegalHoliday 状态,默认 false。
关闭时:排班从左上角移到右上角,不显示法定调休角标。
开启时:回到旧布局,左上角=排班、右上角=法定调休。
DayCell 与各 Pager 透传新参数,预留后续接入设置页。
2026-05-16 19:29:06 +08:00
meyou
ecf4cf601e 新增个人轮班 MVP:左上角胶囊显示班/休
新增 ShiftPattern 数据模型,以锚点日期 + 循环序列描述周期性轮班,与法定调休完全独立。
默认配置 2026-05-15 起 [班,班,休,休] 4 天周期,DayCell 左上角渲染胶囊角标。
2026-05-16 19:12:18 +08:00
meyou
f63b57eef1 角标加 surface 背景咬开描边圆,今日未选中时去掉描边只留 primary 文字
角标(休/班)从只是叠在描边圆之上,改为自带 surface 圆背景:
覆盖身后那段弧,产生"咬开圆环"的视觉断点。

同时 TODAY 状态(今日未被选中)去掉描边圆,文字仍保持 primary 主色,
通过文字颜色标识今天,与选中其他日期时形成更清晰的层次。
2026-05-16 18:56:02 +08:00
meyou
71a3cbc62a 选中态:今天=实心填充,非今天=描边圆,角标置顶不再被遮挡
之前所有选中态都是实心圆,描边圆只用于"今天未选中"。
现改为:今天+选中=primaryContainer 实心填充,普通日期+选中=primary 描边圆,
今天未选中维持细描边。
角标加 zIndex(1f) 提到最上,padding 收紧到 top=1/end=2 紧贴右上角方形空白,
配合描边圆改造,休/班角标在选中态下不再被圆形覆盖。
2026-05-16 18:47:57 +08:00
meyou
aa223db519 年月视图切换时立即移除源视图,仅对目标视图播放缩放动画
之前月↔年切换使用交叉淡入:两层同时合成,源视图渐隐、目标视图渐显。
现改为单向过渡:先翻转 isYearView 让源视图立刻从合成中移除,
withFrameNanos 等一帧后再启动目标视图的 scale/alpha 动画,避免抖动。
2026-05-16 17:42:21 +08:00
meyou
c28eb8d0e5 节日改为只在当天显示,休/班改为右上角角标
之前法定假期的「春节休」之类文本占据了整段假期,把假期里出现
的节气(雨水、惊蛰等)和其他节日全部挤掉。现在拆成两条线:

- 主标注:按 农历节日 → 节气当天 → 公历节日 → 农历日期 的
  优先级,仅在节日/节气当天展示节日名。
- 右上角角标:单独读取法定假期标志,调休「休」为 error 色,
  调休「班」为 primary 色;非当月时整体降低不透明度。

DayCell 外层多包一层 Box 承载 aspectRatio,原内层保留圆形裁
剪与涟漪;角标放在外层 TopEnd,避免被 CircleShape 裁掉。
2026-05-16 17:34:53 +08:00
meyou
889a54db0e 修复折叠周视图跨月日期未置灰的问题
WeekPager 之前把 isCurrentMonth 硬编码成 true,导致折叠状态下
当前周里属于上/下个月的日期没有变灰,与展开月视图的灰显约定不
一致。改为按 selectedDate 的年月判定(与 MonthHeader 显示的
月份一致),保持折叠前后的视觉一致性。
2026-05-16 17:30:51 +08:00
meyou
b730edc1eb 修复首次启动切换年视图无动画问题
通过 withFrameNanos 在动画前预留一帧,让年视图先完成首次合成与
布局,避免 HorizontalPager + YearGridView 的初次合成开销吃掉动
画时间段。与之前的「常驻合成」方案相比,本次只调时序、不动渲染
结构,因此不会再触发年视图层在隐藏时拦截触摸事件的回归。
2026-05-16 17:27:39 +08:00
meyou
c096651e0f Revert "修复首次启动切换年视图无动画的问题"
This reverts commit 216ebbf990555f8282371199b8d1cc4bb86d9b2e.
2026-05-16 17:02:45 +08:00
meyou
216ebbf990 修复首次启动切换年视图无动画的问题
始终组合年视图 HorizontalPager 层(通过 graphicsLayer.alpha=0 隐藏),
避免首次进入时 Pager 组合延迟导致动画首帧丢失。
2026-05-16 16:59:27 +08:00
meyou
142d0c235a 修复年视图布局和动画问题
- 年视图每个小月历添加星期行头部
- 日期列用 weight(1f) 对齐,去掉 CircleShape 裁剪
- 取消前一个动画 Job 防止快速点击时动画丢失
2026-05-16 16:49:10 +08:00
meyou
8dad07c0a0 年视图支持左右滑动切换年份
使用 HorizontalPager 包裹年视图,支持手势滑动切年。
‹ › 按钮改为 animateScrollToPage,与滑动行为一致。
2026-05-16 16:43:32 +08:00
meyou
502f1efc0a Fix year view showing stale year: reset to selectedDate.year on enter 2026-05-16 16:39:58 +08:00
meyou
c996d026cc Replace year view month cells with mini calendar grids
Each month in the 4x3 year grid now shows a compact calendar with
day numbers, matching the iOS Calendar year view style. Today is
highlighted with a filled circle. Selected month title uses primary color.
2026-05-16 16:35:56 +08:00
meyou
731a1bb6a1 Wire year view into CalendarMonthView, MonthHeader and ViewModel
- CalendarViewModel: year view state and animation methods
- CalendarMonthView: graphicsLayer zoom overlay, BottomCard hiding
- MonthHeader: toggle year view on click, "今天" button
2026-05-16 16:29:37 +08:00
meyou
995693cb5d Add year view with Hero Zoom transition
- CalendarViewModel: add isYearView, yearViewProgress, yearViewYear state
  with toggleYearView(), selectMonthFromYearView(), year navigation methods
- YearGridView: new 4x3 month grid with year navigation header
- MonthHeader: onClick now toggles year view, added "今天" button
- CalendarMonthView: overlay year view with graphicsLayer anchor-based
  scale transition, hide BottomCard during year view
2026-05-16 16:29:17 +08:00
meyou
16b73c4373 Fix flash when expanding after navigating months in collapsed state
Sync CalendarPager's pagerState to selectedDate in CalendarMonthView
via LaunchedEffect(selectedDate), so the page is already correct when
CalendarPager re-enters composition during expand. Remove the now-
redundant LaunchedEffect(Unit) sync in CalendarPager.
2026-05-16 15:58:12 +08:00
meyou
b0b97650ec Fix week number alignment: use Bottom + padding instead of alignByBaseline
alignByBaseline caused layout jumps during AnimatedContent transitions.
Switch to Bottom alignment with 2dp bottom padding on week number for
stable visual alignment with month text baseline.
2026-05-16 15:45:03 +08:00
meyou
888c4d03d3 Use baseline alignment for month text and week number 2026-05-16 15:39:38 +08:00
meyou
418b97baed Fix week number baseline alignment and collapsed state today jump
- MonthHeader: align week number text baseline with month text (Bottom)
- WeekPager: scroll to selectedDate's week when it changes externally,
  fixing the case where clicking "back to today" in collapsed state
  didn't navigate the week pager to the current week
2026-05-16 15:32:26 +08:00
meyou
055738220c Add holiday, festival and solar term annotations to DayCell
Replace plain lunar text with priority-based annotations:
legal holidays > lunar festivals > solar terms > solar festivals > lunar day.
Holiday/festival text uses error color to stand out from regular lunar text.
2026-05-16 15:22:18 +08:00
meyou
dfda6fa5a9 DayCell 增加农历日期显示
使用 tyme4kt 库在日期数字下方显示农历日名,初一显示月名。
2026-05-16 15:15:27 +08:00
meyou
c86cdd61b8 修复 BottomCard 深色模式适配和 DayCell 无障碍支持 2026-05-16 14:57:24 +08:00
meyou
b65856a4ae 点击月份标题跳转到今天 2026-05-16 14:54:35 +08:00
meyou
fcad070800 修复折叠态跨月周选中和展开闪跳问题
1. 展开同步逻辑移至 CalendarPager(LaunchedEffect(Unit)),减少闪帧
2. 跨月周根据滑动方向选中日期:
   - 后退到跨月周:选较晚月份1号,留在当月
   - 前进到跨月周:选该周周一,留在上个月
2026-05-16 13:38:34 +08:00
meyou
09e13e335c Revert 跨月周选中逻辑的两个提交,重新设计 2026-05-16 13:28:29 +08:00
meyou
857cf88cb0 修复跨月周选中逻辑:根据滑动方向决定选中日期
后退到跨月周(如从5月滑到4月27-5月3):选中较晚月份1号,留在当月。
前进到跨月周(如从4月滑到4月27-5月3):选中该周周一,留在上个月。
2026-05-16 13:22:47 +08:00
meyou
104c5e5baa 修复折叠态跨月周选中上个月日期的问题
跨月周(如5月第一周周一是4月27日)改为选中下个月的1号,
避免月份标题和展开内容不一致。
2026-05-16 13:10:03 +08:00
meyou
e403c683f6
Sync CalendarPager to selectedDate month when expanding from week view 2026-05-16 12:24:12 +08:00