cardGapExpandedPx/cardGapCollapsedPx/rowPaddingPx/horizontalPaddingPx
移入 remember,每帧只做一次浮点插值而非完整 density 转换。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
monthScale/yearScale/targetAlpha 从 composable body 移入 graphicsLayer lambda,
state 读取只触发 draw-phase redraw 而非重组。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
- CalendarViewModel: year view state and animation methods
- CalendarMonthView: graphicsLayer zoom overlay, BottomCard hiding
- MonthHeader: toggle year view on click, "今天" button
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.
Apply consistent formatting: import ordering, line wrapping,
indentation, and XML normalization. No functional changes.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The fixed DRAG_RANGE_DP=200dp caused the collapse progress to advance faster
than the visual height change, making the calendar feel like it "outruns" the
finger. Now dragRangePx is computed as (weeks-1)×rowHeight, matching the
actual visual height delta during collapse so finger movement maps 1:1 to
visual change.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move padding after onSizeChanged in CalendarMonthPage so row height
measurement excludes padding. Rename p→collapseProgress for clarity.
Add comments explaining grid height calculation and pager switching.
Increase ROW_PADDING_DP from 4 to 6.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Card gap now interpolates between 24dp (expanded) and 12dp (collapsed)
instead of using a fixed value, providing a smoother visual transition.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Include CARD_GAP_DP in calendar area height calculation so BottomCard
positioning accounts for the gap. Add horizontal padding to MonthHeader
for better visual alignment.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
WeekPager had no height constraint (unlike CalendarPager which uses
pagerModifier with gridHeightPx), causing the pager to freely expand
instead of staying at the computed single-row height. Also, WeekPager
used 2dp row padding while CalendarMonthPage uses ROW_PADDING_DP (4dp),
creating a height mismatch at the switch point.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
gridHeightPx changed from derivedStateOf to direct computation because
derivedStateOf cannot track non-State local variable changes, causing
gridHeightPx to not update when rowHeightPx transitions from 0 to measured value.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move shared constants and helper functions into CalendarUtils.kt,
replace manual state synchronization with derivedStateOf in
CalendarViewModel and UI composables.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Remove unused currentWeeksCount variable and onWeeksChanged callback
- Replace deprecated monthNumber with month.number (requires explicit import)
- Remove all @Suppress("DEPRECATION") annotations for monthNumber
- Convert double comparison to range check (today in weekMonday..weekSunday)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace hardcoded padding values with constants, use Spacer instead of
space character for spacing, remove fontSize override on bodySmall, and
fix WeekdayHeader modifier order (padding before onSizeChanged).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Use currentPage instead of settledPage for interpolatedWeeks calculation
to prevent gridH jumps during month transitions. When offsetFraction is
near zero, compute weeks from currentPage rather than stale callback
state. Remove all debug println statements and TAG constants.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pass effectiveWeeks from CalendarMonthView through CalendarPager to
CalendarMonthPage so both use the same formula H*(1+(weeks-1)*(1-p)).
Fix interpolatedWeeks to anchor on settledPage instead of currentPage,
preventing direction/fraction discontinuity when currentPage jumps during
swipe transitions.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the fragile approach of computing rowHeightPx by dividing
Column height by weeks count with direct measurement via onSizeChanged
on the first DayCell row. Add estimated row height fallback based on
screen width and cell aspect ratio so the pager can be constrained
before the first measurement completes. Remove lockedRowHeightPx,
expandedWeeksCount, and calendarHeightPx state variables that are no
longer needed.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Clean up println debug logging and TAG constants added for
diagnosing the collapse animation issue. CalendarViewModel and
BottomCard restored to pre-debug versions; CalendarMonthView
and CalendarMonthPage cleaned inline.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add rowHeightPx parameter to CalendarPager and pass it through to
CalendarMonthPage. Remove onRowHeightMeasured callback which is no
longer needed since CalendarMonthPage now receives row height
externally. Update CalendarMonthView to pass rowHeightPx to CalendarPager.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add lockedRowHeightPx state that is only updated when fully expanded
(p < 0.01f). During collapse, rowHeightPx uses the locked value instead
of recalculating from the shrinking container height, which was causing
rowH to drop from 137→0 and gridH to become 0 at p=1.0.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>