HeaderFooterAdapter

A RecyclerView.Adapter that allows for adding header and footer views to a wrapped adapter.

This adapter acts as a wrapper around another AbsAdapter and provides functionality to prepend header views and append footer views to the list displayed by the RecyclerView.

Parameters

wrappedAdapter

The AbsAdapter that this adapter will wrap. This adapter will display the items from the wrapped adapter along with any added headers and footers.

Constructors

Link copied to clipboard
constructor(wrappedAdapter: AbsAdapter)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun addFooter(view: View, roundedCorners: Int = ROUNDED_CORNER_NONE)

Adds a footer view to the adapter.

Link copied to clipboard
fun addHeader(view: View, roundedCorners: Int = ROUNDED_CORNER_NONE)

Adds a header view to the adapter.

Link copied to clipboard

Clears all footer views from the adapter.

Link copied to clipboard

Remove all headers from the list.

Link copied to clipboard
open override fun getAppInfo(position: Int): ViewData?

Returns the ViewData at the given position, or null if not available.

Link copied to clipboard

The filtered data set backing the adapter.

Link copied to clipboard
open override fun getFilter(): Filter
Link copied to clipboard
fun getItem(position: Int): ViewData?

Retrieves the ViewData associated with the item at the specified position.

Link copied to clipboard
open override fun getItemCount(): Int
Link copied to clipboard
open override fun getItemId(position: Int): Long
Link copied to clipboard
open override fun getItemViewType(position: Int): Int
Link copied to clipboard
fun getPosition(appInfo: AppInfo): Int
Link copied to clipboard
open override fun getPositionForSection(sectionIndex: Int): Int
Link copied to clipboard
open override fun getSectionForPosition(position: Int): Int
Link copied to clipboard
open override fun getSections(): Array<Any>
Link copied to clipboard
open override fun onAttachedToRecyclerView(recyclerView: RecyclerView)
Link copied to clipboard
open override fun onBindViewHolder(holder: PickerViewHolder, position: Int)
Link copied to clipboard
fun onBindViewHolder2(holder: PickerViewHolder, position: Int, payloads: List<Any>)

This method is similar to onBindViewHolder but ensures that partial bind with payload won't be applied for headers and footers.

Link copied to clipboard
open override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PickerViewHolder
Link copied to clipboard
open override fun onDetachedFromRecyclerView(recyclerView: RecyclerView)
Link copied to clipboard

Sets the listener to be invoked when a view holder is bound.

Link copied to clipboard

Sets the search filter listener for the picker view.

Link copied to clipboard
open override fun submitList(itemList: List<ViewData>)

Submits a new list of items to the adapter.

Link copied to clipboard
open override fun updateItem(viewData: ViewData)

Updates the given item in the adapter.