From bb9d4e889931de7a027284464e2dad1c74a41595 Mon Sep 17 00:00:00 2001 From: Kizito Nwose Date: Fri, 5 Jul 2024 16:56:34 +0200 Subject: [PATCH] Bump compose version. --- .../java/com/kizitonwose/calendar/buildsrc/Build.kt | 2 +- .../kizitonwose/calendar/compose/CalendarDefaults.kt | 10 +++------- gradle/libs.versions.toml | 4 ++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt b/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt index 817a5079..e72984f0 100644 --- a/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt +++ b/buildSrc/src/main/java/com/kizitonwose/calendar/buildsrc/Build.kt @@ -12,7 +12,7 @@ object Config { } object Versions { - val core = "2.6.0-SNAPSHOT" + val core = "2.6.0-alpha01" val multiplatfrom = "2.6.0-alpha01" } diff --git a/compose-multiplatform/library/src/commonMain/kotlin/com/kizitonwose/calendar/compose/CalendarDefaults.kt b/compose-multiplatform/library/src/commonMain/kotlin/com/kizitonwose/calendar/compose/CalendarDefaults.kt index 3856d891..5bb39f4e 100644 --- a/compose-multiplatform/library/src/commonMain/kotlin/com/kizitonwose/calendar/compose/CalendarDefaults.kt +++ b/compose-multiplatform/library/src/commonMain/kotlin/com/kizitonwose/calendar/compose/CalendarDefaults.kt @@ -4,7 +4,7 @@ import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.gestures.FlingBehavior import androidx.compose.foundation.gestures.ScrollableDefaults import androidx.compose.foundation.gestures.snapping.SnapLayoutInfoProvider -import androidx.compose.foundation.gestures.snapping.SnapPositionInLayout +import androidx.compose.foundation.gestures.snapping.SnapPosition import androidx.compose.foundation.gestures.snapping.rememberSnapFlingBehavior import androidx.compose.foundation.lazy.LazyListState import androidx.compose.runtime.Composable @@ -22,7 +22,7 @@ internal object CalendarDefaults { @Composable private fun pagedFlingBehavior(state: LazyListState): FlingBehavior { val snappingLayout = remember(state) { - val provider = SnapLayoutInfoProvider(state, CalendarSnapPositionInLayout()) + val provider = SnapLayoutInfoProvider(state, SnapPosition.Start) CalendarSnapLayoutInfoProvider(provider) } return rememberSnapFlingBehavior(snappingLayout) @@ -46,9 +46,5 @@ private fun CalendarSnapLayoutInfoProvider( * In compose 1.3, the default was single page snapping (zero), but this changed * in compose 1.4 to decayed page snapping which is not great for calendar usage. */ - override fun calculateApproachOffset(initialVelocity: Float): Float = 0f + override fun calculateApproachOffset(velocity: Float, decayOffset: Float): Float = 0f } - -@OptIn(ExperimentalFoundationApi::class) -@Suppress("FunctionName") -private fun CalendarSnapPositionInLayout() = SnapPositionInLayout { _, _, _, _, _ -> 0 } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2569460f..1ca08a8b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -34,7 +34,7 @@ compose-navigation = { module = "androidx.navigation:navigation-compose", versio compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" } compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose" } -jetbrains-compose-navigation = { module = "org.jetbrains.androidx.navigation:navigation-compose", version = "2.7.0-alpha07" } +jetbrains-compose-navigation = { module = "org.jetbrains.androidx.navigation:navigation-compose", version = "2.8.0-alpha02" } [plugins] androidApplication = { id = "com.android.application", version.ref = "agp" } @@ -48,4 +48,4 @@ versionCheck = { id = "com.github.ben-manes.versions", version = "0.51.0" } # KMM kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } -jetbrainsCompose = { id = "org.jetbrains.compose", version = "1.6.10" } +jetbrainsCompose = { id = "org.jetbrains.compose", version = "1.7.0-alpha01" }