Skip to content

Commit a5c2337

Browse files
committed
Adds code for showing Scaffold and Position Indicator
1 parent 23712af commit a5c2337

File tree

1 file changed

+21
-0
lines changed
  • wear/src/main/java/com/example/wear/snippets/rotary

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,20 @@ fun SnapScrollableScreen() {
242242
// [END android_wear_rotary_input_snap_fling]
243243
}
244244

245+
@Composable
246+
fun PositionScrollIndicator(){
247+
// [START android_wear_rotary_position_indicator]
248+
val listState = rememberScalingLazyListState()
249+
Scaffold(
250+
positionIndicator = {
251+
PositionIndicator(scalingLazyListState = listState)
252+
}
253+
) {
254+
// ...
255+
}
256+
// [END android_wear_rotary_position_indicator]
257+
}
258+
245259
@WearPreviewDevices
246260
@WearPreviewFontScales
247261
@Composable
@@ -262,3 +276,10 @@ fun ScrollableScreenPreview() {
262276
fun SnapScrollableScreenPreview() {
263277
SnapScrollableScreen()
264278
}
279+
280+
@WearPreviewDevices
281+
@WearPreviewFontScales
282+
@Composable
283+
fun PositionScrollIndicatorPreview() {
284+
PositionScrollIndicator()
285+
}

0 commit comments

Comments
 (0)