diff --git a/core/src/main/kotlin/plus/rua/project/ui/CalendarMonthView.kt b/core/src/main/kotlin/plus/rua/project/ui/CalendarMonthView.kt index b259462..650f28f 100644 --- a/core/src/main/kotlin/plus/rua/project/ui/CalendarMonthView.kt +++ b/core/src/main/kotlin/plus/rua/project/ui/CalendarMonthView.kt @@ -520,48 +520,20 @@ private fun CalendarPagerArea( modifier } - if (isCollapsed && collapseProgress >= 1f) { - WeekPager( - selectedDate = selectedDate, - today = today, - onDateClick = onDateClick, - onWeekChanged = { weekMonday -> - val weekSunday = weekMonday.plus(DatePeriod(days = 6)) - val date = when { - today in weekMonday..weekSunday -> today - weekMonday.month != weekSunday.month -> { - if (weekMonday < selectedDate) { - @Suppress("DEPRECATION") // monthNumber 无替代 API - LocalDate(weekSunday.year, weekSunday.month.number, 1) - } else { - weekMonday - } - } - - else -> weekMonday - } - onDateClick(date) - }, - shiftKindAt = shiftKindAt, - showLegalHoliday = showLegalHoliday, - modifier = pagerModifier - ) - } else { - CalendarPager( - selectedDate = selectedDate, - today = today, - onDateClick = onDateClick, - onMonthChanged = onMonthChanged, - collapseProgress = collapseProgress, - rowHeightPx = rowHeightPx, - effectiveWeeks = effectiveWeeks, - shiftKindAt = shiftKindAt, - showLegalHoliday = showLegalHoliday, - onRowHeightMeasured = onRowHeightMeasured, - pagerState = pagerState, - modifier = pagerModifier - ) - } + CalendarPager( + selectedDate = selectedDate, + today = today, + onDateClick = onDateClick, + onMonthChanged = onMonthChanged, + collapseProgress = collapseProgress, + rowHeightPx = rowHeightPx, + effectiveWeeks = effectiveWeeks, + shiftKindAt = shiftKindAt, + showLegalHoliday = showLegalHoliday, + onRowHeightMeasured = onRowHeightMeasured, + pagerState = pagerState, + modifier = pagerModifier + ) } @Composable diff --git a/core/src/main/kotlin/plus/rua/project/ui/WeekPager.kt b/core/src/main/kotlin/plus/rua/project/ui/WeekPager.kt index 602e402..446f5cf 100644 --- a/core/src/main/kotlin/plus/rua/project/ui/WeekPager.kt +++ b/core/src/main/kotlin/plus/rua/project/ui/WeekPager.kt @@ -1,8 +1,10 @@ package plus.rua.project.ui +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.material3.MaterialTheme import androidx.compose.foundation.pager.HorizontalPager import androidx.compose.foundation.pager.PagerDefaults import androidx.compose.foundation.pager.rememberPagerState @@ -89,6 +91,7 @@ fun WeekPager( modifier = Modifier .alpha(alpha) .fillMaxWidth() + .background(MaterialTheme.colorScheme.surface) .padding(vertical = ROW_PADDING_DP.dp) ) { (0 until 7).forEach { dayOffset ->