DetailsOverviewRow


class DetailsOverviewRow : Row


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 to set actions on the overview row. SparseArrayObjectAdapter is recommended for easily updating actions while maintaining the order. The application can add or remove actions on the UI thread after the row is bound to a view.

Updating main item

After the row is bound to a view, the application may call setItem on UI thread and the view will be updated.

Updating image

After the row is bound to view, the application may change the image by calling setImageBitmap or setImageDrawable on the UI thread, and the view will be updated.

Summary

Nested types

Listener for changes of DetailsOverviewRow.

Public constructors

Constructor for a DetailsOverviewRow.

Public functions

Unit
addAction(action: Action!)

This function is deprecated.

Use setActionsAdapter and getActionsAdapter

Unit
addAction(pos: Int, action: Action!)

This function is deprecated.

Use setActionsAdapter and getActionsAdapter

Action?

Returns the Action associated with the given keycode, or null if no associated action exists.

(Mutable)List<Action!>!

This function is deprecated.

Use setActionsAdapter and getActionsAdapter

ObjectAdapter

Returns the ObjectAdapter for actions.

Drawable?

Returns the image drawable of this details overview.

Any

Returns the main item for the details page.

Boolean

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

Boolean
removeAction(action: Action!)

This function is deprecated.

Use setActionsAdapter and getActionsAdapter

Unit

Sets the ObjectAdapter for actions.

Unit
setImageBitmap(context: Context, bm: Bitmap)

Sets a Bitmap as the image of this details overview.

Unit

Sets a drawable as the image of this details overview.

Unit

Allows or disallows scaling up of images.

Unit
setItem(item: Any)

Sets the main item for the details page.

Inherited functions

From androidx.leanback.widget.Row
HeaderItem!

Returns the HeaderItem that represents metadata for the row.

Long

Returns a unique identifier for this row.

Boolean

Returns true if this Row can be rendered in a visible row view, false otherwise.

Unit
setHeaderItem(headerItem: HeaderItem!)

Sets the HeaderItem that represents metadata for the row.

Unit
setId(id: Long)

Sets the id for this row.

Public constructors

DetailsOverviewRow

Added in 1.1.0
DetailsOverviewRow(item: Any)

Constructor for a DetailsOverviewRow.

Parameters
item: Any

The main item for the details page.

Public functions

addAction

Added in 1.1.0
Deprecated in 1.1.0
fun addAction(action: Action!): Unit

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

Parameters
action: Action!

The Action to add.

addAction

Added in 1.1.0
Deprecated in 1.1.0
fun addAction(pos: Int, action: Action!): Unit

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

Parameters
pos: Int

The position to insert the Action.

action: Action!

The Action to add.

getActionForKeyCode

Added in 1.1.0
fun getActionForKeyCode(keyCode: Int): Action?

Returns the Action associated with the given keycode, or null if no associated action exists.

getActions

Added in 1.1.0
Deprecated in 1.1.0
fun getActions(): (Mutable)List<Action!>!

Returns 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
(Mutable)List<Action!>!

An unmodifiable view of the list of Actions.

getActionsAdapter

Added in 1.1.0
fun getActionsAdapter(): ObjectAdapter

Returns the ObjectAdapter for actions.

getImageDrawable

Added in 1.1.0
fun getImageDrawable(): Drawable?

Returns the image drawable of this details overview.

Returns
Drawable?

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

getItem

Added in 1.1.0
fun getItem(): Any

Returns the main item for the details page.

isImageScaleUpAllowed

Added in 1.1.0
fun isImageScaleUpAllowed(): Boolean

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

removeAction

Added in 1.1.0
Deprecated in 1.1.0
fun removeAction(action: Action!): Boolean

Removes 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: Action!

The Action to remove.

Returns
Boolean

true if the overview contained the specified Action.

setActionsAdapter

Added in 1.1.0
fun setActionsAdapter(adapter: ObjectAdapter): Unit

Sets the ObjectAdapter for actions. A default PresenterSelector will be attached to the adapter if it doesn't have one.

Parameters
adapter: ObjectAdapter

Adapter for actions.

setImageBitmap

Added in 1.1.0
fun setImageBitmap(context: Context, bm: Bitmap): Unit

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

Parameters
context: Context

The context to retrieve display metrics from.

bm: Bitmap

The bitmap to set.

setImageDrawable

Added in 1.1.0
fun setImageDrawable(drawable: Drawable?): Unit

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

Parameters
drawable: Drawable?

The drawable to set.

setImageScaleUpAllowed

Added in 1.1.0
fun setImageScaleUpAllowed(allowed: Boolean): Unit

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.

setItem

Added in 1.1.0
fun setItem(item: Any): Unit

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