18 Commits

Author SHA1 Message Date
meyou
c8ee7f7b44
DayCell SolarDay 静态缓存:避免 Pager 切换时重复创建对象触发 GC
每个 DayCell 创建时调用两次 SolarDay.fromYmd() 计算节日/农历信息。
Pager 缓存页的大量 DayCell 同时重建时产生大量临时对象,加剧 GC 压力
(trace 中 Background concurrent mark compact GC 346ms+253ms)。

修复:在 DayCell.kt 中增加进程级静态缓存 dayCellInfoCache,按日期缓存
computeDayCellInfo() 的结果。首次计算后永久复用,消除重复对象创建。
2026-05-18 23:08:20 +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
c28eb8d0e5 节日改为只在当天显示,休/班改为右上角角标
之前法定假期的「春节休」之类文本占据了整段假期,把假期里出现
的节气(雨水、惊蛰等)和其他节日全部挤掉。现在拆成两条线:

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

DayCell 外层多包一层 Box 承载 aspectRatio,原内层保留圆形裁
剪与涟漪;角标放在外层 TopEnd,避免被 CircleShape 裁掉。
2026-05-16 17:34:53 +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
xfy
8913e5ff0d Add circular reveal animation to DayCell with animated state transitions
Replace hard-switched background/border modifiers with updateTransition-based
animated properties: revealProgress for circular indicator radius, contentColor
and selectedColor via animateColor, borderAlpha for today stroke. Use drawBehind
for custom circle drawing with tween(250, FastOutSlowInEasing) spec.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 17:49:12 +08:00
xfy
bacc2bc8dc Use primaryContainer colors when today is also selected
Distinguish the selected-today state from regular selection by using
primaryContainer/onPrimaryContainer instead of primary/onPrimary,
providing a softer visual treatment for the combined state.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 17:53:33 +08:00
xfy
de8cb4334b Use border outline instead of filled background for today indicator
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 17:50:25 +08:00
xfy
d7552e469f Add KDoc and inline comments per COMMENTS.md conventions
- Add KDoc to all public Composable functions with parameter descriptions
- Add inline comments for non-obvious algorithms (42-cell grid, pager mapping)
- Add @Suppress reason comments for monthNumber deprecation
- Document collapseProgress range and physical meaning
- Add named constant comments for START_PAGE
- Add Preview name to App()

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 15:22:49 +08:00
xfy
00a24e58fd Add MonthHeader, WeekdayHeader, and DayCell UI components
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:20:32 +08:00