From 0d4bb64b8c180b12e7dbe4c86966a46a30267a7d Mon Sep 17 00:00:00 2001 From: Ray Yuan Liu Date: Sat, 20 Apr 2024 17:51:13 +0800 Subject: [PATCH] Upgrade dependencies --- gradle/libs.versions.toml | 36 +++++++++++-------- .../wearos/categorylist/CategoryListScreen.kt | 11 +++--- .../gymnote/wearos/workout/WorkoutScreen.kt | 13 +++---- .../wearos/workoutlist/WorkoutListScreen.kt | 11 +++--- 4 files changed, 42 insertions(+), 29 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6b549be..d0fcc5a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,41 +1,47 @@ [versions] agp = "8.2.2" kotlin = "1.9.23" -core-ktx = "1.10.1" -junit = "4.13.2" -androidx-test-ext-junit = "1.1.5" -espresso-core = "3.5.1" +core-ktx = "1.13.0" appcompat = "1.6.1" -play-services-wearable = "18.0.0" -material = "1.9.0" +material = "1.11.0" constraintlayout = "2.1.4" percentlayout = "1.0.0" legacy-support-v4 = "1.0.0" -recyclerview = "1.3.0" -compose-bom = "2024.04.01" -wear-compose = "1.3.1" -lifecycle-runtime-ktx = "2.6.1" +recyclerview = "1.3.2" +lifecycle-runtime-ktx = "2.7.0" activity-compose = "1.9.0" # https://github.com/google/ksp/releases ksp = "1.9.23-1.0.20" -horologist = "0.4.12" + +# compose +compose-bom = "2024.04.01" +wear-compose = "1.3.1" + +# wear +play-services-wearable = "18.1.0" +horologist = "0.6.9" wear-input = "1.2.0-alpha02" +# test +junit = "4.13.2" +androidx-test-ext-junit = "1.1.5" +espresso-core = "3.5.1" + # kotlinx collections-immutable = "0.3.7" datetime = "0.5.0" # koin -koin = "3.4.2" -koin-annotation = "1.2.2" -koin-compose = "3.4.5" +koin = "3.5.6" +koin-annotation = "1.3.1" +koin-compose = "3.5.6" # code check kotlinter = "3.15.0" slack-compose-lint = "1.2.0" # sql delight -sqldelight = "2.0.0-rc01" +sqldelight = "2.0.2" [libraries] core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" } diff --git a/wear/src/main/java/com/rayliu/gymnote/wearos/categorylist/CategoryListScreen.kt b/wear/src/main/java/com/rayliu/gymnote/wearos/categorylist/CategoryListScreen.kt index 90c501a..3c98c36 100644 --- a/wear/src/main/java/com/rayliu/gymnote/wearos/categorylist/CategoryListScreen.kt +++ b/wear/src/main/java/com/rayliu/gymnote/wearos/categorylist/CategoryListScreen.kt @@ -12,8 +12,8 @@ import androidx.compose.ui.unit.dp import androidx.wear.compose.foundation.lazy.AutoCenteringParams import androidx.wear.compose.foundation.lazy.ScalingLazyColumn import androidx.wear.compose.foundation.lazy.ScalingLazyListState -import com.google.android.horologist.annotations.ExperimentalHorologistApi -import com.google.android.horologist.compose.rotaryinput.rotaryWithScroll +import androidx.wear.compose.foundation.rotary.RotaryDefaults.scrollBehavior +import androidx.wear.compose.foundation.rotary.rotary import com.rayliu.commonmain.domain.model.SportCategory import com.rayliu.gymnote.wearos.components.CircularIndeterminateProgressBar import com.rayliu.gymnote.wearos.theme.GymNoteTheme @@ -45,7 +45,6 @@ fun CategoryListScreen( } } -@OptIn(ExperimentalHorologistApi::class) @Composable private fun CategoryList( sportCategories: ImmutableList, @@ -58,7 +57,11 @@ private fun CategoryList( .fillMaxWidth() .padding(bottom = 8.dp) ScalingLazyColumn( - modifier = modifier.rotaryWithScroll(focusRequester, listState).fillMaxSize(), + modifier = + modifier.rotary( + scrollBehavior(scrollableState = listState), + focusRequester = focusRequester + ).fillMaxSize(), autoCentering = AutoCenteringParams(itemIndex = 0), state = listState ) { diff --git a/wear/src/main/java/com/rayliu/gymnote/wearos/workout/WorkoutScreen.kt b/wear/src/main/java/com/rayliu/gymnote/wearos/workout/WorkoutScreen.kt index fc63c03..da2c2e6 100644 --- a/wear/src/main/java/com/rayliu/gymnote/wearos/workout/WorkoutScreen.kt +++ b/wear/src/main/java/com/rayliu/gymnote/wearos/workout/WorkoutScreen.kt @@ -15,9 +15,9 @@ import androidx.compose.ui.unit.dp import androidx.wear.compose.foundation.lazy.AutoCenteringParams import androidx.wear.compose.foundation.lazy.ScalingLazyColumn import androidx.wear.compose.foundation.lazy.ScalingLazyListState +import androidx.wear.compose.foundation.rotary.RotaryDefaults +import androidx.wear.compose.foundation.rotary.rotary import androidx.wear.compose.material.Text -import com.google.android.horologist.annotations.ExperimentalHorologistApi -import com.google.android.horologist.compose.rotaryinput.rotaryWithScroll import com.rayliu.commonmain.domain.model.DistanceTimeRecord import com.rayliu.commonmain.domain.model.Record import com.rayliu.commonmain.domain.model.SportRecordType @@ -37,7 +37,6 @@ import kotlinx.datetime.Clock import kotlinx.datetime.TimeZone import kotlinx.datetime.toLocalDateTime -@OptIn(ExperimentalHorologistApi::class) @Composable fun WorkoutScreen( listState: ScalingLazyListState, @@ -49,9 +48,11 @@ fun WorkoutScreen( modifier: Modifier = Modifier ) { ScalingLazyColumn( - modifier = modifier - .rotaryWithScroll(focusRequester, listState) - .fillMaxSize(), + modifier = + modifier.rotary( + RotaryDefaults.scrollBehavior(scrollableState = listState), + focusRequester = focusRequester + ).fillMaxSize(), autoCentering = AutoCenteringParams(itemIndex = 0), state = listState, ) { diff --git a/wear/src/main/java/com/rayliu/gymnote/wearos/workoutlist/WorkoutListScreen.kt b/wear/src/main/java/com/rayliu/gymnote/wearos/workoutlist/WorkoutListScreen.kt index 7c7df67..2a98028 100644 --- a/wear/src/main/java/com/rayliu/gymnote/wearos/workoutlist/WorkoutListScreen.kt +++ b/wear/src/main/java/com/rayliu/gymnote/wearos/workoutlist/WorkoutListScreen.kt @@ -14,8 +14,8 @@ import androidx.compose.ui.unit.dp import androidx.wear.compose.foundation.lazy.AutoCenteringParams import androidx.wear.compose.foundation.lazy.ScalingLazyColumn import androidx.wear.compose.foundation.lazy.ScalingLazyListState -import com.google.android.horologist.annotations.ExperimentalHorologistApi -import com.google.android.horologist.compose.rotaryinput.rotaryWithScroll +import androidx.wear.compose.foundation.rotary.RotaryDefaults.scrollBehavior +import androidx.wear.compose.foundation.rotary.rotary import com.rayliu.commonmain.domain.model.SportRecordType import com.rayliu.commonmain.domain.model.WorkoutInfo import com.rayliu.gymnote.wearos.theme.GymNoteTheme @@ -50,7 +50,6 @@ fun WorkoutListScreen( } } -@OptIn(ExperimentalHorologistApi::class) @Composable private fun WorkoutInfoList( workoutInfos: ImmutableList, @@ -63,7 +62,11 @@ private fun WorkoutInfoList( .fillMaxWidth() .padding(bottom = 8.dp) ScalingLazyColumn( - modifier = modifier.rotaryWithScroll(focusRequester, listState).fillMaxSize(), + modifier = + modifier.rotary( + scrollBehavior(scrollableState = listState), + focusRequester = focusRequester + ).fillMaxSize(), autoCentering = AutoCenteringParams(itemIndex = 0), state = listState ) {