# ListViewCompat

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/widget/ListViewCompat "View this page in Java")

<br />

```
class ListViewCompat
```

<br />

*** ** * ** ***

| **This class is deprecated.**   
|
| Use[ListView](https://developer.android.com/reference/android/widget/ListView.html)directly.

Helper for accessing features in[ListView](https://developer.android.com/reference/android/widget/ListView.html).

## Summary

|                                       ### Public functions                                        |
|---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | `@`[ReplaceWith](https://developer.android.com/reference/kotlin/androidx/annotation/ReplaceWith)`(expression = "listView.canScrollList(direction)")` ~~[canScrollList](https://developer.android.com/reference/kotlin/androidx/core/widget/ListViewCompat#canScrollList(android.widget.ListView,int))~~`(listView: `[ListView](https://developer.android.com/reference/android/widget/ListView.html)`, direction: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` **This function is deprecated.** Use[canScrollList](https://developer.android.com/reference/android/widget/AbsListView.html#canScrollList(int))directly. <br /> |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | `@`[ReplaceWith](https://developer.android.com/reference/kotlin/androidx/annotation/ReplaceWith)`(expression = "listView.scrollListBy(y)")` ~~[scrollListBy](https://developer.android.com/reference/kotlin/androidx/core/widget/ListViewCompat#scrollListBy(android.widget.ListView,int))~~`(listView: `[ListView](https://developer.android.com/reference/android/widget/ListView.html)`, y: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` **This function is deprecated.** Use[scrollListBy](https://developer.android.com/reference/android/widget/AbsListView.html#scrollListBy(int))directly. <br />                      |

## Public functions

### 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)")
java-static fun [canScrollList](https://developer.android.com/reference/kotlin/androidx/core/widget/ListViewCompat#canScrollList(android.widget.ListView,int))(listView: ListView, direction: Int): Boolean
```
| **This function is deprecated.**   
|
| Use[canScrollList](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                                          |
|----------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `listView: `[ListView](https://developer.android.com/reference/android/widget/ListView.html) | ListView for which to check the state.                            |
| `direction: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)     | Negative to check scrolling up, positive to check scrolling down. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the list can be scrolled in the specified direction, false otherwise. |

|                                                                   See also                                                                   |
|----------------------------------------------------------------------------------------------------------------------------------------------|---|
| [scrollListBy](https://developer.android.com/reference/kotlin/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)")
java-static fun [scrollListBy](https://developer.android.com/reference/kotlin/androidx/core/widget/ListViewCompat#scrollListBy(android.widget.ListView,int))(listView: ListView, y: Int): Unit
```
| **This function is deprecated.**   
|
| Use[scrollListBy](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                                          |
|----------------------------------------------------------------------------------------------|----------------------------------------------|
| `listView: `[ListView](https://developer.android.com/reference/android/widget/ListView.html) | the list to scroll                           |
| `y: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)             | the amount of pixels to scroll by vertically |