Skip to content

Commit 2989237

Browse files
committed
Remote special handling for rotary for SLC
1 parent 822ac2d commit 2989237

File tree

2 files changed

+2
-37
lines changed

2 files changed

+2
-37
lines changed

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ recyclerview = "1.3.2"
4646
# @keep
4747
targetSdk = "34"
4848
version-catalog-update = "0.8.3"
49-
wearComposeFoundation = "1.3.0"
50-
wearComposeMaterial = "1.3.0"
49+
wearComposeFoundation = "1.4.0"
50+
wearComposeMaterial = "1.4.0"
5151
composeUiTooling = "1.3.1"
5252

5353
[libraries]

wear/src/main/java/com/example/wear/snippets/rotary/Rotary.kt

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -58,45 +58,10 @@ import androidx.wear.compose.ui.tooling.preview.WearPreviewDevices
5858
import androidx.wear.compose.ui.tooling.preview.WearPreviewFontScales
5959
import kotlinx.coroutines.launch
6060

61-
@OptIn(ExperimentalWearFoundationApi::class)
6261
@Composable
6362
fun ScrollableScreen() {
6463
// This sample doesn't add a Time Text at the top of the screen.
6564
// If using Time Text, add padding to ensure content does not overlap with Time Text.
66-
// [START android_wear_rotary_input]
67-
val listState = rememberScalingLazyListState()
68-
Scaffold(
69-
positionIndicator = {
70-
PositionIndicator(scalingLazyListState = listState)
71-
}
72-
) {
73-
74-
val focusRequester = rememberActiveFocusRequester()
75-
val coroutineScope = rememberCoroutineScope()
76-
77-
ScalingLazyColumn(
78-
modifier = Modifier
79-
.onRotaryScrollEvent {
80-
coroutineScope.launch {
81-
listState.scrollBy(it.verticalScrollPixels)
82-
listState.animateScrollBy(0f)
83-
}
84-
true
85-
}
86-
.focusRequester(focusRequester)
87-
.focusable()
88-
.fillMaxSize(),
89-
state = listState
90-
) {
91-
// Content goes here
92-
// [START_EXCLUDE]
93-
items(count = 5) {
94-
Chip(onClick = { }, label = { Text("Item #$it") })
95-
}
96-
// [END_EXCLUDE]
97-
}
98-
}
99-
// [END android_wear_rotary_input]
10065
}
10166

10267
@OptIn(ExperimentalComposeUiApi::class)

0 commit comments

Comments
 (0)