PagedScrollBarView

open class PagedScrollBarView : FrameLayout
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.FrameLayout
   ↳ 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!, attrs: AttributeSet!)

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

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

Public methods
open Unit

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

open Boolean

Returns true if the "up" button is pressed

open Unit

Sets the color of thumb.

open Unit

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

open Unit
setDayNightStyle(dayNightStyle: Int)

Sets how this PagedScrollBarView responds to day/night configuration changes.

open Unit

Sets the icon to be used for the down button.

open Boolean

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

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

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

open Unit

Resets the color of thumb to default.

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.

open Boolean

Returns true if the "down" button is pressed

Public constructors

<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

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.

isUpPressed

open fun isUpPressed(): Boolean

Returns true if the "up" button is pressed

setThumbColor

open fun setThumbColor(color: Int): Unit

Sets the color of thumb.

Custom thumb color ignores DayNightStyle. Calling #resetThumbColor resets to default color.

Parameters
color Int: Resource identifier of the color.

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.

setDayNightStyle

open fun setDayNightStyle(dayNightStyle: Int): Unit

Sets how this PagedScrollBarView responds to day/night configuration changes. By default, the PagedScrollBarView is darker in the day and lighter at night.

Parameters
dayNightStyle Int: A value from DayNightStyle.

See Also

setDownButtonIcon

open fun setDownButtonIcon(icon: Drawable!): Unit

Sets the icon to be used for the down button.

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.

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.

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.

resetThumbColor

open fun resetThumbColor(): Unit

Resets the color of thumb to default.

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.

isDownPressed

open fun isDownPressed(): Boolean

Returns true if the "down" button is pressed