app / com.ocean.ishareeconomy_android.adapters / LendObjectAdapter

LendObjectAdapter

class LendObjectAdapter : Adapter<LendObjectViewHolder>

Part of adapters.

RecyclerView Adapter for setting up data binding on the items in the list.

Constructors

<init>

Part of adapters.

LendObjectAdapter(callback: LendObjectClick)

Properties

callback

val callback: LendObjectClick

context

: Context? Store parent context, needed to fetch colors

var context: Context?

objects

: MutableList The LendingObject items that our Adapter will show

var objects: MutableList<LendingObject>

Functions

getItemCount

Determines how many items need to be drawn

fun getItemCount(): Int

onBindViewHolder

Called by RecyclerView to display the data at the specified position. This method should update the contents of the {@link ViewHolder#itemView} to reflect the item at the given position.

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

onCreateViewHolder

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

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