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
open

Holds views of SeekbarListItem.

Public constructors
<init>(context: Context!, max: Int, progress: Int, listener: OnSeekBarChangeListener!, text: String!)

use #SeekbarListItem(Context) and individual field setters instead.

<init>(context: Context!)

Public methods
open Unit
setSupplementalEmptyIcon(seekbarOffsetDividerWidth: Boolean)

Sets Supplemental Action to be empty icon.

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

Sets Supplemental Action to be represented by an Supplemental Icon.

open Unit
setSupplementalIcon(iconResId: Int, showSupplementalIconDivider: Boolean, listener: OnClickListener?)

Sets Supplemental Action to be represented by an Supplemental Icon.

open Unit
setSupplementalIcon(drawable: Drawable!, showSupplementalIconDivider: Boolean)

Sets Supplemental Action to be represented by an Supplemental Icon.

open Unit
setSupplementalIcon(drawable: Drawable!, showSupplementalIconDivider: Boolean, listener: OnClickListener?)

Sets Supplemental Action to be represented by an Supplemental Icon.

open Unit
setSecondaryProgress(secondaryProgress: Int)

Sets secondary progress of seekbar.

open Unit
setText(text: String!)

Sets text that sits on top of seekbar.

open Unit
setMax(max: Int)

Sets max value of seekbar.

open Unit

Sets Primary Action to be empty icon.

open Unit
setProgress(progress: Int)

Sets progress of seekbar.

open Unit

Sets SeekBar.OnSeekBarChangeListener.

open Int

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

open Unit

Sets Primary Action to be represented by an icon.

open Unit

Sets Primary Action to be represented by an icon.

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

Creates a SeekbarListItem.ViewHolder.

Protected methods
open Unit

Calculates the layout params for views in ViewHolder.

open Unit

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

Inherited functions

Public constructors

<init>

SeekbarListItem(context: Context!, max: Int, progress: Int, listener: OnSeekBarChangeListener!, text: String!)

Deprecated: use #SeekbarListItem(Context) and individual field setters instead.

Creates a SeekbarListItem.

Parameters
context Context!: context
max Context!: the upper range of the SeekBar.
progress Context!: the current progress of the specified value.
listener Context!: listener to receive notification of changes to progress level.
text Context!: displays a text on top of the SeekBar.

<init>

SeekbarListItem(context: Context!)

Public methods

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(iconResId: Int, showSupplementalIconDivider: Boolean): Unit

Sets Supplemental Action to be represented by an Supplemental Icon.

setSupplementalIcon

open fun setSupplementalIcon(iconResId: Int, showSupplementalIconDivider: Boolean, listener: OnClickListener?): Unit

Sets Supplemental Action to be represented by an Supplemental Icon.

setSupplementalIcon

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

Sets Supplemental Action to be represented by an Supplemental Icon.

setSupplementalIcon

open fun setSupplementalIcon(drawable: Drawable!, showSupplementalIconDivider: Boolean, listener: OnClickListener?): Unit

Sets Supplemental Action to be represented by an Supplemental Icon.

setSecondaryProgress

open fun setSecondaryProgress(secondaryProgress: Int): Unit

Sets secondary progress of seekbar.

setText

open fun setText(text: String!): Unit

Sets text that sits on top of seekbar.

setMax

open fun setMax(max: Int): Unit

Sets max value of seekbar.

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.

setProgress

open fun setProgress(progress: Int): Unit

Sets progress of seekbar.

setOnSeekBarChangeListener

open fun setOnSeekBarChangeListener(listener: OnSeekBarChangeListener!): Unit

Sets SeekBar.OnSeekBarChangeListener.

getViewType

open fun getViewType(): Int

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

Return
Int: type of this ListItem.

setPrimaryActionIcon

open fun setPrimaryActionIcon(iconResId: Int): Unit

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

Sets Primary Action to be represented by an icon.

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

createViewHolder

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

Creates a SeekbarListItem.ViewHolder.

Protected methods

resolveDirtyState

protected open fun resolveDirtyState(): Unit

Calculates the layout params for views in ViewHolder.

onBind

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

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