app / com.ocean.ishareeconomy_android.adapters / LendingDetailAdapter

LendingDetailAdapter

class LendingDetailAdapter : Adapter<ViewHolder>

Part of adapters.

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

Constructors

<init>

Part of adapters.

LendingDetailAdapter()

Properties

context

: Context? Store parent context, needed to fetch colors

var context: Context?

lendObject

: LendingObject The object that our Adapter will show the details of

var lendObject: LendingObject?

owner

var owner: ObjectOwner?

user

var user: ObjectUser?

Functions

getItemCount

Determines how many items need to be drawn

fun getItemCount(): Int

getItemViewType

Called when RecyclerView needs a new RecyclerView.ViewHolder to determine the type of item.

fun getItemViewType(position: Int): Int

onBindViewHolder

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

fun onBindViewHolder(holder: ViewHolder, 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): ViewHolder