public class PreferenceViewHolder extends RecyclerView.ViewHolder
RecyclerView.ViewHolder
class which caches views associated
with the default Preference
layouts. Cached views can be retrieved by calling
findViewById(int)
.itemView
Modifier and Type | Method and Description |
---|---|
View |
findViewById(int id)
Returns a cached reference to a subview managed by this object.
|
boolean |
isDividerAllowedAbove()
Dividers are only drawn between items if both items allow it, or above the first and below
the last item if that item allows it.
|
boolean |
isDividerAllowedBelow()
Dividers are only drawn between items if both items allow it, or above the first and below
the last item if that item allows it.
|
void |
setDividerAllowedAbove(boolean allowed)
Dividers are only drawn between items if both items allow it, or above the first and below
the last item if that item allows it.
|
void |
setDividerAllowedBelow(boolean allowed)
Dividers are only drawn between items if both items allow it, or above the first and below
the last item if that item allows it.
|
getAdapterPosition, getItemId, getItemViewType, getLayoutPosition, getOldPosition, getPosition, isRecyclable, setIsRecyclable, toString
public View findViewById(@IdRes int id)
View.findViewById(int)
and caches the result.id
- Resource ID of the view to findpublic boolean isDividerAllowedAbove()
public void setDividerAllowedAbove(boolean allowed)
Preference.onBindViewHolder(PreferenceViewHolder)
will set this to the
same value as returned by Preference.isSelectable()
, so that non-selectable items
do not have a divider drawn above them.allowed
- false to prevent dividers being drawn above this itempublic boolean isDividerAllowedBelow()
public void setDividerAllowedBelow(boolean allowed)
Preference.onBindViewHolder(PreferenceViewHolder)
will set this to the
same value as returned by Preference.isSelectable()
, so that non-selectable items
do not have a divider drawn below them.allowed
- false to prevent dividers being drawn below this item