Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. class SearchSharedViewModel : ViewModel() {
  2.  
  3. val searchQuery = MutableLiveData<String>()
  4. private val clubsRepo = FollowingClubsRepo()
  5. private val newsMyFeedRepo = NewsMyFeedRepo()
  6. var isClubsEmpty = MutableLiveData<Boolean>()
  7. var isNewsEmpty = MutableLiveData<Boolean>()
  8.  
  9. fun setClubEmpty(value: Boolean) {
  10. isClubsEmpty.value = value
  11. }
  12.  
  13. fun setNewsEmpty(value: Boolean) {
  14. isNewsEmpty.value = value
  15. }
  16.  
  17. fun doNewsSearch(query: String?): LiveData<List<NewsMyFeedEntity>> {
  18. //TODO Replace with Search File Call
  19. isNewsEmpty.value = true
  20. return newsMyFeedRepo.newsFromDB
  21. }
  22.  
  23. fun doClubSearch(query: String?): LiveData<List<ClubEntity>> {
  24. isClubsEmpty.value = true
  25. return clubsRepo.searchClubs(query)
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement