app / com.ocean.ishareeconomy_android.viewmodels / UsingViewModel

UsingViewModel

class UsingViewModel : AndroidViewModel

LendingViewModel designed to store and manage UI-related data in a lifecycle conscious way. This allows data to survive configuration changes such as screen rotations. In addition, background work such as fetching network results can continue through configuration changes and deliver results after the new Fragment or Activity is available.

Parameters

application - The application that this viewmodel is attached to, it's safe to hold a reference to applications across rotation since Application is never recreated during activity or fragment lifecycle events.

Types

Factory

Factory for constructing DevByteViewModel with parameter

class Factory : Factory

Constructors

<init>

LendingViewModel designed to store and manage UI-related data in a lifecycle conscious way. This allows data to survive configuration changes such as screen rotations. In addition, background work such as fetching network results can continue through configuration changes and deliver results after the new Fragment or Activity is available.

UsingViewModel(application: Application, id: String, auth: String)

Properties

id

val id: String

using

val using: LiveData<List<LendingObject>>

Functions

onCleared

Cancel all coroutines when the ViewModel is cleared

fun onCleared(): Unit

selectObject

fun selectObject(lendObject: LendingObject?): Unit