app / com.ocean.ishareeconomy_android.viewmodels / LendObjectViewModel

LendObjectViewModel

open class LendObjectViewModel

Part of viewmodels.

The viewmodel that is used to display individual items of type LendingObject, it's a simple abstraction that holds the LendingObject and the icon background color ColorDrawable, the latter is determined by the viewAdapter. Also responsible for determining the object's icon

Constructors

<init>

Part of viewmodels.

LendObjectViewModel(data: LendingObject, context: Context)

Properties

context

val context: Context

description

val description: String

name

val name: String

numberOfUsers

val numberOfUsers: String

Functions

color

Method that returns a background color for the lendobject's type icon, depending on it's state:

fun color(): ColorDrawable

getLendObject

fun getLendObject(): LendingObject

type

Returns the icon that correspond to the LendObjectType of data

fun type(): Int