Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

ListViewCompat

class ListViewCompat
kotlin.Any
   ↳ androidx.core.widget.ListViewCompat

Helper for accessing features in ListView

Summary

Public methods

static Boolean
canScrollList(@NonNull listView: ListView, direction: Int)

Check if the items in the list can be scrolled in a certain direction.

static Unit
scrollListBy(@NonNull listView: ListView, y: Int)

Scrolls the list items within the view by a specified number of pixels.

Public methods

canScrollList

static fun canScrollList(@NonNull listView: ListView, direction: Int): Boolean

Check if the items in the list can be scrolled in a certain direction.

Parameters
direction ListView: Negative to check scrolling up, positive to check scrolling down.
Return
Boolean: true if the list can be scrolled in the specified direction, false otherwise.

scrollListBy

static fun scrollListBy(@NonNull listView: ListView, y: Int): Unit

Scrolls the list items within the view by a specified number of pixels.

Parameters
listView ListView: the list to scroll
y ListView: the amount of pixels to scroll by vertically