Stay organized with collections Save and categorize content based on your preferences.

ListViewCompat

public final class ListViewCompat


Helper for accessing features in ListView

Summary

Public methods

static boolean
canScrollList(@NonNull ListView listView, int direction)

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

static void
scrollListBy(@NonNull ListView listView, int y)

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

Public methods

canScrollList

public static boolean canScrollList(@NonNull ListView listView, int direction)

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

Parameters
int direction

Negative to check scrolling up, positive to check scrolling down.

Returns
boolean

true if the list can be scrolled in the specified direction, false otherwise.

See also
scrollListBy

scrollListBy

public static void scrollListBy(@NonNull ListView listView, int y)

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

Parameters
@NonNull ListView listView

the list to scroll

int y

the amount of pixels to scroll by vertically