ListViewAutoScrollHelper
public class ListViewAutoScrollHelper extends AutoScrollHelper
| java.lang.Object | ||
| ↳ | androidx.core.widget.AutoScrollHelper | |
| ↳ | androidx.core.widget.ListViewAutoScrollHelper |
An implementation of AutoScrollHelper that knows how to scroll through a ListView.
Summary
Public constructors |
|---|
ListViewAutoScrollHelper(@NonNull ListView target) |
Public methods |
|
|---|---|
boolean |
canTargetScrollHorizontally(int direction)Override this method to return whether the target view can be scrolled horizontally in a certain direction. |
boolean |
canTargetScrollVertically(int direction)Override this method to return whether the target view can be scrolled vertically in a certain direction. |
void |
scrollTargetBy(int deltaX, int deltaY)Override this method to scroll the target view by the specified number of pixels. |
Inherited Constants |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Inherited methods |
||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||
|
Public constructors
Public methods
canTargetScrollHorizontally
public boolean canTargetScrollHorizontally(int direction)
Override this method to return whether the target view can be scrolled horizontally in a certain direction.
| Parameters | |
|---|---|
int direction |
Negative to check scrolling left, positive to check scrolling right. |
| Returns | |
|---|---|
boolean |
true if the target view is able to horizontally scroll in the specified direction. |
canTargetScrollVertically
public boolean canTargetScrollVertically(int direction)
Override this method to return whether the target view can be scrolled vertically in a certain direction.
| Parameters | |
|---|---|
int direction |
Negative to check scrolling up, positive to check scrolling down. |
| Returns | |
|---|---|
boolean |
true if the target view is able to vertically scroll in the specified direction. |
scrollTargetBy
public void scrollTargetBy(int deltaX, int deltaY)
Override this method to scroll the target view by the specified number of pixels.
| Parameters | |
|---|---|
int deltaX |
The number of pixels to scroll by horizontally. |
int deltaY |
The number of pixels to scroll by vertically. |