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 optionalText
.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 |
|
---|---|
Public methods |
|
---|---|
open static SeekbarListItem.ViewHolder |
createViewHolder(itemView: View!) Creates a |
open Int |
Used by |
open Unit |
setEnabled(enabled: Boolean) |
open Unit |
Sets max value of seekbar. |
open Unit |
setOnSeekBarChangeListener(listener: OnSeekBarChangeListener!) |
open Unit |
Sets |
open Unit |
setPrimaryActionIcon(@NonNull icon: Icon) Sets |
open Unit |
setPrimaryActionIcon(@DrawableRes iconResId: Int) Sets |
open Unit |
setPrimaryActionIcon(drawable: Drawable!) Sets |
open Unit |
setPrimaryActionIconListener(onClickListener: OnClickListener!) Sets an |
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 |
open Unit |
setSupplementalIcon(@NonNull icon: Icon, showSupplementalIconDivider: Boolean) Sets |
open Unit |
setSupplementalIcon(@DrawableRes iconResId: Int, showSupplementalIconDivider: Boolean) Sets |
open Unit |
setSupplementalIcon(@NonNull drawable: Drawable, showSupplementalIconDivider: Boolean) Sets |
open Unit |
setSupplementalIconListener(listener: OnClickListener!) Sets |
open Unit |
setText(@Nullable text: CharSequence?) Sets text that sits on top of seekbar. |
Protected methods |
|
---|---|
open Context | |
open Unit |
onBind(viewHolder: SeekbarListItem.ViewHolder!) Hides all views in |
open Unit |
Calculates the layout params for views in |
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. |
setOnSeekBarChangeListener
open fun setOnSeekBarChangeListener(listener: OnSeekBarChangeListener!): Unit
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 funsetPrimaryActionIcon(@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 funsetPrimaryActionIcon(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. |
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 funsetSupplementalIcon(@DrawableRes iconResId: Int, showSupplementalIconDivider: Boolean): Unit
Deprecated: Use setSupplementalIcon(Icon, boolean)
.
Sets Supplemental Action
to be represented by an Supplemental Icon
.
setSupplementalIcon
open funsetSupplementalIcon(@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
.