Android 12 Developer Preview is here! Try it out, and give us your feedback!

ItemList.OnItemVisibilityChangedListener

public static interface ItemList.OnItemVisibilityChangedListener

androidx.car.app.model.ItemList.OnItemVisibilityChangedListener


A listener for handling item visibility changes.

Summary

Public methods

abstract void onItemVisibilityChanged(int startIndex, int endIndex)

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

Public methods

onItemVisibilityChanged

public abstract void onItemVisibilityChanged (int startIndex, 
                int endIndex)

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. If no items are visible, the indices will be set to -1.

Parameters
startIndex int: the index of the first item that is visible

endIndex int: the index of the first item that is not visible after the visible range