# ScrollInfoProvider

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/ScrollInfoProvider.kt+class:androidx.wear.compose.foundation.ScrollInfoProvider) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)


```
interface ScrollInfoProvider
```

<br />

*** ** * ** ***

An interface for providing scroll information for different scrollable containers, such as lists. Used for scrolling away, showing, hiding or scaling screen elements based on scrollable state.

`https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ScrollInfoProvider` can be used to create a ScrollAway modifier, typically applied to an object that appears at the top of the screen to scroll it away vertically when a list is scrolled upwards. The scrolled offset is typically calculated with reference to the position of an anchor e.g. the top item.

## Summary

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ScrollInfoProvider#anchorItemOffset()` The amount that the anchor item has been scrolled upwards in the y direction (in Pixels), relative to the initial position of the scrolling container (so \>= zero). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ScrollInfoProvider#isScrollAwayValid()` Whether it is valid to scroll away the anchor item with the current configuration, For example, if the selected anchor item does not exist, it is not valid to scroll away. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ScrollInfoProvider#isScrollInProgress()` Whether the list is currently scrolling (which can be used to show/hide a scroll indicator or time text during the scroll operation). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ScrollInfoProvider#isScrollable()` Whether the container is currently scrollable. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ScrollInfoProvider#lastItemOffset()` The amount of space between the last item (which may not be visible) and the bottom edge of the viewport. |

## Public properties

### anchorItemOffset

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

```
val anchorItemOffset: Float
```

The amount that the anchor item has been scrolled upwards in the y direction (in Pixels), relative to the initial position of the scrolling container (so \>= zero). In the event that the anchor item is no longer visible on the screen and its offset cannot be calculated, the returned offset is Float.NaN.

### isScrollAwayValid

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

```
val isScrollAwayValid: Boolean
```

Whether it is valid to scroll away the anchor item with the current configuration, For example, if the selected anchor item does not exist, it is not valid to scroll away.

### isScrollInProgress

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

```
val isScrollInProgress: Boolean
```

Whether the list is currently scrolling (which can be used to show/hide a scroll indicator or time text during the scroll operation).

### isScrollable

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

```
val isScrollable: Boolean
```

Whether the container is currently scrollable.

### lastItemOffset

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

```
val lastItemOffset: Float
```

The amount of space between the last item (which may not be visible) and the bottom edge of the viewport. This is always greater or equal to 0, if there is no (or negative) room (including the case in which the last item is not on screen), 0 should be returned.