GuidedActionsStylist.ViewHolder


class GuidedActionsStylist.ViewHolder : RecyclerView.ViewHolder, FacetProvider


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

See also
GuidedAction

Summary

Public constructors

Constructs an ViewHolder and caches the relevant subviews.

ViewHolder(v: View, isSubAction: Boolean)

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

Public functions

GuidedAction?
ImageView?

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

ImageView?

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

View?

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

TextView?

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

EditText?

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

EditText?

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

View?
Any?
getFacet(facetClass: Class<Any!>)

Queries optional implemented facet.

ImageView?

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

TextView?

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

Boolean

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

Boolean

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

Boolean

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

Boolean

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

Boolean

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

Boolean

Inherited functions

From androidx.recyclerview.widget.RecyclerView.ViewHolder
Int

Returns the Adapter position of the item represented by this ViewHolder with respect to the RecyclerView's Adapter.

Int

This function is deprecated.

This method is confusing when adapters nest other adapters.

RecyclerView.Adapter<RecyclerView.ViewHolder!>?

Returns the Adapter that last bound this ViewHolder.

Int

Returns the Adapter position of the item represented by this ViewHolder with respect to the Adapter that bound it.

Long

Returns The itemId represented by this ViewHolder.

Int
Int

Returns the position of the ViewHolder in terms of the latest layout pass.

Int

When LayoutManager supports animations, RecyclerView tracks 3 positions for ViewHolders to perform animations.

Int

This function is deprecated.

This method is deprecated because its meaning is ambiguous due to the async handling of adapter updates.

Boolean
Unit
setIsRecyclable(recyclable: Boolean)

Informs the recycler whether this item can be recycled.

String!

Public constructors

ViewHolder

Added in 1.1.0
ViewHolder(v: View)

Constructs an ViewHolder and caches the relevant subviews.

ViewHolder

Added in 1.1.0
ViewHolder(v: View, isSubAction: Boolean)

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

Public functions

getAction

Added in 1.1.0
fun getAction(): GuidedAction?
Returns
GuidedAction?

Currently bound action.

getCheckmarkView

Added in 1.1.0
fun getCheckmarkView(): ImageView?

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

getChevronView

Added in 1.1.0
fun getChevronView(): ImageView?

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

getContentView

Added in 1.1.0
fun getContentView(): View?

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

getDescriptionView

Added in 1.1.0
fun getDescriptionView(): TextView?

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

getEditableDescriptionView

Added in 1.1.0
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

Added in 1.1.0
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

Added in 1.1.0
fun getEditingView(): View?
Returns
View?

Current editing title view or description view or activator view or null if not in editing.

getFacet

Added in 1.2.0-alpha04
fun getFacet(facetClass: Class<Any!>): Any?

Queries optional implemented facet.

Parameters
facetClass: Class<Any!>

Facet classes to query, examples are: class of ItemAlignmentFacet.

Returns
Any?

Facet implementation for the facetClass or null if feature not implemented.

getIconView

Added in 1.1.0
fun getIconView(): ImageView?

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

getTitleView

Added in 1.1.0
fun getTitleView(): TextView?

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

isInEditing

Added in 1.1.0
fun isInEditing(): Boolean

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

isInEditingActivatorView

Added in 1.1.0
fun isInEditingActivatorView(): Boolean

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

isInEditingDescription

Added in 1.1.0
fun isInEditingDescription(): Boolean

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

isInEditingText

Added in 1.1.0
fun isInEditingText(): Boolean

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

Returns
Boolean

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

isInEditingTitle

Added in 1.1.0
fun isInEditingTitle(): Boolean

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

isSubAction

Added in 1.1.0
fun isSubAction(): Boolean
Returns
Boolean

True if bound action is inside getSubActions, false otherwise.