# ListViewCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/widget/ListViewCompat.java+class:androidx.core.widget.ListViewCompat) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0) Deprecated in [1.13.0](https://developer.android.com/jetpack/androidx/releases/core#1.13.0)

*** ** * ** ***


```
public final class ListViewCompat
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Use `https://developer.android.com/reference/android/widget/ListView.html` directly.

Helper for accessing features in `https://developer.android.com/reference/android/widget/ListView.html`.

## Summary

| ### Public methods |
|---|---|
| `static boolean` | `@https://developer.android.com/reference/androidx/annotation/ReplaceWith(expression = "listView.canScrollList(direction)") [canScrollList](https://developer.android.com/reference/androidx/core/widget/ListViewCompat#canScrollList(android.widget.ListView,int))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/ListView.html listView, int direction)` **This method is deprecated.** Use `https://developer.android.com/reference/android/widget/AbsListView.html#canScrollList(int)` directly. <br /> |
| `static void` | `@https://developer.android.com/reference/androidx/annotation/ReplaceWith(expression = "listView.scrollListBy(y)") [scrollListBy](https://developer.android.com/reference/androidx/core/widget/ListViewCompat#scrollListBy(android.widget.ListView,int))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/ListView.html listView, int y)` **This method is deprecated.** Use `https://developer.android.com/reference/android/widget/AbsListView.html#scrollListBy(int)` directly. <br /> |

## Public methods

### canScrollList

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0) Deprecated in [1.13.0](https://developer.android.com/jetpack/androidx/releases/core#1.13.0)

```
@ReplaceWith(expression = "listView.canScrollList(direction)")
public static boolean [canScrollList](https://developer.android.com/reference/androidx/core/widget/ListViewCompat#canScrollList(android.widget.ListView,int))(@NonNull ListView listView, int direction)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/android/widget/AbsListView.html#canScrollList(int)` directly.

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/ListView.html listView` | ListView for which to check the state. |
| `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 |
|---|---|
| `https://developer.android.com/reference/androidx/core/widget/ListViewCompat#scrollListBy(android.widget.ListView,int)` |   |

### scrollListBy

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0) Deprecated in [1.13.0](https://developer.android.com/jetpack/androidx/releases/core#1.13.0)

```
@ReplaceWith(expression = "listView.scrollListBy(y)")
public static void [scrollListBy](https://developer.android.com/reference/androidx/core/widget/ListViewCompat#scrollListBy(android.widget.ListView,int))(@NonNull ListView listView, int y)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/android/widget/AbsListView.html#scrollListBy(int)` directly.

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/widget/ListView.html listView` | the list to scroll |
| `int y` | the amount of pixels to scroll by vertically |