Android APIs
public class

DetailsOverviewRow

extends Row
java.lang.Object
   ↳ android.support.v17.leanback.widget.Row
     ↳ android.support.v17.leanback.widget.DetailsOverviewRow

Class Overview

An overview row for a details fragment. This row consists of an image, a description view, and optionally a series of Actions that can be taken for the item.

Actions

Application uses setActionsAdapter(ObjectAdapter) to set actions on the overview row. SparseArrayObjectAdapter is recommended for easy updating actions while keeping the order. Application can add or remove actions on UI thread after the row is bound to view.

Updating main item

After the row is bound to view, application still can call (setItem(Object)) on UI thread.

Updating image

After the row is bound to view, application still can change image by calling (setImageBitmap(Context, Bitmap)) or setImageDrawable(Drawable)) on UI thread.

Summary

Public Constructors
DetailsOverviewRow(Object item)
Constructor for a DetailsOverviewRow.
Public Methods
final void addAction(int pos, Action action)
This method is deprecated. Use setActionsAdapter(ObjectAdapter) and getActionsAdapter()
final void addAction(Action action)
This method is deprecated. Use setActionsAdapter(ObjectAdapter) and getActionsAdapter()
final List<Action> getActions()
This method is deprecated. Use setActionsAdapter(ObjectAdapter) and getActionsAdapter()
final ObjectAdapter getActionsAdapter()
Gets ObjectAdapter for actions.
final Drawable getImageDrawable()
Gets the image drawable of this details overview.
final Object getItem()
Gets the main item for the details page.
boolean isImageScaleUpAllowed()
Returns true if the image may be scaled up; false otherwise.
final boolean removeAction(Action action)
This method is deprecated. Use setActionsAdapter(ObjectAdapter) and getActionsAdapter()
final void setActionsAdapter(ObjectAdapter adapter)
Sets ObjectAdapter for actions.
final void setImageBitmap(Context context, Bitmap bm)
Sets a Bitmap as the image of this details overview.
final void setImageDrawable(Drawable drawable)
Sets a drawable as the image of this details overview.
void setImageScaleUpAllowed(boolean allowed)
Allows or disallows scaling up of images.
final void setItem(Object item)
Sets the main item for the details page.
[Expand]
Inherited Methods
From class android.support.v17.leanback.widget.Row
From class java.lang.Object

Public Constructors

public DetailsOverviewRow (Object item)

Constructor for a DetailsOverviewRow.

Parameters
item The main item for the details page.

Public Methods

public final void addAction (int pos, Action action)

This method is deprecated.
Use setActionsAdapter(ObjectAdapter) and getActionsAdapter()

Add an Action to the overview at the specified position. It will throw ClassCastException if current actions adapter is not ArrayObjectAdapter. Must be called on UI thread.

Parameters
pos The position to insert the Action.
action The Action to add.

public final void addAction (Action action)

This method is deprecated.
Use setActionsAdapter(ObjectAdapter) and getActionsAdapter()

Add an Action to the overview. It will throw ClassCastException if current actions adapter is not ArrayObjectAdapter. Must be called on UI thread.

Parameters
action The Action to add.

public final List<Action> getActions ()

This method is deprecated.
Use setActionsAdapter(ObjectAdapter) and getActionsAdapter()

Gets a read-only view of the list of Actions of this details overview. It will throw ClassCastException if current actions adapter is not ArrayObjectAdapter. Must be called on UI thread.

Returns
  • An unmodifiable view of the list of Actions.

public final ObjectAdapter getActionsAdapter ()

Gets ObjectAdapter for actions.

public final Drawable getImageDrawable ()

Gets the image drawable of this details overview.

Returns
  • The overview's image drawable, or null if no drawable has been assigned.

public final Object getItem ()

Gets the main item for the details page.

public boolean isImageScaleUpAllowed ()

Returns true if the image may be scaled up; false otherwise.

public final boolean removeAction (Action action)

This method is deprecated.
Use setActionsAdapter(ObjectAdapter) and getActionsAdapter()

Remove the given Action from the overview. It will throw ClassCastException if current actions adapter is not ArrayObjectAdapter. Must be called on UI thread.

Parameters
action The Action to remove.
Returns
  • true if the overview contained the specified Action.

public final void setActionsAdapter (ObjectAdapter adapter)

Sets ObjectAdapter for actions.

Parameters
adapter Adapter for actions, a default PresenterSelector will be attached to the adapter if it doesn't have one.

public final void setImageBitmap (Context context, Bitmap bm)

Sets a Bitmap as the image of this details overview. Must be called on UI thread after row is bound to view.

Parameters
context The context to retrieve display metrics from.
bm The bitmap to set.

public final void setImageDrawable (Drawable drawable)

Sets a drawable as the image of this details overview. Must be called on UI thread after row is bound to view.

Parameters
drawable The drawable to set.

public void setImageScaleUpAllowed (boolean allowed)

Allows or disallows scaling up of images. Images will always be scaled down if necessary. Must be called on UI thread after row is bound to view.

public final void setItem (Object item)

Sets the main item for the details page. Must be called on UI thread after row is bound to view.