Guest User

Untitled

a guest
Mar 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. private fun fetchAllFacebookAlbums() {
  2. val subscription = socialPhotosViewModel.getAllFacebookAlbums()
  3. .subscribeOn(Schedulers.io())
  4. .observeOn(AndroidSchedulers.mainThread())
  5. .subscribe(
  6. {
  7. state = it
  8. },
  9. {
  10. Timber.e(it.message)
  11. }
  12. )
  13.  
  14. getCompositeSubscription().add(subscription)
  15. }
  16.  
  17. private fun fetchFacebookAlbum(albumId: String) {
  18. val subscription = socialPhotosViewModel.getFacebookAlbumFromId(albumId)
  19. .subscribeOn(Schedulers.io())
  20. .observeOn(AndroidSchedulers.mainThread())
  21. .subscribe(
  22. {
  23. state = it
  24. },
  25. {
  26. Timber.e(it.message)
  27. }
  28. )
  29.  
  30. getCompositeSubscription().add(subscription)
  31. }
  32.  
  33. private fun fetchInstagramPhotos(count: Int) {
  34. val subscription = socialPhotosViewModel.getInstagramPhotos(count)
  35. .subscribeOn(Schedulers.io())
  36. .observeOn(AndroidSchedulers.mainThread())
  37. .subscribe(
  38. {
  39. state = it
  40. },
  41. {
  42. Timber.e(it.message)
  43. }
  44. )
  45.  
  46. getCompositeSubscription().add(subscription)
  47. }
Add Comment
Please, Sign In to add comment