PlaybackTransportRowPresenter
public class PlaybackTransportRowPresenter extends PlaybackRowPresenter
| java.lang.Object | ||||
| ↳ | androidx.leanback.widget.Presenter | |||
| ↳ | androidx.leanback.widget.RowPresenter | |||
| ↳ | androidx.leanback.widget.PlaybackRowPresenter | |||
| ↳ | androidx.leanback.widget.PlaybackTransportRowPresenter |
A PlaybackTransportRowPresenter renders a PlaybackControlsRow to display a series of playback control buttons. Typically this row will be the first row in a fragment such as the androidx.leanback.app.PlaybackSupportFragment.
The detailed description is rendered using a Presenter passed in setDescriptionPresenter. This can be an instance of AbstractDetailsDescriptionPresenter. The application can access the detailed description ViewHolder from getDescriptionViewHolder.
Summary
Nested types |
|---|
public inner class PlaybackTransportRowPresenter.ViewHolder extends PlaybackRowPresenter.ViewHolder implements PlaybackSeekUiA ViewHolder for the PlaybackControlsRow supporting seek UI. |
Public constructors |
|---|
Public methods |
|
|---|---|
float |
Get default seek increment if |
OnActionClickedListener |
Returns the listener for |
@ColorInt int |
Returns the primary color for the progress bar. |
@ColorInt int |
Returns the secondary color for the progress bar. |
void |
onReappear(RowPresenter.ViewHolder rowViewHolder)Provides hook to update the UI when the view reappears. |
void |
setDefaultSeekIncrement(float ratio)Set default seek increment if |
void |
setDescriptionPresenter(Presenter descriptionPresenter) |
void |
Sets the listener for |
void |
setProgressColor(@ColorInt int color)Sets the primary color for the progress bar. |
void |
setSecondaryProgressColor(@ColorInt int color)Sets the secondary color for the progress bar. |
Protected methods |
|
|---|---|
RowPresenter.ViewHolder |
createRowViewHolder(ViewGroup parent)Called to create a ViewHolder object for a Row. |
void |
onBindRowViewHolder(Binds the given row object to the given ViewHolder. |
void |
Client of progress bar is clicked, default implementation delegate click to PlayPauseAction. |
void |
Invoked when the row view is attached to the window. |
void |
Invoked when the row view is detached from the window. |
void |
onRowViewSelected(RowPresenter.ViewHolder vh, boolean selected)Called when the given row view changes selection state. |
void |
Unbinds the given ViewHolder. |
Inherited Constants |
||||||||
|---|---|---|---|---|---|---|---|---|
|
Inherited methods |
||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Public constructors
Public methods
getDefaultSeekIncrement
public float getDefaultSeekIncrement()
Get default seek increment if PlaybackSeekDataProvider is null.
| Returns | |
|---|---|
float |
float value between 0(inclusive) and 1(inclusive). |
getOnActionClickedListener
public OnActionClickedListener getOnActionClickedListener()
Returns the listener for Action click events.
getProgressColor
public @ColorInt int getProgressColor()
Returns the primary color for the progress bar. If no color was set, transparent is returned.
getSecondaryProgressColor
public @ColorInt int getSecondaryProgressColor()
Returns the secondary color for the progress bar. If no color was set, transparent is returned.
onReappear
public void onReappear(RowPresenter.ViewHolder rowViewHolder)
Provides hook to update the UI when the view reappears.
setDefaultSeekIncrement
public void setDefaultSeekIncrement(float ratio)
Set default seek increment if PlaybackSeekDataProvider is null.
| Parameters | |
|---|---|
float ratio |
float value between 0(inclusive) and 1(inclusive). |
setDescriptionPresenter
public void setDescriptionPresenter(Presenter descriptionPresenter)
| Parameters | |
|---|---|
Presenter descriptionPresenter |
Presenter for displaying item details. |
setOnActionClickedListener
public void setOnActionClickedListener(OnActionClickedListener listener)
Sets the listener for Action click events.
setProgressColor
public void setProgressColor(@ColorInt int color)
Sets the primary color for the progress bar. If not set, a default from the theme will be used.
setSecondaryProgressColor
public void setSecondaryProgressColor(@ColorInt int color)
Sets the secondary color for the progress bar. If not set, a default from the theme playbackProgressSecondaryColor will be used.
| Parameters | |
|---|---|
@ColorInt int color |
Color used to draw secondary progress. |
Protected methods
createRowViewHolder
protected RowPresenter.ViewHolder createRowViewHolder(ViewGroup parent)
Called to create a ViewHolder object for a Row. Subclasses will override this method to return a different concrete ViewHolder object.
| Parameters | |
|---|---|
ViewGroup parent |
The parent View for the Row's view holder. |
| Returns | |
|---|---|
RowPresenter.ViewHolder |
A ViewHolder for the Row's View. |
onBindRowViewHolder
protected void onBindRowViewHolder(
@NonNull RowPresenter.ViewHolder holder,
@NonNull Object item
)
Binds the given row object to the given ViewHolder. Derived classes of RowPresenter overriding onBindRowViewHolder must call through the super class's implementation of this method.
onProgressBarClicked
protected void onProgressBarClicked(PlaybackTransportRowPresenter.ViewHolder vh)
Client of progress bar is clicked, default implementation delegate click to PlayPauseAction.
| Parameters | |
|---|---|
PlaybackTransportRowPresenter.ViewHolder vh |
ViewHolder of PlaybackTransportRowPresenter |
onRowViewAttachedToWindow
protected void onRowViewAttachedToWindow(@NonNull RowPresenter.ViewHolder vh)
Invoked when the row view is attached to the window.
onRowViewDetachedFromWindow
protected void onRowViewDetachedFromWindow(@NonNull RowPresenter.ViewHolder vh)
Invoked when the row view is detached from the window.
onRowViewSelected
protected void onRowViewSelected(RowPresenter.ViewHolder vh, boolean selected)
Called when the given row view changes selection state. A subclass may override this to respond to selected state changes of a Row. A subclass may make visual changes to Row view but must not create animation on the Row view.
onUnbindRowViewHolder
protected void onUnbindRowViewHolder(@NonNull RowPresenter.ViewHolder holder)
Unbinds the given ViewHolder. Derived classes of RowPresenter overriding onUnbindRowViewHolder must call through the super class's implementation of this method.