Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. class GitRepoLocalDataSource {
  2.  
  3. fun getRepositories(onRepositoryReadyCallback: OnRepoLocalReadyCallback) {
  4. var arrayList = ArrayList<Repository>()
  5. arrayList.add(Repository("First From Local", "Owner 1", 100, false))
  6. arrayList.add(Repository("Second From Local", "Owner 2", 30, true))
  7. arrayList.add(Repository("Third From Local", "Owner 3", 430, false))
  8.  
  9. Handler().postDelayed({ onRepositoryReadyCallback.onLocalDataReady(arrayList) }, 2000)
  10. }
  11.  
  12. fun saveRepositories(arrayList: ArrayList<Repository>){
  13. //todo save repositories in DB
  14. }
  15. }
  16.  
  17. interface OnRepoLocalReadyCallback {
  18. fun onLocalDataReady(data: ArrayList<Repository>)
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement