Skip to content

Commit

Permalink
Merge pull request #1190 from kul3r4/cleanup
Browse files Browse the repository at this point in the history
Clean up and update rotary
  • Loading branch information
kul3r4 authored Sep 18, 2024
2 parents 1171d46 + 594f26c commit e77e367
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion ComposeStarter/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ dependencies {
implementation(libs.androidx.material.icons.core)

// Horologist for correct Compose layout
implementation(libs.horologist.composables)
implementation(libs.horologist.compose.layout)
implementation(libs.horologist.compose.material)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.wear.compose.foundation.ExperimentalWearFoundationApi
import androidx.wear.compose.foundation.rememberActiveFocusRequester
import androidx.wear.compose.foundation.rotary.RotaryScrollableDefaults.behavior
import androidx.wear.compose.foundation.rotary.rotaryScrollable
import androidx.wear.compose.material.MaterialTheme
import androidx.wear.compose.material.Text
import androidx.wear.compose.material.TitleCard
Expand All @@ -61,7 +64,6 @@ import com.google.android.horologist.compose.material.Button
import com.google.android.horologist.compose.material.Chip
import com.google.android.horologist.compose.material.ListHeaderDefaults.firstItemPadding
import com.google.android.horologist.compose.material.ResponsiveListHeader
import com.google.android.horologist.compose.rotaryinput.rotaryWithScroll

/**
* Simple "Hello, World" app meant as a starting point for a new project using Compose for Wear OS.
Expand Down Expand Up @@ -122,7 +124,10 @@ fun GreetingScreen(greetingName: String, onShowList: () -> Unit) {
modifier = Modifier
.fillMaxSize()
.verticalScroll(scrollState)
.rotaryWithScroll(scrollState)
.rotaryScrollable(
behavior(scrollableState = scrollState),
focusRequester = rememberActiveFocusRequester()
)
.padding(padding),
verticalArrangement = Arrangement.Center
) {
Expand Down
2 changes: 1 addition & 1 deletion ComposeStarter/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ androidx-compose-bom = "2024.09.01"
androidx-wear-compose = "1.4.0"
compose-compiler = "1.5.15"
compose-ui-tooling = "1.4.0"
horologist = "0.5.28"
horologist = "0.6.19"
ktlint = "0.50.0"
org-jetbrains-kotlin = "1.9.25"
robolectric = "4.13"
Expand Down

0 comments on commit e77e367

Please sign in to comment.