SHARE
TWEET

Untitled

a guest Apr 21st, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top