app / de.uniks.codliners.stock_simulator.ui.stockbrot / StockbrotQuoteListAdapter

StockbrotQuoteListAdapter

class StockbrotQuoteListAdapter : ListAdapter<StockbrotQuote, ViewHolder>

The adapter that inserts StockbrotQuotes into a RecyclerView.

Author
Lucas Held

Types

DiffCallback

DiffUtil.ItemCallback for StockbrotQuotes.

companion object DiffCallback : ItemCallback<StockbrotQuote>

ViewHolder

RecyclerView.ViewHolder for CardStockbrotQuoteBinding.

inner class ViewHolder : ViewHolder

Constructors

<init>

The adapter that inserts StockbrotQuotes into a RecyclerView.

StockbrotQuoteListAdapter(onClickListener: OnClickListener<StockbrotQuote>)

Functions

onBindViewHolder

Binds a StockbrotQuote to a ViewHolder.

fun onBindViewHolder(holder: ViewHolder, position: Int): Unit

onCreateViewHolder

Creates a ViewHolder by inflating a CardStockbrotQuoteBinding.

fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder

Companion Object Functions

areContentsTheSame

Checks if two StockbrotQuotes are equal.

fun areContentsTheSame(oldItem: StockbrotQuote, newItem: StockbrotQuote): Boolean

areItemsTheSame

Checks if two StockbrotQuotes have the same id.

fun areItemsTheSame(oldItem: StockbrotQuote, newItem: StockbrotQuote): Boolean