DetailsOverviewLogoPresenter

open class DetailsOverviewLogoPresenter : Presenter
kotlin.Any
   ↳ androidx.leanback.widget.Presenter
   ↳ androidx.leanback.widget.DetailsOverviewLogoPresenter

Presenter that responsible to create a ImageView and bind to DetailsOverviewRow. The default implementation uses DetailsOverviewRow#getImageDrawable() and binds to ImageView.

Default implementation assumes no scaleType on ImageView and uses intrinsic width and height of DetailsOverviewRow#getImageDrawable() to initialize ImageView's layout params. To specify a fixed size and/or specify a scapeType, subclass should change ImageView's layout params and scaleType in onCreateView(ViewGroup).

Subclass may override and has its own image view. Subclass may also download image from URL instead of using DetailsOverviewRow#getImageDrawable(). It's subclass's responsibility to call FullWidthDetailsOverviewRowPresenter#notifyOnBindLogo(FullWidthDetailsOverviewRowPresenter.ViewHolder) whenever isBoundToImage(ViewHolder, DetailsOverviewRow) turned to true so that activity transition can be started.

Summary

Nested classes

open

ViewHolder for Logo view of DetailsOverviewRow.

Public constructors

Presenter that responsible to create a ImageView and bind to DetailsOverviewRow.

Public methods

open Boolean

Returns true if the logo view is bound to image.

open Unit
onBindViewHolder(viewHolder: Presenter.ViewHolder!, item: Any!)

Bind logo View to drawable of DetailsOverviewRow and call notifyOnBindLogo().

open View!

Create a View for the Logo, default implementation loads from R.

open Presenter.ViewHolder!

open Unit

open Unit

Called from FullWidthDetailsOverviewRowPresenter to setup FullWidthDetailsOverviewRowPresenter and FullWidthDetailsOverviewRowPresenter.

Inherited functions

Public constructors

<init>

DetailsOverviewLogoPresenter()

Presenter that responsible to create a ImageView and bind to DetailsOverviewRow. The default implementation uses DetailsOverviewRow#getImageDrawable() and binds to ImageView.

Default implementation assumes no scaleType on ImageView and uses intrinsic width and height of DetailsOverviewRow#getImageDrawable() to initialize ImageView's layout params. To specify a fixed size and/or specify a scapeType, subclass should change ImageView's layout params and scaleType in onCreateView(ViewGroup).

Subclass may override and has its own image view. Subclass may also download image from URL instead of using DetailsOverviewRow#getImageDrawable(). It's subclass's responsibility to call FullWidthDetailsOverviewRowPresenter#notifyOnBindLogo(FullWidthDetailsOverviewRowPresenter.ViewHolder) whenever isBoundToImage(ViewHolder, DetailsOverviewRow) turned to true so that activity transition can be started.

Public methods

isBoundToImage

open fun isBoundToImage(viewHolder: DetailsOverviewLogoPresenter.ViewHolder!, row: DetailsOverviewRow!): Boolean

Returns true if the logo view is bound to image. Subclass may override. The default implementation returns true when DetailsOverviewRow#getImageDrawable() is not null. If subclass of DetailsOverviewLogoPresenter manages its own image drawable, it should override this function to report status correctly and invoke FullWidthDetailsOverviewRowPresenter#notifyOnBindLogo(FullWidthDetailsOverviewRowPresenter.ViewHolder) when image view is bound to the drawable.

onBindViewHolder

open fun onBindViewHolder(viewHolder: Presenter.ViewHolder!, item: Any!): Unit

Bind logo View to drawable of DetailsOverviewRow and call notifyOnBindLogo(). The default implementation assumes the Logo View is an ImageView and change layout size to intrinsic size of ImageDrawable if ViewHolder#isSizeFromDrawableIntrinsic() is true.

Parameters
viewHolder Presenter.ViewHolder!: ViewHolder to bind.
item Presenter.ViewHolder!: DetailsOverviewRow object to bind.

onCreateView

open fun onCreateView(parent: ViewGroup!): View!

Create a View for the Logo, default implementation loads from R.layout#lb_fullwidth_details_overview_logo. Subclass may override this method to use a fixed layout size and change ImageView scaleType. If the layout params is WRAP_CONTENT for both width and size, the ViewHolder would be using intrinsic size of Drawable in onBindViewHolder(Presenter.ViewHolder, Object).

Parameters
parent ViewGroup!: Parent view.
Return
View!: View created for the logo.

onCreateViewHolder

open fun onCreateViewHolder(parent: ViewGroup!): Presenter.ViewHolder!

onUnbindViewHolder

open fun onUnbindViewHolder(viewHolder: Presenter.ViewHolder!): Unit

setContext

open fun setContext(viewHolder: DetailsOverviewLogoPresenter.ViewHolder!, parentViewHolder: FullWidthDetailsOverviewRowPresenter.ViewHolder!, parentPresenter: FullWidthDetailsOverviewRowPresenter!): Unit

Called from FullWidthDetailsOverviewRowPresenter to setup FullWidthDetailsOverviewRowPresenter and FullWidthDetailsOverviewRowPresenter.ViewHolder that hosts the logo.

Parameters
viewHolder DetailsOverviewLogoPresenter.ViewHolder!:
parentViewHolder DetailsOverviewLogoPresenter.ViewHolder!:
parentPresenter DetailsOverviewLogoPresenter.ViewHolder!: