Skip to content

Instantly share code, notes, and snippets.

@Abdillah
Last active February 25, 2019 12:16
Show Gist options
  • Select an option

  • Save Abdillah/93b3b6d1f14a3443a6ffd9dadc76ba5a to your computer and use it in GitHub Desktop.

Select an option

Save Abdillah/93b3b6d1f14a3443a6ffd9dadc76ba5a to your computer and use it in GitHub Desktop.

View

Focus on the following code. https://github.com/HabitRPG/habitica-android/blob/def26be8222fd5df49c7af03b1c4b4eec8666c64/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/tasks/TasksFragment.kt#L146-L162 The code handle filtering action and trigger Adaptor to be updated.

Local Database

The model is on here. The repository is on here and use Realm.IO. In quick view, I see the Realm act as cache. For example in this repository, the tag from online database is synched with the local, by deleting unexist tags. After created, repository needs to be registered in this factory or provider class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment