public void scrollTo (int x, int y)
Since: API Level 1
Set the scrolled position of your view. This will cause a call to onScrollChanged(int, int, int, int) and the view will be invalidated.
Parameters
x the x position to scroll to
y the y position to scroll to
void scrollBy (int x, int y)Since: API Level 1
Move the scrolled position of your view. This will cause a call to onScrollChanged(int, int, int, int) and the view will be invalidated.
Parameters
x the amount of pixels to scroll by horizontally
y the amount of pixels to scroll by vertically
protected void onScrollChanged (int l, int t, int oldl, int oldt)
Since: API Level 1
This is called in response to an internal scroll in this view (i.e., the view scrolled its own contents). This is typically as a result of scrollBy(int, int) or scrollTo(int, int) having been called.
Parameters
l Current horizontal scroll origin.
t Current vertical scroll origin.
oldl Previous horizontal scroll origin.
oldt Previous vertical scroll origin.
public void setScrollX (int value)
Since: API Level 14
Set the horizontal scrolled position of your view. This will cause a call to onScrollChanged(int, int, int, int) and the view will be invalidated.
Parameters
value the x position to scroll to
public void setScrollY (int value)
Since: API Level 14
Set the vertical scrolled position of your view. This will cause a call to onScrollChanged(int, int, int, int) and the view will be invalidated.
Parameters
value the y position to scroll to
public final int getScrollX ()
Since: API Level 1
Return the scrolled left position of this view. This is the left edge of the displayed part of your view. You do not need to draw any pixels farther left, since those are outside of the frame of your view on screen.
Returns
The left edge of the displayed part of your view, in pixels.
public final int getScrollY ()
Since: API Level 1
Return the scrolled top position of this view. This is the top edge of the displayed part of your view. You do not need to draw any pixels above it, since those are outside of the frame of your view on screen.
Returns
The top edge of the displayed part of your view, in pixels.