Class SearchViewModel
-
- All Implemented Interfaces:
public final class SearchViewModel extends ViewModel
ViewModel responsible for searching for messages that match a particular search query.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classSearchViewModel.StateRepresents the search screen state, used to render the required UI.
-
Field Summary
Fields Modifier and Type Field Description private final LiveData<SearchViewModel.State>stateprivate final LiveData<Event<Unit>>errorEvents
-
Constructor Summary
Constructors Constructor Description SearchViewModel()
-
Method Summary
Modifier and Type Method Description final LiveData<SearchViewModel.State>getState()The current state of the search screen. final LiveData<Event<Unit>>getErrorEvents()One shot error events when search fails. final UnitsetQuery(String query)Changes the current query state. final UnitloadMore()Loads more data when the user reaches the end of the found message list. -
-
Method Detail
-
getState
final LiveData<SearchViewModel.State> getState()
The current state of the search screen.
-
getErrorEvents
final LiveData<Event<Unit>> getErrorEvents()
One shot error events when search fails.
-
-
-
-