Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SearchSharedViewModel : ViewModel() {
- val searchQuery = MutableLiveData<String>()
- private val clubsRepo = FollowingClubsRepo()
- private val newsMyFeedRepo = NewsMyFeedRepo()
- var isClubsEmpty = MutableLiveData<Boolean>()
- var isNewsEmpty = MutableLiveData<Boolean>()
- fun setClubEmpty(value: Boolean) {
- isClubsEmpty.value = value
- }
- fun setNewsEmpty(value: Boolean) {
- isNewsEmpty.value = value
- }
- fun doNewsSearch(query: String?): LiveData<List<NewsMyFeedEntity>> {
- //TODO Replace with Search File Call
- isNewsEmpty.value = true
- return newsMyFeedRepo.newsFromDB
- }
- fun doClubSearch(query: String?): LiveData<List<ClubEntity>> {
- isClubsEmpty.value = true
- return clubsRepo.searchClubs(query)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement