OptionViewModel
constructor(imageDescriptor: ImageDescriptor? = null, description: StringResolver? = null, onClick: () -> Unit? = null)
A convenience constructor for creating a OptionViewModel with non-live data.
Parameters
imageDescriptor
The information to display in the image field. When set to null
, the image field will not be visible.
description
A StringResolver for the text in the option. When set to null
, no text will be displayed.
onClick
The callback to be invoked when the option is clicked.
constructor(imageDescriptor: LiveData<ImageDescriptor?> = EmptyLiveData(), description: LiveData<StringResolver?> = EmptyLiveData(), onClick: LiveData<() -> Unit?> = EmptyLiveData())
Parameters
imageDescriptor
The information to display in the image field. When set to null
, the image field will not be visible.
description
A StringResolver for the text in the option. When set to null
, no text will be displayed.
onClick
The callback to be invoked when the option is clicked.