# RotarySnapLayoutInfoProvider

# RotarySnapLayoutInfoProvider

Artifact:[androidx.wear.compose:compose-foundation](https://developer.android.com/jetpack/androidx/releases/wear-compose)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/compose/foundation/rotary/RotaryScrollable.kt+class:androidx.wear.compose.foundation.rotary.RotarySnapLayoutInfoProvider)  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.4.0)

<br />

```
interface RotarySnapLayoutInfoProvider
```

<br />

*** ** * ** ***

A provider which connects scrollableState to a rotary input for snapping scroll actions.

This interface defines the essential properties and methods required for a scrollable to be controlled by rotary input and perform a snap action.

## Summary

|                              ### Public properties                              |
|---------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [averageItemSize](https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/rotary/RotarySnapLayoutInfoProvider#averageItemSize()) The average size in pixels of an item within the scrollable.                        |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)     | [currentItemIndex](https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/rotary/RotarySnapLayoutInfoProvider#currentItemIndex()) The index of the item that is closest to the center.                              |
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [currentItemOffset](https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/rotary/RotarySnapLayoutInfoProvider#currentItemOffset()) The offset in pixels of the currently centered item from its centered position. |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)     | [totalItemCount](https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/rotary/RotarySnapLayoutInfoProvider#totalItemCount()) The total number of items within the scrollable                                       |

## Public properties

### averageItemSize

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.4.0)  

```
val averageItemSize: Float
```

The average size in pixels of an item within the scrollable. This is used to estimate scrolling distances for snapping when responding to rotary input.  

### currentItemIndex

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.4.0)  

```
val currentItemIndex: Int
```

The index of the item that is closest to the center.  

### currentItemOffset

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.4.0)  

```
val currentItemOffset: Float
```

The offset in pixels of the currently centered item from its centered position. This value can be positive or negative.  

### totalItemCount

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.4.0)  

```
val totalItemCount: Int
```

The total number of items within the scrollable