소스 검색

Merge pull request #11503 from t895/stateflow-patch

android: Delay collecting UI state in games fragment
Charles Lombardo 2 년 전
부모
커밋
0c55248f92
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt

+ 4 - 4
src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/GamesFragment.kt

@@ -93,12 +93,12 @@ class GamesFragment : Fragment() {
 
         viewLifecycleOwner.lifecycleScope.apply {
             launch {
-                repeatOnLifecycle(Lifecycle.State.CREATED) {
+                repeatOnLifecycle(Lifecycle.State.RESUMED) {
                     gamesViewModel.isReloading.collect { binding.swipeRefresh.isRefreshing = it }
                 }
             }
             launch {
-                repeatOnLifecycle(Lifecycle.State.CREATED) {
+                repeatOnLifecycle(Lifecycle.State.RESUMED) {
                     gamesViewModel.games.collect {
                         (binding.gridGames.adapter as GameAdapter).submitList(it)
                         if (it.isEmpty()) {
@@ -110,7 +110,7 @@ class GamesFragment : Fragment() {
                 }
             }
             launch {
-                repeatOnLifecycle(Lifecycle.State.CREATED) {
+                repeatOnLifecycle(Lifecycle.State.RESUMED) {
                     gamesViewModel.shouldSwapData.collect {
                         if (it) {
                             (binding.gridGames.adapter as GameAdapter).submitList(
@@ -122,7 +122,7 @@ class GamesFragment : Fragment() {
                 }
             }
             launch {
-                repeatOnLifecycle(Lifecycle.State.CREATED) {
+                repeatOnLifecycle(Lifecycle.State.RESUMED) {
                     gamesViewModel.shouldScrollToTop.collect {
                         if (it) {
                             scrollToTop()