DpadScroller

class DpadScroller(calculator: DpadScroller.ScrollDistanceCalculator = DefaultScrollDistanceCalculator())

A helper class that allows scrolling a DpadRecyclerView based on specific scroll distances, ignoring the default alignment behavior.

A typical use case for this class is a terms & conditions page, where a large amount of text is displayed, which the user isn't expected to interact with

Constructors

Link copied to clipboard
constructor(calculator: DpadScroller.ScrollDistanceCalculator = DefaultScrollDistanceCalculator())

Types

Link copied to clipboard

Functions

Link copied to clipboard
fun attach(recyclerView: DpadRecyclerView)

Attaches this DpadScroller to a new DpadRecyclerView to start observing key events. If you no longer need this behavior, call detach

Link copied to clipboard
fun detach()

Stops observing key events to scroll the current attached DpadRecyclerView, if any exists

Link copied to clipboard

Enables or disables smooth scrolling on key events