diff options
| -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 | } |