diff options
| author | 2023-12-21 00:49:22 -0500 | |
|---|---|---|
| committer | 2023-12-21 00:49:22 -0500 | |
| commit | d3070cafa79109e1eb3dd69cc17ae69e1181b30d (patch) | |
| tree | 7c6c464db53f339b7cf54e3d49bbcd67beffedca | |
| parent | Merge pull request #12414 from jbeich/vk274 (diff) | |
| download | yuzu-d3070cafa79109e1eb3dd69cc17ae69e1181b30d.tar.gz yuzu-d3070cafa79109e1eb3dd69cc17ae69e1181b30d.tar.xz yuzu-d3070cafa79109e1eb3dd69cc17ae69e1181b30d.zip | |
android: Fix "No games found" text appearing on load
| -rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt | 14 |
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() { | |||
| 91 | viewLifecycleOwner.lifecycleScope.apply { | 91 | viewLifecycleOwner.lifecycleScope.apply { |
| 92 | launch { | 92 | launch { |
| 93 | repeatOnLifecycle(Lifecycle.State.RESUMED) { | 93 | repeatOnLifecycle(Lifecycle.State.RESUMED) { |
| 94 | gamesViewModel.isReloading.collect { binding.swipeRefresh.isRefreshing = it } | 94 | gamesViewModel.isReloading.collect { |
| 95 | binding.swipeRefresh.isRefreshing = it | ||
| 96 | if (gamesViewModel.games.value.isEmpty() && !it) { | ||
| 97 | binding.noticeText.visibility = View.VISIBLE | ||
| 98 | } else { | ||
| 99 | binding.noticeText.visibility = View.INVISIBLE | ||
| 100 | } | ||
| 101 | } | ||
| 95 | } | 102 | } |
| 96 | } | 103 | } |
| 97 | launch { | 104 | launch { |
| 98 | repeatOnLifecycle(Lifecycle.State.RESUMED) { | 105 | repeatOnLifecycle(Lifecycle.State.RESUMED) { |
| 99 | gamesViewModel.games.collectLatest { | 106 | gamesViewModel.games.collectLatest { |
| 100 | (binding.gridGames.adapter as GameAdapter).submitList(it) | 107 | (binding.gridGames.adapter as GameAdapter).submitList(it) |
| 101 | if (it.isEmpty()) { | ||
| 102 | binding.noticeText.visibility = View.VISIBLE | ||
| 103 | } else { | ||
| 104 | binding.noticeText.visibility = View.GONE | ||
| 105 | } | ||
| 106 | } | 108 | } |
| 107 | } | 109 | } |
| 108 | } | 110 | } |