It's happening now, watch the livestream.

PagedScrollBarView

open class PagedScrollBarView : ViewGroup
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ androidx.car.widget.PagedScrollBarView

A custom view to provide list scroll behaviour -- up/down buttons and scroll indicator.

Summary

Nested classes

abstract

Listener for when the list should paginate.

Public constructors

<init>(context: Context!)

<init>(context: Context!, attrs: AttributeSet!)

<init>(context: Context!, attrs: AttributeSet!, defStyleAttrs: Int)

<init>(context: Context!, attrs: AttributeSet!, defStyleAttrs: Int, defStyleRes: Int)

Public methods

open Boolean

Returns whether or not the down button on the scroll bar is clickable.

open Boolean

Returns true if the "down" button is pressed

open Boolean

Returns true if the scroll bar thumb is visible

open Boolean

Returns true if the "up" button is pressed

open Unit
onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int)

open Unit
setButtonRippleBackground(@DrawableRes backgroundResId: Int)

Sets the drawable that will function as the background for the buttons in this view.

open Unit
setButtonTintColor(@ColorRes tintResId: Int)

Sets the tint color for the up and down buttons of this view.

open Unit

Sets the icon to be used for the down button.

open Unit

Sets whether or not the down button on the scroll bar is clickable.

open Unit

Sets the listener that will be notified when the up and down buttons have been pressed.

open Unit
setParameters(range: Int, offset: Int, extent: Int, animate: Boolean)

Sets the range, offset and extent of the scroll bar.

open Unit
setScrollbarThumbColor(@ColorRes color: Int)

Sets the color of thumb.

open Unit

Sets whether or not the scroll bar thumb is visible, the default value is true.

open Unit

Sets the icon to be used for the up button.

open Unit

Sets whether or not the up button on the scroll bar is clickable.

Protected methods

open Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

Public constructors

<init>

PagedScrollBarView(context: Context!)

<init>

PagedScrollBarView(context: Context!, attrs: AttributeSet!)

<init>

PagedScrollBarView(context: Context!, attrs: AttributeSet!, defStyleAttrs: Int)

<init>

PagedScrollBarView(context: Context!, attrs: AttributeSet!, defStyleAttrs: Int, defStyleRes: Int)

Public methods

isDownEnabled

open fun isDownEnabled(): Boolean

Returns whether or not the down button on the scroll bar is clickable.

Return
Boolean: true if the down button is enabled. false otherwise.

isDownPressed

open fun isDownPressed(): Boolean

Returns true if the "down" button is pressed

isScrollbarThumbEnabled

open fun isScrollbarThumbEnabled(): Boolean

Returns true if the scroll bar thumb is visible

isUpPressed

open fun isUpPressed(): Boolean

Returns true if the "up" button is pressed

onLayout

open fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int): Unit

setButtonRippleBackground

open fun setButtonRippleBackground(@DrawableRes backgroundResId: Int): Unit

Sets the drawable that will function as the background for the buttons in this view. This background should provide the ripple.

Parameters
backgroundResId Int: The drawable resource identifier for the ripple background.

setButtonTintColor

open fun setButtonTintColor(@ColorRes tintResId: Int): Unit

Sets the tint color for the up and down buttons of this view.

Parameters
tintResId Int: Resource identifier of the tint color.

setDownButtonIcon

open fun setDownButtonIcon(icon: Drawable!): Unit

Sets the icon to be used for the down button.

setDownEnabled

open fun setDownEnabled(enabled: Boolean): Unit

Sets whether or not the down button on the scroll bar is clickable.

Parameters
enabled Boolean: true if the down button is enabled.

setPaginationListener

open fun setPaginationListener(listener: PagedScrollBarView.PaginationListener!): Unit

Sets the listener that will be notified when the up and down buttons have been pressed.

Parameters
listener PagedScrollBarView.PaginationListener!: The listener to set.

setParameters

open fun setParameters(range: Int, offset: Int, extent: Int, animate: Boolean): Unit

Sets the range, offset and extent of the scroll bar. The range represents the size of a container for the scrollbar thumb; offset is the distance from the start of the container to where the thumb should be; and finally, extent is the size of the thumb.

These values can be expressed in arbitrary units, so long as they share the same units. The values should also be positive.

Parameters
range Int: The range of the scrollbar's thumb
offset Int: The offset of the scrollbar's thumb
extent Int: The extent of the scrollbar's thumb
animate Int: Whether or not the thumb should animate from its current position to the position specified by the given range, offset and extent.

setScrollbarThumbColor

open fun setScrollbarThumbColor(@ColorRes color: Int): Unit

Sets the color of thumb.

Parameters
color Int: Resource identifier of the color.

setScrollbarThumbEnabled

open fun setScrollbarThumbEnabled(show: Boolean): Unit

Sets whether or not the scroll bar thumb is visible, the default value is true.

Parameters
show Boolean: true if the scroll bar thumb is visible.

setUpButtonIcon

open fun setUpButtonIcon(icon: Drawable!): Unit

Sets the icon to be used for the up button.

setUpEnabled

open fun setUpEnabled(enabled: Boolean): Unit

Sets whether or not the up button on the scroll bar is clickable.

Parameters
enabled Boolean: true if the up button is enabled.

Protected methods

onMeasure

protected open fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int): Unit