Browse Source
Merge pull request #12426 from t895/reload-text-fix
android: Fix "No games found" text appearing on load
pull/15/merge
liamwhite
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
6 deletions
-
src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt
|
|
|
@ -91,18 +91,20 @@ class GamesFragment : Fragment() { |
|
|
|
viewLifecycleOwner.lifecycleScope.apply { |
|
|
|
launch { |
|
|
|
repeatOnLifecycle(Lifecycle.State.RESUMED) { |
|
|
|
gamesViewModel.isReloading.collect { binding.swipeRefresh.isRefreshing = it } |
|
|
|
gamesViewModel.isReloading.collect { |
|
|
|
binding.swipeRefresh.isRefreshing = it |
|
|
|
if (gamesViewModel.games.value.isEmpty() && !it) { |
|
|
|
binding.noticeText.visibility = View.VISIBLE |
|
|
|
} else { |
|
|
|
binding.noticeText.visibility = View.INVISIBLE |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
launch { |
|
|
|
repeatOnLifecycle(Lifecycle.State.RESUMED) { |
|
|
|
gamesViewModel.games.collectLatest { |
|
|
|
(binding.gridGames.adapter as GameAdapter).submitList(it) |
|
|
|
if (it.isEmpty()) { |
|
|
|
binding.noticeText.visibility = View.VISIBLE |
|
|
|
} else { |
|
|
|
binding.noticeText.visibility = View.GONE |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|