public
class
ListViewAutoScrollHelper
extends AutoScrollHelper
An implementation of AutoScrollHelper
that knows how to scroll
through a ListView
.
Summary
Inherited constants |
From class
androidx.core.widget.AutoScrollHelper
int |
EDGE_TYPE_INSIDE
Edge type that specifies an activation area starting at the view bounds
and extending inward.
|
int |
EDGE_TYPE_INSIDE_EXTEND
Edge type that specifies an activation area starting at the view bounds
and extending inward.
|
int |
EDGE_TYPE_OUTSIDE
Edge type that specifies an activation area starting at the view bounds
and extending outward.
|
float |
NO_MAX
Constant passed to setMaximumEdges(float, float) , setMaximumVelocity(float, float) ,
or setMinimumVelocity(float, float) .
|
float |
NO_MIN
Constant passed to setMaximumEdges(float, float) , or
setMaximumVelocity(float, float) , or setMinimumVelocity(float, float) .
|
float |
RELATIVE_UNSPECIFIED
Constant passed to setRelativeEdges(float, float) or
setRelativeVelocity(float, float) .
|
|
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
androidx.core.widget.AutoScrollHelper
abstract
boolean
|
canTargetScrollHorizontally(int direction)
Override this method to return whether the target view can be scrolled
horizontally in a certain direction.
|
abstract
boolean
|
canTargetScrollVertically(int direction)
Override this method to return whether the target view can be scrolled
vertically in a certain direction.
|
boolean
|
isEnabled()
|
boolean
|
isExclusive()
Indicates whether the scroll helper handles touch events exclusively
during scrolling.
|
boolean
|
onTouch(View v, MotionEvent event)
Handles touch events by activating automatic scrolling, adjusting scroll
velocity, or stopping.
|
abstract
void
|
scrollTargetBy(int deltaX, int deltaY)
Override this method to scroll the target view by the specified number of
pixels.
|
AutoScrollHelper
|
setActivationDelay(int delayMillis)
Sets the delay after entering an activation edge before activation of
auto-scrolling.
|
AutoScrollHelper
|
setEdgeType(int type)
Sets the activation edge type, one of:
EDGE_TYPE_INSIDE for edges that respond to touches inside
the bounds of the host view.
|
AutoScrollHelper
|
setEnabled(boolean enabled)
Sets whether the scroll helper is enabled and should respond to touch
events.
|
AutoScrollHelper
|
setExclusive(boolean exclusive)
Enables or disables exclusive handling of touch events during scrolling.
|
AutoScrollHelper
|
setMaximumEdges(float horizontalMax, float verticalMax)
Sets the absolute maximum edge size.
|
AutoScrollHelper
|
setMaximumVelocity(float horizontalMax, float verticalMax)
Sets the absolute maximum scrolling velocity.
|
AutoScrollHelper
|
setMinimumVelocity(float horizontalMin, float verticalMin)
Sets the absolute minimum scrolling velocity.
|
AutoScrollHelper
|
setRampDownDuration(int durationMillis)
Sets the amount of time after de-activation of auto-scrolling that is
takes to slow to a stop.
|
AutoScrollHelper
|
setRampUpDuration(int durationMillis)
Sets the amount of time after activation of auto-scrolling that is takes
to reach target velocity for the current touch position.
|
AutoScrollHelper
|
setRelativeEdges(float horizontal, float vertical)
Sets the activation edge size relative to the host view's dimensions.
|
AutoScrollHelper
|
setRelativeVelocity(float horizontal, float vertical)
Sets the target scrolling velocity relative to the host view's
dimensions.
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
|
Public constructors
public ListViewAutoScrollHelper (ListView target)
Parameters |
target |
ListView |
Public methods
public 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.
|
public 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.
|
public 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.
|