diff --git a/shared/src/commonMain/kotlin/plus/rua/project/CalendarViewModel.kt b/shared/src/commonMain/kotlin/plus/rua/project/CalendarViewModel.kt index f634a2e..29b373b 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/CalendarViewModel.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/CalendarViewModel.kt @@ -47,14 +47,12 @@ class CalendarViewModel(private val coroutineScope: CoroutineScope) { val currentMonth: Int get() = selectedDate.month.number fun selectDate(date: LocalDate) { - println("CalendarViewModel: selectDate $date (was $selectedDate)") selectedDate = date } fun onDrag(delta: Float) { coroutineScope.launch { val new = (_collapseAnimatable.value + delta).coerceIn(0f, 1f) - println("CalendarViewModel: onDrag delta=$delta, progress=${_collapseAnimatable.value} -> $new") _collapseAnimatable.snapTo(new) } } @@ -63,20 +61,17 @@ class CalendarViewModel(private val coroutineScope: CoroutineScope) { fun onDragEnd() { coroutineScope.launch { val current = _collapseAnimatable.value - println("CalendarViewModel: onDragEnd current=$current, threshold=$COLLAPSE_THRESHOLD") if (current > COLLAPSE_THRESHOLD) { _collapseAnimatable.animateTo( targetValue = 1f, animationSpec = spring(dampingRatio = 0.8f, stiffness = 400f) ) isCollapsed = true - println("CalendarViewModel: collapsed=true") } else { _collapseAnimatable.animateTo( targetValue = 0f, animationSpec = spring(dampingRatio = 0.8f, stiffness = 400f) ) - println("CalendarViewModel: snapped back to 0f") } } } @@ -85,7 +80,6 @@ class CalendarViewModel(private val coroutineScope: CoroutineScope) { fun onExpandDrag(delta: Float) { coroutineScope.launch { val new = (_collapseAnimatable.value + delta).coerceIn(0f, 1f) - println("CalendarViewModel: onExpandDrag delta=$delta, progress=${_collapseAnimatable.value} -> $new") _collapseAnimatable.snapTo(new) } } @@ -94,20 +88,17 @@ class CalendarViewModel(private val coroutineScope: CoroutineScope) { fun onExpandDragEnd() { coroutineScope.launch { val current = _collapseAnimatable.value - println("CalendarViewModel: onExpandDragEnd current=$current, threshold=$COLLAPSE_THRESHOLD") if (current < COLLAPSE_THRESHOLD) { _collapseAnimatable.animateTo( targetValue = 0f, animationSpec = spring(dampingRatio = 0.8f, stiffness = 400f) ) isCollapsed = false - println("CalendarViewModel: expanded=false") } else { _collapseAnimatable.animateTo( targetValue = 1f, animationSpec = spring(dampingRatio = 0.8f, stiffness = 400f) ) - println("CalendarViewModel: snapped back to 1f") } } } diff --git a/shared/src/commonMain/kotlin/plus/rua/project/ui/BottomCard.kt b/shared/src/commonMain/kotlin/plus/rua/project/ui/BottomCard.kt index d570e05..33f51bb 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/BottomCard.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/BottomCard.kt @@ -33,7 +33,6 @@ fun BottomCard( ) { val density = LocalDensity.current val dragRange = with(density) { DRAG_RANGE_DP.dp.toPx() } - println("BottomCard: isCollapsed=${viewModel.isCollapsed}, dragRange=$dragRange, progress=${viewModel.collapseProgress}") Surface( modifier = modifier diff --git a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthPage.kt b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthPage.kt index b51dbbd..efa8df6 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthPage.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthPage.kt @@ -116,7 +116,6 @@ fun CalendarMonthPage( if (weekIndex == 0 && rowHeightPx == 0) { Modifier.onSizeChanged { size -> if (size.height > 0) { - println("CalendarMonthPage: measured rowHeight=${size.height}px, reporting to parent") onRowHeightMeasured?.invoke(size.height) } } 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 123ff32..4500e94 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt @@ -31,8 +31,6 @@ import kotlin.math.abs import kotlin.time.Clock import plus.rua.project.CalendarViewModel -private const val TAG = "CalendarMonthView" - /** * 日历主界面,包含月/周视图切换和折叠动画。 * @@ -61,10 +59,8 @@ fun CalendarMonthView( val pagerState = rememberPagerState(initialPage = START_PAGE, pageCount = { Int.MAX_VALUE }) val p = viewModel.collapseProgress - println("$TAG: collapseProgress=$p, isCollapsed=${viewModel.isCollapsed}") val headerHeightPx = monthHeaderHeightPx + weekdayHeaderHeightPx val rowPaddingPx = with(density) { ROW_PADDING_DP.dp.toPx() }.toInt() - println("$TAG: headerHeightPx=$headerHeightPx (month=$monthHeaderHeightPx, weekday=$weekdayHeaderHeightPx), rowPaddingPx=$rowPaddingPx") val interpolatedWeeks by remember { derivedStateOf { @@ -89,8 +85,6 @@ fun CalendarMonthView( (cellWidth + rowPadding).toInt() } else 0 - println("$TAG: screenWidthPx=$screenWidthPx, screenHeightPx=$screenHeightPx, estimatedRowHeightPx=$estimatedRowHeightPx, measuredRowHeightPx=$rowHeightPx") - val effectiveRowHeightPx = if (rowHeightPx > 0) rowHeightPx else estimatedRowHeightPx // 折叠时网格高度公式(与 CalendarMonthPage 一致): @@ -110,7 +104,6 @@ fun CalendarMonthView( val calendarAreaHeightPx = headerHeightPx + gridHeightPx + rowPaddingPx val cardHeightPx = if (screenHeightPx > 0 && calendarAreaHeightPx > 0) screenHeightPx - calendarAreaHeightPx else 0 - println("$TAG: effectiveRowHeightPx=$effectiveRowHeightPx, effectiveWeeks=$effectiveWeeks, gridHeightPx=$gridHeightPx, calendarAreaHeightPx=$calendarAreaHeightPx, cardHeightPx=$cardHeightPx") // 当 rowHeightPx 已知时,用计算的高度约束 pager;否则让 pager 自由扩展以测量行高 val pagerModifier = if (rowHeightPx > 0 && gridHeightPx > 0) { @@ -146,7 +139,6 @@ fun CalendarMonthView( ) // 完全折叠且无动画时显示 WeekPager,否则显示 CalendarPager(含下拉恢复过程) if (viewModel.isCollapsed && viewModel.collapseProgress >= 1f) { - println("$TAG: Showing WeekPager (isCollapsed=true, progress=${viewModel.collapseProgress})") WeekPager( selectedDate = viewModel.selectedDate, today = today, @@ -158,7 +150,6 @@ fun CalendarMonthView( } ) } else { - println("$TAG: Showing CalendarPager (isCollapsed=${viewModel.isCollapsed}, progress=${viewModel.collapseProgress})") CalendarPager( selectedDate = viewModel.selectedDate, today = today, @@ -181,7 +172,6 @@ fun CalendarMonthView( } if (cardHeightPx > 0) { - println("$TAG: BottomCard height=${with(density) { cardHeightPx.toDp() }}") BottomCard( viewModel = viewModel, modifier = Modifier