Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

ViewHolder

open class ViewHolder : RecyclerView.ViewHolder, FacetProvider
kotlin.Any
   ↳ androidx.recyclerview.widget.RecyclerView.ViewHolder
   ↳ androidx.leanback.widget.GuidedActionsStylist.ViewHolder

ViewHolder caches information about the action item layouts' subviews. Subclasses of may also wish to subclass this in order to add fields.

Summary

Public constructors

<init>(v: View!)

Constructs an ViewHolder and caches the relevant subviews.

<init>(v: View!, isSubAction: Boolean)

Constructs an ViewHolder for sub action and caches the relevant subviews.

Public methods

open GuidedAction!

open ImageView!

Returns the checkmark view within this view holder's view.

open ImageView!

Returns the chevron view within this view holder's view.

open View!

Returns the content view within this view holder's view, where title and description are shown.

open TextView!

Returns the description view within this view holder's view.

open EditText!

Convenience method to return an editable version of the description, if possible, or null if the description view isn't an EditText.

open EditText!

Convenience method to return an editable version of the title, if possible, or null if the title view isn't an EditText.

open View!

open Any!
getFacet(facetClass: Class<*>!)

open ImageView!

Returns the icon view within this view holder's view.

open TextView!

Returns the title view within this view holder's view.

open Boolean

Returns true if in editing title, description, or activator View, false otherwise.

open Boolean

Returns true if is in editing activator view with id guidedactions_activator_item, false otherwise.

open Boolean

Returns true if the TextView is in editing description, false otherwise.

open Boolean

Returns true if in editing title, description, so IME would be open.

open Boolean

Returns true if the TextView is in editing title, false otherwise.

open Boolean

Inherited functions

Inherited properties

Public constructors

<init>

ViewHolder(v: View!)

Constructs an ViewHolder and caches the relevant subviews.

<init>

ViewHolder(v: View!, isSubAction: Boolean)

Constructs an ViewHolder for sub action and caches the relevant subviews.

Public methods

getAction

open fun getAction(): GuidedAction!
Return
GuidedAction!: Currently bound action.

getCheckmarkView

open fun getCheckmarkView(): ImageView!

Returns the checkmark view within this view holder's view.

getChevronView

open fun getChevronView(): ImageView!

Returns the chevron view within this view holder's view.

getContentView

open fun getContentView(): View!

Returns the content view within this view holder's view, where title and description are shown.

getDescriptionView

open fun getDescriptionView(): TextView!

Returns the description view within this view holder's view.

getEditableDescriptionView

open fun getEditableDescriptionView(): EditText!

Convenience method to return an editable version of the description, if possible, or null if the description view isn't an EditText.

getEditableTitleView

open fun getEditableTitleView(): EditText!

Convenience method to return an editable version of the title, if possible, or null if the title view isn't an EditText.

getEditingView

open fun getEditingView(): View!
Return
View!: Current editing title view or description view or activator view or null if not in editing.

getFacet

open fun getFacet(facetClass: Class<*>!): Any!

getIconView

open fun getIconView(): ImageView!

Returns the icon view within this view holder's view.

getTitleView

open fun getTitleView(): TextView!

Returns the title view within this view holder's view.

isInEditing

open fun isInEditing(): Boolean

Returns true if in editing title, description, or activator View, false otherwise.

isInEditingActivatorView

open fun isInEditingActivatorView(): Boolean

Returns true if is in editing activator view with id guidedactions_activator_item, false otherwise.

isInEditingDescription

open fun isInEditingDescription(): Boolean

Returns true if the TextView is in editing description, false otherwise.

isInEditingText

open fun isInEditingText(): Boolean

Returns true if in editing title, description, so IME would be open.

Return
Boolean: True if in editing title, description, so IME would be open, false otherwise.

isInEditingTitle

open fun isInEditingTitle(): Boolean

Returns true if the TextView is in editing title, false otherwise.

isSubAction

open fun isSubAction(): Boolean
Return
Boolean: True if bound action is inside GuidedAction#getSubActions(), false otherwise.