Add bottom padding to WeekdayHeader and account for it in collapse offset

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
xfy 2026-05-14 17:24:56 +08:00
parent c1e0484cba
commit a476ff01fc

View File

@ -64,7 +64,9 @@ fun CalendarMonthView(
expandedGridHeightPx expandedGridHeightPx
} else 0 } else 0
val cardTopPx = headerHeightPx + gridHeightPx val rowPaddingPx = with(density) { 2.dp.toPx() }.toInt()
val cardTopPx = headerHeightPx + gridHeightPx + rowPaddingPx
val cardHeightPx = screenHeightPx - cardTopPx val cardHeightPx = screenHeightPx - cardTopPx
val pagerModifier = if (p > 0.01f && expandedGridHeightPx > 0) { val pagerModifier = if (p > 0.01f && expandedGridHeightPx > 0) {
@ -104,7 +106,7 @@ fun CalendarMonthView(
WeekdayHeader( WeekdayHeader(
modifier = Modifier.fillMaxWidth().onSizeChanged { size -> modifier = Modifier.fillMaxWidth().onSizeChanged { size ->
weekdayHeaderHeightPx = size.height weekdayHeaderHeightPx = size.height
} }.padding(bottom = 2.dp)
) )
// 完全折叠且无动画时显示 WeekPager否则显示 CalendarPager含下拉恢复过程 // 完全折叠且无动画时显示 WeekPager否则显示 CalendarPager含下拉恢复过程
if (viewModel.isCollapsed && viewModel.collapseProgress >= 1f) { if (viewModel.isCollapsed && viewModel.collapseProgress >= 1f) {