app / de.uniks.codliners.stock_simulator.ui.search / SearchViewModel

SearchViewModel

class SearchViewModel : ViewModel

The ViewModel of SearchFragment.

Parameters

application - The context used for creating the SymbolRepository.

Types

Factory

Factory for the SearchViewModel.

class Factory : Factory

Constructors

<init>

The ViewModel of SearchFragment.

SearchViewModel(application: Application)

Properties

filteredSymbols

The locally stored symbols filtered by the symbol, name and type.

val filteredSymbols: LiveData<List<Symbol>>

hasNoResults

Contains true if filteredSymbols contains no Symbols and isBusy contains false or false otherwise

val hasNoResults: LiveData<Boolean>

hasResults

Contains true if filteredSymbols contains at least one Symbol or false otherwise

val hasResults: LiveData<Boolean>

isBusy

Contains true while the repository is filtering. Has to be manually reset by running onFilteredSymbolsApplied, once the filtered Symbol has been applied.

val isBusy: LiveData<Boolean>

onFilteredSymbolsApplied

Resets isBusy to false. Should be called once filteredSymbols-changes have been applied (submitted to the adapter).

val onFilteredSymbolsApplied: Runnable

searchQuery

The search query used for filtering symbols.

val searchQuery: MutableLiveData<String>

typeFilter

The type filter used for filtering symbols.

val typeFilter: MutableLiveData<String>