DetailsOverviewRow

open class DetailsOverviewRow : Row
kotlin.Any
   ↳ androidx.leanback.widget.Row
   ↳ androidx.leanback.widget.DetailsOverviewRow

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 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(Object) 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 or setImageDrawable(Drawable) on the UI thread, and the view will be updated.

Summary

Nested classes
open

Listener for changes of DetailsOverviewRow.

Public constructors
<init>(item: Any!)

Constructor for a DetailsOverviewRow.

Public methods
ObjectAdapter!

Returns the ObjectAdapter for actions.

open Boolean

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

Any!

Returns the main item for the details page.

Unit
setImageBitmap(context: Context!, bm: Bitmap!)

Sets a Bitmap as the image of this details overview.

Drawable!

Returns the image drawable of this details overview.

open Unit

Allows or disallows scaling up of images.

Unit
addAction(action: Action!)

Adds an Action to the overview.

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

Adds an Action to the overview at the specified position.

Unit
setItem(item: Any!)

Sets the main item for the details page.

Boolean
removeAction(action: Action!)

Removes the given Action from the overview.

Unit

Sets a drawable as the image of this details overview.

Unit

Sets the ObjectAdapter for actions.

open Action!

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

MutableList<Action!>!

Returns a read-only view of the list of Actions of this details overview.

Inherited functions

Public constructors

<init>

DetailsOverviewRow(item: Any!)

Constructor for a DetailsOverviewRow.

Parameters
item Any!: The main item for the details page.

Public methods

getActionsAdapter

fun getActionsAdapter(): ObjectAdapter!

Returns the ObjectAdapter for actions.

isImageScaleUpAllowed

open fun isImageScaleUpAllowed(): Boolean

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

getItem

fun getItem(): Any!

Returns the main item for the details page.

setImageBitmap

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 Context!: The bitmap to set.

getImageDrawable

fun getImageDrawable(): Drawable!

Returns the image drawable of this details overview.

Return
Drawable!: The overview's image drawable, or null if no drawable has been assigned.

setImageScaleUpAllowed

open 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.

addAction

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

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 Int: The Action to add.

setItem

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.

removeAction

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.
Return
Boolean: true if the overview contained the specified Action.

setImageDrawable

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.

setActionsAdapter

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.

getActionForKeyCode

open fun getActionForKeyCode(keyCode: Int): Action!

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

getActions

fun getActions(): MutableList<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.

Return
MutableList<Action!>!: An unmodifiable view of the list of Actions.