Skip to content

Instantly share code, notes, and snippets.

@paulocns
Last active August 4, 2018 22:20
Show Gist options
  • Select an option

  • Save paulocns/302ffdf605f862147b5e72a9006362c6 to your computer and use it in GitHub Desktop.

Select an option

Save paulocns/302ffdf605f862147b5e72a9006362c6 to your computer and use it in GitHub Desktop.
public class QueryViewModelArc extends ViewModel {
private MutableLiveData<String> query = new MutableLiveData<>();
private MutableLiveData<Boolean> searchEnabled = new MutableLiveData<>();
private SearchShows searchShows;
@Inject
public QueryViewModelArc(SearchShows searchShows) {
this.searchShows = searchShows;
searchEnabled.setValue(false);
query.setValue("");
}
public MutableLiveData<Boolean> getSearchEnabled() {
return searchEnabled;
}
public MutableLiveData<String> getQuery() {
return query;
}
// your viewmodel stuff
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment