GuidedActionsStylist.ViewHolder


public class GuidedActionsStylist.ViewHolder extends RecyclerView.ViewHolder implements 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(@NonNull View v, boolean isSubAction)

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

Public methods

@Nullable GuidedAction
@Nullable ImageView

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

@Nullable ImageView

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

@Nullable View

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

@Nullable TextView

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

@Nullable EditText

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

@Nullable EditText

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

@Nullable View
@Nullable Object
getFacet(@NonNull Class<Object> facetClass)

Queries optional implemented facet.

@Nullable ImageView

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

@Nullable 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 methods

From androidx.recyclerview.widget.RecyclerView.ViewHolder
final int

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

final int

This method is deprecated.

This method is confusing when adapters nest other adapters.

final @Nullable RecyclerView.Adapter<RecyclerView.ViewHolder>

Returns the Adapter that last bound this ViewHolder.

final int

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

final long

Returns The itemId represented by this ViewHolder.

final int
final int

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

final int

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

final int

This method is deprecated.

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

final boolean
final void
setIsRecyclable(boolean recyclable)

Informs the recycler whether this item can be recycled.

String

Public constructors

ViewHolder

Added in 1.1.0
public ViewHolder(@NonNull View v)

Constructs an ViewHolder and caches the relevant subviews.

ViewHolder

Added in 1.1.0
public ViewHolder(@NonNull View v, boolean isSubAction)

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

Public methods

getAction

Added in 1.1.0
public @Nullable GuidedAction getAction()
Returns
@Nullable GuidedAction

Currently bound action.

getCheckmarkView

Added in 1.1.0
public @Nullable ImageView getCheckmarkView()

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

getChevronView

Added in 1.1.0
public @Nullable ImageView getChevronView()

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

getContentView

Added in 1.1.0
public @Nullable View getContentView()

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

getDescriptionView

Added in 1.1.0
public @Nullable TextView getDescriptionView()

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

getEditableDescriptionView

Added in 1.1.0
public @Nullable EditText getEditableDescriptionView()

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
public @Nullable EditText getEditableTitleView()

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
public @Nullable View getEditingView()
Returns
@Nullable View

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

getFacet

Added in 1.2.0-alpha04
public @Nullable Object getFacet(@NonNull Class<Object> facetClass)

Queries optional implemented facet.

Parameters
@NonNull Class<Object> facetClass

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

Returns
@Nullable Object

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

getIconView

Added in 1.1.0
public @Nullable ImageView getIconView()

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

getTitleView

Added in 1.1.0
public @Nullable TextView getTitleView()

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

isInEditing

Added in 1.1.0
public boolean isInEditing()

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

isInEditingActivatorView

Added in 1.1.0
public boolean isInEditingActivatorView()

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

isInEditingDescription

Added in 1.1.0
public boolean isInEditingDescription()

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

isInEditingText

Added in 1.1.0
public boolean isInEditingText()

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
public boolean isInEditingTitle()

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

isSubAction

Added in 1.1.0
public boolean isSubAction()
Returns
boolean

True if bound action is inside getSubActions, false otherwise.