Skip to content

Instantly share code, notes, and snippets.

@joecks
Created August 18, 2017 16:38
Show Gist options
  • Save joecks/8a4a8c3e3078523a77a968ae8e407bdd to your computer and use it in GitHub Desktop.
Save joecks/8a4a8c3e3078523a77a968ae8e407bdd to your computer and use it in GitHub Desktop.
public class TasksViewModel extends AndroidViewModel {
// These observable fields will update Views automatically
public final ObservableList<Task> items = new ObservableArrayList<>();
public final ObservableBoolean dataLoading = new ObservableBoolean(false);
public final ObservableField<String> currentFilteringLabel = new ObservableField<>();
public final ObservableField<String> noTasksLabel = new ObservableField<>();
public final ObservableField<Drawable> noTaskIconRes = new ObservableField<>();
public final ObservableBoolean empty = new ObservableBoolean(false);
public final ObservableBoolean tasksAddViewVisible = new ObservableBoolean();
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment