Skip to content

Most visited

Recently visited

navigation
added in version 22.1.0
belongs to Maven artifact com.android.support:support-core-ui:27.0.0

ListViewAutoScrollHelper

public class ListViewAutoScrollHelper
extends AutoScrollHelper

java.lang.Object
   ↳ android.support.v4.widget.AutoScrollHelper
     ↳ android.support.v4.widget.ListViewAutoScrollHelper


An implementation of AutoScrollHelper that knows how to scroll through a ListView.

Summary

Inherited constants

From class android.support.v4.widget.AutoScrollHelper

Public constructors

ListViewAutoScrollHelper(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 methods

From class android.support.v4.widget.AutoScrollHelper
From class java.lang.Object
From interface android.view.View.OnTouchListener

Public constructors

ListViewAutoScrollHelper

added in version 22.1.0
ListViewAutoScrollHelper (ListView target)

Parameters
target ListView

Public methods

canTargetScrollHorizontally

added in version 22.1.0
boolean canTargetScrollHorizontally (int direction)

Override this method to return whether the target view can be scrolled horizontally in a certain direction.

Parameters
direction int: 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

added in version 22.1.0
boolean canTargetScrollVertically (int direction)

Override this method to return whether the target view can be scrolled vertically in a certain direction.

Parameters
direction int: 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

added in version 22.1.0
void scrollTargetBy (int deltaX, 
                int deltaY)

Override this method to scroll the target view by the specified number of pixels.

Parameters
deltaX int: The number of pixels to scroll by horizontally.

deltaY int: The number of pixels to scroll by vertically.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)