Created
May 8, 2018 15:54
-
-
Save yccheok/4bb6539c93fa39cf7dc7f08f0752d232 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class NoteViewModel extends ViewModel { | |
| private LiveData<List<Note>> notesLiveData; | |
| private LiveData<List<Note>> trashedNotesLiveData; | |
| private Note newNote; | |
| public NoteViewModel() { | |
| init(); | |
| } | |
| public void init() { | |
| // SELECT * FROM plain_note where trashed = 0 | |
| notesLiveData = NoteRepository.INSTANCE.getNotes(); | |
| // SELECT * FROM plain_note where trashed = 1 | |
| trashedNotesLiveData = NoteRepository.INSTANCE.getTrashedNotes(); | |
| } | |
| public LiveData<List<Note>> getNotesLiveData() { | |
| return notesLiveData; | |
| } | |
| public LiveData<List<Note>> getTrashedNotesLiveData() { | |
| return trashedNotesLiveData; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment