Skip to content

Commit e7dfd8a

Browse files
authored
Merge pull request #332 from android/wear
Adds code for showing Scaffold and Position Indicator
2 parents 14f817b + a5c2337 commit e7dfd8a

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

+21
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)