# OnItemVisibilityChangedDelegate

# OnItemVisibilityChangedDelegate

Artifact:[androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app)  
[View Source](https://cs.android.com/search?q=file:androidx/car/app/model/OnItemVisibilityChangedDelegate.java+class:androidx.car.app.model.OnItemVisibilityChangedDelegate)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/model/OnItemVisibilityChangedDelegate "View this page in Java")

<br />

```
@CarProtocol
interface OnItemVisibilityChangedDelegate
```

<br />

*** ** * ** ***

A host-side delegate for sending[androidx.car.app.model.ItemList.OnItemVisibilityChangedListener](https://developer.android.com/reference/kotlin/androidx/car/app/model/ItemList.OnItemVisibilityChangedListener)events to the car app.

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [sendItemVisibilityChanged](https://developer.android.com/reference/kotlin/androidx/car/app/model/OnItemVisibilityChangedDelegate#sendItemVisibilityChanged(int,int,androidx.car.app.OnDoneCallback))`(` ` startIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` endIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` callback: `[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback) `)` Notifies that the items in the list within the specified indices have become visible. |

## Public functions

### sendItemVisibilityChanged

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)  

```
fun sendItemVisibilityChanged(
    startIndex: Int,
    endIndex: Int,
    callback: OnDoneCallback
): Unit
```

Notifies that the items in the list within the specified indices have become visible.

The start index is inclusive, and the end index is exclusive. For example, if only the first item in a list is visible, the start and end indices would be 0 and 1, respectively.  

|                                                  Parameters                                                  |
|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `startIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                    | the index (inclusive) of the first visible element                                                                                                        |
| `endIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                      | the index (exclusive) of the last visible element                                                                                                         |
| `callback: `[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback) | the[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback)to trigger when the client finishes handling the event |