TtScrollBar
A RecyclerView's scroll bar to control and visualize scrolling status.
Besides the basic scroll bar functionalities, this control also provides additional features:
A scroll bar indicator - an extra view attached to this control's parent view to present extra information based on the scrolling position.
Scroll by page - scrolls ttTargetView by page while the up or down button is pressed.
Scroll to top - scrolls ttTargetView to the top page while the up button is pressed.
All theme attributes used by this control are declared in com.tomtom.tools.android.core.theme
. To use this control, it is mandatory to define these attribute values.
Note: There are few limitations of the current implementation.
ttTargetView has to be a RecyclerView and the RecyclerView.LayoutManager can only be a vertical LinearLayoutManager.
It can only be put inside a ConstraintLayout.
Parameters
The display context.
The attribute set provided in the layout XML file.
The default style attribute set.
Constructors
Types
The button action defines the desired scroll behavior while clicking the up or the down button.
Properties
The behavior of the scroll bar buttons. It controls how the ttTargetView be scrolled when pressing ttUpButtonDrawable/ ttDownButtonDrawable. The default value is ButtonAction.NONE.
Showing the scrolling indicator when set to true
. The default value is `false. The indicator is an extra view attached to this control's parent view to present extra information based on the scrolling position. The indicator will be positioned to overlay the ttTargetView. If the scrollbar is to the left of the target view, the indicator will be placed on the right side of the scrollbar and vice versa.
The RecyclerView to which the scroll bar needs to be attached. It has to be set in order to make the scroll bar work.
Inherited properties
Functions
Sets the down button drawable by providing the drawableResolver.
Sets the up button drawable by providing the drawableResolver.