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 cff540d..64610a4 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt @@ -61,7 +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 cardGapPx = with(density) { lerp(CARD_GAP_EXPANDED_DP.toFloat(), CARD_GAP_COLLAPSED_DP.toFloat(), p).dp.toPx() }.toInt() val interpolatedWeeks by remember { derivedStateOf { 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 559b531..60382b9 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarUtils.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarUtils.kt @@ -24,8 +24,11 @@ const val HORIZONTAL_PADDING_DP = 16 /** BottomCard 拖拽手势范围 (dp) */ const val DRAG_RANGE_DP = 200 -/** 日历与 BottomCard 之间的间距 (dp) */ -const val CARD_GAP_DP = 12 +/** 日历与 BottomCard 之间的间距 (dp):展开时 */ +const val CARD_GAP_EXPANDED_DP = 24 + +/** 日历与 BottomCard 之间的间距 (dp):折叠时 */ +const val CARD_GAP_COLLAPSED_DP = 12 /** 线性插值 */ fun lerp(start: Float, end: Float, fraction: Float): Float = start + (end - start) * fraction