LeanbackListPreferenceDialogFragment.AdapterMulti


inner class LeanbackListPreferenceDialogFragment.AdapterMulti : RecyclerView.Adapter<LeanbackListPreferenceDialogFragment.ViewHolder!>, LeanbackListPreferenceDialogFragment.ViewHolder.OnItemClickListener


Adapter for multiple choices.

Summary

Public constructors

AdapterMulti(
    entries: Array<CharSequence!>!,
    entryValues: Array<CharSequence!>!,
    initialSelections: (Mutable)Set<String!>!
)

This function is deprecated. Deprecated in Java

Public functions

Int

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

LeanbackListPreferenceDialogFragment.ViewHolder!
onCreateViewHolder(parent: ViewGroup!, viewType: Int)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Inherited functions

From androidx.recyclerview.widget.RecyclerView.Adapter
Unit
bindViewHolder(holder: VH, position: Int)

This function is deprecated. Deprecated in Java

VH
createViewHolder(parent: ViewGroup, viewType: Int)

This function is deprecated. Deprecated in Java

Int
findRelativeAdapterPositionIn(
    adapter: RecyclerView.Adapter<RecyclerView.ViewHolder!>,
    viewHolder: RecyclerView.ViewHolder,
    localPosition: Int
)

This function is deprecated. Deprecated in Java

Long
getItemId(position: Int)

This function is deprecated. Deprecated in Java

Int
getItemViewType(position: Int)

This function is deprecated. Deprecated in Java

RecyclerView.Adapter.StateRestorationPolicy

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
notifyItemChanged(position: Int, payload: Any?)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
notifyItemMoved(fromPosition: Int, toPosition: Int)

This function is deprecated. Deprecated in Java

Unit
notifyItemRangeChanged(positionStart: Int, itemCount: Int)

This function is deprecated. Deprecated in Java

Unit
notifyItemRangeChanged(positionStart: Int, itemCount: Int, payload: Any?)

This function is deprecated. Deprecated in Java

Unit
notifyItemRangeInserted(positionStart: Int, itemCount: Int)

This function is deprecated. Deprecated in Java

Unit
notifyItemRangeRemoved(positionStart: Int, itemCount: Int)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
onBindViewHolder(holder: VH, position: Int, payloads: (Mutable)List<Any!>)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Boolean

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
onViewRecycled(holder: VH)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit
setHasStableIds(hasStableIds: Boolean)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. Deprecated in Java

Public constructors

AdapterMulti

Added in 1.1.0
Deprecated in 1.1.0
AdapterMulti(
    entries: Array<CharSequence!>!,
    entryValues: Array<CharSequence!>!,
    initialSelections: (Mutable)Set<String!>!
)

Public functions

getItemCount

Added in 1.1.0
Deprecated in 1.1.0
fun getItemCount(): Int

Returns the total number of items in the data set held by the adapter.

Returns
Int

The total number of items in this adapter.

onBindViewHolder

Added in 1.1.0
Deprecated in 1.1.0
fun onBindViewHolder(
    holder: LeanbackListPreferenceDialogFragment.ViewHolder!,
    position: Int
): Unit

Called by RecyclerView to display the data at the specified position. This method should update the contents of the itemView to reflect the item at the given position.

Note that unlike android.widget.ListView, RecyclerView will not call this method again if the position of the item changes in the data set unless the item itself is invalidated or the new position cannot be determined. For this reason, you should only use the position parameter while acquiring the related data item inside this method and should not keep a copy of it. If you need the position of an item later on (e.g. in a click listener), use getBindingAdapterPosition which will have the updated adapter position. Override onBindViewHolder instead if Adapter can handle efficient partial bind.

Parameters
holder: LeanbackListPreferenceDialogFragment.ViewHolder!

The ViewHolder which should be updated to represent the contents of the item at the given position in the data set.

position: Int

The position of the item within the adapter's data set.

onCreateViewHolder

Added in 1.1.0
Deprecated in 1.1.0
fun onCreateViewHolder(parent: ViewGroup!, viewType: Int): LeanbackListPreferenceDialogFragment.ViewHolder!

Called when RecyclerView needs a new ViewHolder of the given type to represent an item.

This new ViewHolder should be constructed with a new View that can represent the items of the given type. You can either create a new View manually or inflate it from an XML layout file.

The new ViewHolder will be used to display items of the adapter using onBindViewHolder. Since it will be re-used to display different items in the data set, it is a good idea to cache references to sub views of the View to avoid unnecessary findViewById calls.

Parameters
parent: ViewGroup!

The ViewGroup into which the new View will be added after it is bound to an adapter position.

viewType: Int

The view type of the new View.

Returns
LeanbackListPreferenceDialogFragment.ViewHolder!

A new ViewHolder that holds a View of the given view type.

onItemClick

fun onItemClick(
    viewHolder: LeanbackListPreferenceDialogFragment.ViewHolder!
): Unit