diff --git a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt index b780b47..cff540d 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt @@ -61,6 +61,7 @@ fun CalendarMonthView( val p = viewModel.collapseProgress val headerHeightPx = monthHeaderHeightPx + weekdayHeaderHeightPx val rowPaddingPx = with(density) { ROW_PADDING_DP.dp.toPx() }.toInt() + val cardGapPx = with(density) { CARD_GAP_DP.dp.toPx() }.toInt() val interpolatedWeeks by remember { derivedStateOf { @@ -102,7 +103,7 @@ fun CalendarMonthView( } } else 0 - val calendarAreaHeightPx = headerHeightPx + gridHeightPx + rowPaddingPx + val calendarAreaHeightPx = headerHeightPx + gridHeightPx + rowPaddingPx + cardGapPx val cardHeightPx = if (screenHeightPx > 0 && calendarAreaHeightPx > 0) screenHeightPx - calendarAreaHeightPx else 0 // 当 rowHeightPx 已知时,用计算的高度约束 pager;否则让 pager 自由扩展以测量行高 diff --git a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarUtils.kt b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarUtils.kt index 5e8fa58..559b531 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarUtils.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarUtils.kt @@ -24,6 +24,9 @@ const val HORIZONTAL_PADDING_DP = 16 /** BottomCard 拖拽手势范围 (dp) */ const val DRAG_RANGE_DP = 200 +/** 日历与 BottomCard 之间的间距 (dp) */ +const val CARD_GAP_DP = 12 + /** 线性插值 */ fun lerp(start: Float, end: Float, fraction: Float): Float = start + (end - start) * fraction diff --git a/shared/src/commonMain/kotlin/plus/rua/project/ui/MonthHeader.kt b/shared/src/commonMain/kotlin/plus/rua/project/ui/MonthHeader.kt index 812af31..71c9e97 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/MonthHeader.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/MonthHeader.kt @@ -30,7 +30,7 @@ fun MonthHeader( Row( modifier = modifier .fillMaxWidth() - .padding(vertical = 14.dp), + .padding(vertical = 14.dp, horizontal = 12.dp), verticalAlignment = Alignment.CenterVertically ) { Text(