summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-12-21 16:50:11 +0100
committerGitHub <noreply@github.com>2023-12-21 16:50:11 +0100
commit3a302712195a4ef07fff872d526e314ab04268b5 (patch)
tree7c6c464db53f339b7cf54e3d49bbcd67beffedca
parentMerge pull request #12414 from jbeich/vk274 (diff)
parentandroid: Fix "No games found" text appearing on load (diff)
downloadyuzu-3a302712195a4ef07fff872d526e314ab04268b5.tar
yuzu-3a302712195a4ef07fff872d526e314ab04268b5.tar.gz
yuzu-3a302712195a4ef07fff872d526e314ab04268b5.tar.bz2
yuzu-3a302712195a4ef07fff872d526e314ab04268b5.tar.lz
yuzu-3a302712195a4ef07fff872d526e314ab04268b5.tar.xz
yuzu-3a302712195a4ef07fff872d526e314ab04268b5.tar.zst
yuzu-3a302712195a4ef07fff872d526e314ab04268b5.zip
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt
index fc0eeb9ad..54380323e 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt
+++ b/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
- }
}
}
}