CaptureViewModel

class CaptureViewModel(application: Application) : AndroidViewModel

ViewModel that provides two way data bindings for CaptureModel. Use this class to retrieve/manipulate data stored in CaptureModel.

See also

MVVM Architecture For more information about how this software architectural pattern works.

Constructors

CaptureViewModel
Link copied to clipboard
fun CaptureViewModel(application: Application)

An instance of the current Application

Types

Factory
Link copied to clipboard
internal class Factory(application: Application) : ViewModelProvider.Factory

Factory to initiate this CaptureViewModel

Functions

clear
Link copied to clipboard
private fun clear()

Clears all properties of CaptureModel.

getCameraImage
Link copied to clipboard
fun getCameraImage(): Bitmap?

Getter that returns the value of cameraImage

getCroppedScreenshot
Link copied to clipboard
fun getCroppedScreenshot(): Bitmap?

Getter that returns the value of croppedScreenshot

getFullScreenshot
Link copied to clipboard
fun getFullScreenshot(): Bitmap?

Getter that returns the value of fullScreenshot

getLiveDataCameraImage
Link copied to clipboard
fun getLiveDataCameraImage(): MutableLiveData<Bitmap>

Getter that returns cameraImage as MutableLiveData

getLiveDataCroppedScreenshot
Link copied to clipboard
fun getLiveDataCroppedScreenshot(): MutableLiveData<Bitmap>

Getter that returns croppedScreenshot as MutableLiveData

getLiveDataFullScreenshot
Link copied to clipboard
fun getLiveDataFullScreenshot(): MutableLiveData<Bitmap>

Getter that returns fullScreenshot as MutableLiveData

getLiveDataServerURL
Link copied to clipboard
fun getLiveDataServerURL(): MutableLiveData<String>

Getter that returns serverURL as MutableLiveData

getMatchID
Link copied to clipboard
fun getMatchID(): String?

Getter that returns the value of matchID.

getServerUrl
Link copied to clipboard
fun getServerUrl(): String?
loadFullScreenshot
Link copied to clipboard
fun loadFullScreenshot()

Requests the full screenshot from the server and calls onDownloadFullScreenshot

onDownloadFullScreenshot
Link copied to clipboard
private fun onDownloadFullScreenshot(fullScreenshot: Bitmap?)

Callback that updates fullScreenshot with fullScreenshot.

setCaptureRequestData
Link copied to clipboard
fun setCaptureRequestData(serverURL: String, cameraImage: Bitmap)

Set the data of a new capture request.

setCaptureResultData
Link copied to clipboard
fun setCaptureResultData(matchID: String, croppedScreenshot: Bitmap?)

Set the data of a capture request response

Properties

cameraImage
Link copied to clipboard
private val cameraImage: MutableLiveData<Bitmap>

Data binding for CaptureModel.cameraImage

croppedScreenshot
Link copied to clipboard
private val croppedScreenshot: MutableLiveData<Bitmap>
fullScreenshot
Link copied to clipboard
private val fullScreenshot: MutableLiveData<Bitmap>
matchID
Link copied to clipboard
private val matchID: MutableLiveData<String>

Data binding for CaptureModel.matchID

serverURL
Link copied to clipboard
private val serverURL: MutableLiveData<String>

Data binding for CaptureModel.serverURL