PreferenceViewHolder
class PreferenceViewHolder : RecyclerView.ViewHolder
| kotlin.Any | ||
| ↳ | androidx.recyclerview.widget.RecyclerView.ViewHolder | |
| ↳ | androidx.preference.PreferenceViewHolder |
A RecyclerView.ViewHolder class which caches views associated with the default Preference layouts. Cached views can be retrieved by calling findViewById.
Summary
Public functions |
|
|---|---|
View! |
findViewById(id: @IdRes Int)Returns a cached reference to a subview managed by this object. |
Boolean |
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 |
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. |
Unit |
setDividerAllowedAbove(allowed: Boolean)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. |
Unit |
setDividerAllowedBelow(allowed: Boolean)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. |
Inherited functions |
||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public functions
findViewById
fun findViewById(id: @IdRes Int): View!
Returns a cached reference to a subview managed by this object. If the view reference is not yet cached, it falls back to calling findViewById and caches the result.
| Returns | |
|---|---|
View! |
The view, or |
isDividerAllowedAbove
fun isDividerAllowedAbove(): Boolean
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.
| Returns | |
|---|---|
Boolean |
|
isDividerAllowedBelow
fun isDividerAllowedBelow(): Boolean
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.
| Returns | |
|---|---|
Boolean |
|
setDividerAllowedAbove
fun setDividerAllowedAbove(allowed: Boolean): Unit
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. By default, onBindViewHolder will set this to the same value as returned by isSelectable, so that non-selectable items do not have a divider drawn above them.
| Parameters | |
|---|---|
allowed: Boolean |
False to prevent dividers being drawn above this item |
setDividerAllowedBelow
fun setDividerAllowedBelow(allowed: Boolean): Unit
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. By default, onBindViewHolder will set this to the same value as returned by isSelectable, so that non-selectable items do not have a divider drawn below them.
| Parameters | |
|---|---|
allowed: Boolean |
False to prevent dividers being drawn below this item |