diff --git a/shared/src/androidMain/kotlin/plus/rua/project/Platform.android.kt b/shared/src/androidMain/kotlin/plus/rua/project/Platform.android.kt index f6320fd..6b4d872 100644 --- a/shared/src/androidMain/kotlin/plus/rua/project/Platform.android.kt +++ b/shared/src/androidMain/kotlin/plus/rua/project/Platform.android.kt @@ -4,7 +4,6 @@ import android.os.Build import androidx.compose.runtime.Composable import androidx.compose.runtime.rememberCoroutineScope import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.launch class AndroidPlatform : Platform { override val name: String = "Android ${Build.VERSION.SDK_INT}" @@ -24,7 +23,7 @@ actual fun PredictiveBackHandler( onCancel: () -> Unit ) { if (Build.VERSION.SDK_INT >= 34) { - val scope = rememberCoroutineScope() + rememberCoroutineScope() androidx.activity.compose.PredictiveBackHandler(enabled) { progress -> try { progress.collect { backEvent -> diff --git a/shared/src/commonMain/kotlin/plus/rua/project/App.kt b/shared/src/commonMain/kotlin/plus/rua/project/App.kt index 68a8521..317e723 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/App.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/App.kt @@ -57,11 +57,17 @@ fun App() { if (targetState.ordinal > initialState.ordinal) { // 正向导航:新页面从右侧滑入覆盖,旧页面略微左移+淡出 (slideInHorizontally { it } + fadeIn()) togetherWith - (slideOutHorizontally { -it / 4 } + fadeOut()) + (slideOutHorizontally { -it / 4 } + fadeOut()) } else { // 返回导航:新页面从左侧滑入,旧页面向右侧滑出 - (slideInHorizontally(animationSpec = tween(250)) { -it } + fadeIn(animationSpec = tween(250))) togetherWith - (slideOutHorizontally(animationSpec = tween(250)) { it } + fadeOut(animationSpec = tween(250))) + (slideInHorizontally(animationSpec = tween(250)) { -it } + fadeIn( + animationSpec = tween( + 250 + ) + )) togetherWith + (slideOutHorizontally(animationSpec = tween(250)) { it } + fadeOut( + animationSpec = tween(250) + )) } }, modifier = Modifier.fillMaxSize() @@ -71,6 +77,7 @@ fun App() { modifier = Modifier, onNavigateToAbout = { currentScreen = Screen.About } ) + Screen.About -> { PredictiveBackHandler( enabled = backProgress == 0f, @@ -88,6 +95,7 @@ fun App() { } ) } + Screen.Licenses -> { PredictiveBackHandler( enabled = backProgress == 0f, 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 aa2b381..b2395ca 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthView.kt @@ -89,7 +89,7 @@ fun CalendarMonthView( @Suppress("DEPRECATION") // monthNumber 无替代 API,kotlinx-datetime 尚未提供新接口 val currentMonth by remember { derivedStateOf { viewModel.selectedDate.month.number } } - val density = LocalDensity.current + LocalDensity.current var rowHeightPx by remember { mutableIntStateOf(0) } var screenWidthPx by remember { mutableIntStateOf(0) } @@ -448,6 +448,7 @@ private fun CalendarPagerArea( weekMonday } } + else -> weekMonday } viewModel.selectDate(date)