50da18460f
fix(date-recorder): correct photo EXIF orientation and fix capture crash
...
- PhotoProcessor: read EXIF orientation and rotate bitmap on load so
camera JPEGs display upright
- CameraScreen: set target rotation so CameraX writes correct EXIF
- CameraScreen: fix RejectedExecutionException by not shutting down the
capture executor on dispose (CameraX may still post to it after)
- CameraScreen: route capture callback through main handler for thread
safety before triggering Activity navigation
- CameraScreen: defer camera binding until PreviewView is attached to
avoid repeated Surface abandon/recreate and camera rebind loops
- CameraScreen: use an overlay (not component swap) for the capturing
state so the bound ImageCapture is not torn down mid-capture
- deps: add androidx.exifinterface for EXIF reading
2026-07-17 15:36:36 +08:00
8963b6162b
feat(date-recorder): photo journal tool with camera, editor, and album grid
...
新增"日期记录器"工具:相册式记录管理,支持拍照→编辑→记录信息的完整流程。
数据层:
- Room 2.8.4 首个数据库(KSP 2.3.10),DateRecord 实体含标题/备注/拍摄日期/关联日期
- DateRecordConverters 处理 kotlinx-datetime ↔ ISO 字符串
- DateRecorderRepository 封装 DAO + filesDir 照片文件管理
UI 层:
- CameraScreen: CameraX 1.5.3 应用内预览,运行时权限请求,前后摄切换
- PhotoEditorScreen: 纯 Compose 自实现旋转/裁剪/手写三 Tab 编辑器
- DateRecorderScreen: LazyVerticalGrid 相册网格 + 多选 + 6 种排序 + 批量删除
- RecordEditScreen / RecordDetailScreen: 记录信息编辑与详情查看
基础设施:
- CAMERA 权限 + FileProvider(filesDir 存储,免存储权限)
- 5 个 Activity 延续项目 Activity+Intent 滑动转场模式
- 2 个单测:排序逻辑 6 种组合 + 降采样计算
2026-07-17 13:21:45 +08:00
1caea057c5
build: add media3 exoplayer dependency for dog park easter egg
2026-06-16 15:38:46 +08:00
564e4e3960
refactor: 清理无效 ProGuard 规则、调试日志,trace 解耦 VM
...
P0 正确性与工程卫生修复:
- 删除 core/proguard-rules.pro 中全部无效的 -keepclassmembers 规则
(LunarCache.getOrCompute 实为实例 suspend 方法,generateMonthDays 实为
private,签名均不匹配,属 placebo);同时移除 core/build.gradle.kts
release block 内重复的 consumerProguardFiles 声明
- 将 7 处 composeTrace 调用从 CalendarViewModel 移至 Compose 层
(MenuItem.onClick / onMonthClick / BottomCard 回调),VM 不再依赖
android.os.Trace,可在纯 JVM 环境测试无需兜底
- 删除 CalendarViewModel 与 4 个 UI 文件中约 30 处 logd 调用及其辅助
变量/ SideEffect/ DisposableEffect (AnimLog.kt 工具函数保留)
- 删除 CalendarViewModel.getIsoWeekNumber 不可达的 weekNumber < 1 递归分支
- 修正 MainActivity.kt setContent 块缩进错位
- 同步 README: sketch 渲染 GIF→动画 WebP,补提 :macrobenchmark 模块;
删除 AGENTS.md 顶部过时的「README 与实际不符」注释
验证: spotlessApply UP-TO-DATE, testDebugUnitTest 全过,
assembleDebug + assembleRelease (R8) 均成功
2026-06-15 16:24:38 +08:00
58a97d1725
refactor: WebP 文件列表改由构建期 BuildConfig 注入,消除 (1..152) 硬编码
...
问题
- AnimatedWebp.kt 原写死 WEBP_FILES = (1..152).map{...}, 与磁盘文件耦合却无校验
- 加 153.webp → 永远不会被随机到; 删某个 → random() 偶发命中不存在的资源
- 这是静默失败, 运行期无报错, 难排查
改动
- core/build.gradle.kts defaultConfig: 构建期扫描 assets/animations/ 生成
buildConfigField("String[]", "WEBP_FILES", "new String[]{...}")
含 require(webpFiles.isNotEmpty()) 防空目录构建
- AnimatedWebp.kt: WEBP_FILES 从 private 硬编码改为 internal val = BuildConfig.WEBP_FILES.toList()
(internal 让同模块测试可访问)
- 新增 AnimatedWebpFilesTest: 2 个守卫测试
1. webpFilesMatchDirectoryContents: WEBP_FILES 必须与 assets/animations/ 一一对应
2. webpFilesUseZeroPaddedThreeDigitNames: 锁定 NNN.webp 命名约定
TDD 流程
- 先写测试 → 编译失败(WEBP_FILES 是 private) → 红灯成立
- 改实现 → 测试 PASS → 绿灯
- 突变验证: 临时改 WEBP_FILES = (1..150) 漏掉 151/152
→ webpFilesMatchDirectoryContents 立即 FAIL, 守卫有效
- 恢复后全量 146 个测试 0 失败
设计说明
- 当前实现里 WEBP_FILES 与目录都来自同一次构建期扫描, 二者天然一致
- 测试的核心价值是锁定「两者一致」不变量, 防止有人回退成硬编码
(突变验证已证明: 回退后测试立即失败)
- BuildConfig 生成结果验证: String[] 含 152 个元素 001~152.webp
验证
- ./gradlew :core:testDebugUnitTest → 146 tests, 0 failures, 0 errors
- ./gradlew :app:assembleDebug → BUILD SUCCESSFUL
- BuildConfig.java: public static final String[] WEBP_FILES = new String[]{"001.webp",...,"152.webp"}
2026-06-15 14:02:21 +08:00
6b15c4b88b
feat: 日期检查器 FAB 图标替换为 Material Icons
2026-06-08 11:36:58 +08:00
a431dcdfbf
feat: 添加 trace 构建类型 + 增强性能追踪脚本
...
- ComposeTrace 改用 BuildConfig.ENABLE_TRACE 控制,release 关闭,debug/trace 开启
- core/app 添加 trace buildType:release 优化(R8 + shrink resources)+ 保留 trace 标记
- CalendarMonthView/WeekPager 添加更多自定义 trace marker,覆盖年月视图切换路径
- profile.sh 增强:
- 添加 --trace 参数支持 trace 构建
- Perfetto 配置增加 gpu.memory 和 surfaceflinger.frametimeline 数据源
- 报告自动提取帧率百分位、jank 比例、内存摘要
- 添加年月视图切换专项分析指南和基线对比方法
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 16:19:21 +08:00
e934d33cfa
cleanup: ComposeTrace 仅在 debug 构建中启用
...
- core/build.gradle.kts: 启用 buildConfig 生成
- ComposeTrace: 添加 BuildConfig.DEBUG 条件,release 构建中空操作
避免 R8 full mode 下 Trace 调用的生产环境开销
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 15:15:29 +08:00
5bac114c16
cleanup: 移除冗余依赖、死代码和构建配置
...
- core: 移除未使用的 uiTooling/uiToolingPreview debug 依赖
- app: 删除冗余 ndk abiFilters、bundle.language、netty pickFirsts
- app: 修复 packaging.excludes 花括号展开语法
- Platform: 删除死代码 AppPredictiveBackHandler 及未使用 import
- CalendarMonthView: 删除重复 import animateFloatAsState
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:53:39 +08:00
9bd1f57daf
build: 将 152 个 GIF 动画资源批量转换为 WebP 格式
...
使用 gif2webp -mixed -mt 批量转换,资源从 5.65MB 降至 3.60MB,
APK release 包从 7.8MB 降至 5.8MB(减少 26%)。
同步更新:
- 依赖:sketch-animated-gif → sketch-animated-webp
- 代码:GIF_FILES → WEBP_FILES,getGifUri → getWebpUri
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 18:04:36 +08:00
e02459e8c9
build: 删除未引用的 kotlin-test 条目,移除 @Preview,uiTooling 改为 debugImplementation
...
- 删除 libs.versions.toml 中未被任何模块引用的 kotlin-test 孤儿条目
- 移除所有 @Preview 注解和 Preview 函数(5 个文件)
- app/core 模块的 compose-uiTooling 从 implementation 改为
debugImplementation,避免打包到 release APK
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 17:53:05 +08:00
6582d5970e
perf: 集成 Baseline Profiles,优化启动性能与文档
...
- 添加 core/proguard-rules.pro 保留关键类方法签名
- 添加 core/src/main/baseline-prof.txt 预编译热点路径
- 引入 androidx.profileinstaller 依赖
- LunarCache 新增 formatLunarDate() 复用缓存数据
- BottomCard 使用 remember 缓存农历描述避免重复计算
- CalendarMonthView 延迟一帧显示 BottomCard,避免首帧阻塞
- README 补充 Baseline Profiles 维护指南与性能监控说明
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 10:22:43 +08:00
f5cc4ef2e5
refactor: 完成纯 Android 迁移,清理旧 KMP 模块并添加 app/core 新模块
...
- 删除遗留的 androidApp/、shared/ 等 KMP 结构文件
- 将新的 app/、core/ 纯 Android 模块纳入版本控制
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 15:55:08 +08:00