It's happening now, watch the livestream.

SeekbarListItem

open class SeekbarListItem : ListItem<SeekbarListItem.ViewHolder!>
kotlin.Any
   ↳ androidx.car.widget.ListItem<androidx.car.widget.SeekbarListItem.ViewHolder>
   ↳ androidx.car.widget.SeekbarListItem

Class to build a list item with SeekBar.

An item supports primary action and supplemental action(s).

An item visually composes of 3 parts; each part may contain multiple views.

  • Primary Action: represented by an icon of following types.
    • Primary Icon - icon size could be large or small.
    • No Icon - no icon is shown.
    • Empty Icon - Seekbar offsets start space as if there was an icon.
  • Seekbar: with optional Text.
  • Supplemental Action: presented by an icon of following types; aligned to the end of item.
    • Supplemental Icon.
    • Supplemental Empty Icon - Seekbar offsets end space as if there was an icon.
SeekbarListItem binds data to ViewHolder based on components selected.

When conflicting methods are called (e.g. setting primary action to both primary icon and no icon), the last called method wins. minimum value is set to 0.

Summary

Nested classes

Holds views of SeekbarListItem.

Public constructors

<init>(@NonNull context: Context)

Public methods

open static SeekbarListItem.ViewHolder
createViewHolder(itemView: View!)

Creates a SeekbarListItem.ViewHolder.

open Int

Used by ListItemAdapter to choose layout to inflate for view holder.

open Unit
setEnabled(enabled: Boolean)

open Unit
setMax(max: Int)

Sets max value of seekbar.

open Unit

Sets SeekBar.OnSeekBarChangeListener.

open Unit

Sets Primary Action to be empty icon.

open Unit
setPrimaryActionIcon(@NonNull icon: Icon)

Sets Primary Action to be represented by an icon.

open Unit
setPrimaryActionIcon(@DrawableRes iconResId: Int)

Sets Primary Action to be represented by an icon.

open Unit

Sets Primary Action to be represented by an icon.

open Unit

Sets an OnClickListener for the icon representing the Primary Action.

open Unit
setProgress(progress: Int)

Sets progress of seekbar.

open Unit
setSecondaryProgress(secondaryProgress: Int)

Sets secondary progress of seekbar.

open Unit
setSupplementalEmptyIcon(seekbarOffsetDividerWidth: Boolean)

Sets Supplemental Action to be empty icon.

open Unit
setSupplementalIcon(@NonNull icon: Icon, showSupplementalIconDivider: Boolean)

Sets Supplemental Action to be represented by an Supplemental Icon.

open Unit
setSupplementalIcon(@DrawableRes iconResId: Int, showSupplementalIconDivider: Boolean)

Sets Supplemental Action to be represented by an Supplemental Icon.

open Unit
setSupplementalIcon(@NonNull drawable: Drawable, showSupplementalIconDivider: Boolean)

Sets Supplemental Action to be represented by an Supplemental Icon.

open Unit

Sets OnClickListener for a Supplemental Icon.

open Unit
setText(@Nullable text: CharSequence?)

Sets text that sits on top of seekbar.

Protected methods

open Context

open Unit

Hides all views in ViewHolder then applies ViewBinders to adjust view layout params.

open Unit

Calculates the layout params for views in ViewHolder.

Inherited functions

Public constructors

<init>

SeekbarListItem(@NonNull context: Context)

Public methods

createViewHolder

@NonNull open static fun createViewHolder(itemView: View!): SeekbarListItem.ViewHolder

Creates a SeekbarListItem.ViewHolder.

getViewType

open fun getViewType(): Int

Used by ListItemAdapter to choose layout to inflate for view holder.

Return
Int: type of this ListItem.

setEnabled

open fun setEnabled(enabled: Boolean): Unit

setMax

open fun setMax(max: Int): Unit

Sets max value of seekbar.

setOnSeekBarChangeListener

open fun setOnSeekBarChangeListener(listener: OnSeekBarChangeListener!): Unit

Sets SeekBar.OnSeekBarChangeListener.

setPrimaryActionEmptyIcon

open fun setPrimaryActionEmptyIcon(): Unit

Sets Primary Action to be empty icon. Seekbar would have a start margin as if Primary Action were set as icon.

setPrimaryActionIcon

open fun setPrimaryActionIcon(@NonNull icon: Icon): Unit

Sets Primary Action to be represented by an icon.

Parameters
icon Icon: An icon to set as primary action.

setPrimaryActionIcon

open fun setPrimaryActionIcon(@DrawableRes iconResId: Int): Unit

Deprecated: Use setPrimaryActionIcon(Icon).

Sets Primary Action to be represented by an icon.

Parameters
iconResId Int: the resource identifier of the drawable.

setPrimaryActionIcon

open fun setPrimaryActionIcon(drawable: Drawable!): Unit

Deprecated: Use setPrimaryActionIcon(Icon).

Sets Primary Action to be represented by an icon.

Parameters
drawable Drawable!: the Drawable to set, or null to clear the content.

setPrimaryActionIconListener

open fun setPrimaryActionIconListener(onClickListener: OnClickListener!): Unit

Sets an OnClickListener for the icon representing the Primary Action.

Parameters
onClickListener OnClickListener!: the listener to be set for the primary action icon.

setProgress

open fun setProgress(progress: Int): Unit

Sets progress of seekbar.

setSecondaryProgress

open fun setSecondaryProgress(secondaryProgress: Int): Unit

Sets secondary progress of seekbar.

setSupplementalEmptyIcon

open fun setSupplementalEmptyIcon(seekbarOffsetDividerWidth: Boolean): Unit

Sets Supplemental Action to be empty icon. Seekbar would have an end margin as if Supplemental Action were set.

setSupplementalIcon

open fun setSupplementalIcon(@NonNull icon: Icon, showSupplementalIconDivider: Boolean): Unit

Sets Supplemental Action to be represented by an Supplemental Icon.

setSupplementalIcon

open fun setSupplementalIcon(@DrawableRes iconResId: Int, showSupplementalIconDivider: Boolean): Unit

Deprecated: Use setSupplementalIcon(Icon, boolean).

Sets Supplemental Action to be represented by an Supplemental Icon.

setSupplementalIcon

open fun setSupplementalIcon(@NonNull drawable: Drawable, showSupplementalIconDivider: Boolean): Unit

Deprecated: Use setSupplementalIcon(Icon, boolean).

Sets Supplemental Action to be represented by an Supplemental Icon.

setSupplementalIconListener

open fun setSupplementalIconListener(listener: OnClickListener!): Unit

Sets OnClickListener for a Supplemental Icon.

setText

open fun setText(@Nullable text: CharSequence?): Unit

Sets text that sits on top of seekbar.

Parameters
text CharSequence?: text to be displayed, or null to clear the content.

Protected methods

getContext

@NonNull protected open fun getContext(): Context

onBind

protected open fun onBind(viewHolder: SeekbarListItem.ViewHolder!): Unit

Hides all views in ViewHolder then applies ViewBinders to adjust view layout params.

resolveDirtyState

protected open fun resolveDirtyState(): Unit

Calculates the layout params for views in ViewHolder.