Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

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 Unit

Sets OnClickListener for a Supplemental 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
setSecondaryProgress(secondaryProgress: Int)

Sets secondary progress of seekbar.

open Unit
setText(@Nullable text: CharSequence?)

Sets text that sits on top of seekbar.

open Unit

Sets an OnClickListener for the icon representing the Primary Action.

open Unit
setMax(max: Int)

Sets max value of seekbar.

open Unit

Sets Primary Action to be empty icon.

open Unit
setEnabled(enabled: Boolean)

open Unit

Sets SeekBar.OnSeekBarChangeListener.

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
setSupplementalEmptyIcon(seekbarOffsetDividerWidth: Boolean)

Sets Supplemental Action to be empty icon.

open Unit
setProgress(progress: Int)

Sets progress of seekbar.

open Int

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

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

Creates a SeekbarListItem.ViewHolder.

Protected methods
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.

open Context

Inherited functions

Public constructors

<init>

SeekbarListItem(@NonNull context: Context)

Public methods

setSupplementalIconListener

open fun setSupplementalIconListener(listener: OnClickListener!): Unit

Sets OnClickListener for a Supplemental Icon.

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

Sets Supplemental Action to be represented by an Supplemental Icon.

setSupplementalIcon

open fun setSupplementalIcon(@NonNull drawable: Drawable, showSupplementalIconDivider: Boolean): 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(@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.

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.

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.

setEnabled

open fun setEnabled(enabled: Boolean): Unit

setOnSeekBarChangeListener

open fun setOnSeekBarChangeListener(listener: OnSeekBarChangeListener!): Unit

Sets SeekBar.OnSeekBarChangeListener.

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

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.

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.

setProgress

open fun setProgress(progress: Int): Unit

Sets progress of seekbar.

getViewType

open fun getViewType(): Int

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

Return
Int: type of this ListItem.

createViewHolder

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

Creates a SeekbarListItem.ViewHolder.

Protected methods

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.

getContext

@NonNull protected open fun getContext(): Context