mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Merge pull request #11503 from t895/stateflow-patch
android: Delay collecting UI state in games fragment
This commit is contained in:
commit
0c55248f92
1 changed files with 4 additions and 4 deletions
|
@ -93,12 +93,12 @@ class GamesFragment : Fragment() {
|
||||||
|
|
||||||
viewLifecycleOwner.lifecycleScope.apply {
|
viewLifecycleOwner.lifecycleScope.apply {
|
||||||
launch {
|
launch {
|
||||||
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
repeatOnLifecycle(Lifecycle.State.RESUMED) {
|
||||||
gamesViewModel.isReloading.collect { binding.swipeRefresh.isRefreshing = it }
|
gamesViewModel.isReloading.collect { binding.swipeRefresh.isRefreshing = it }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
launch {
|
launch {
|
||||||
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
repeatOnLifecycle(Lifecycle.State.RESUMED) {
|
||||||
gamesViewModel.games.collect {
|
gamesViewModel.games.collect {
|
||||||
(binding.gridGames.adapter as GameAdapter).submitList(it)
|
(binding.gridGames.adapter as GameAdapter).submitList(it)
|
||||||
if (it.isEmpty()) {
|
if (it.isEmpty()) {
|
||||||
|
@ -110,7 +110,7 @@ class GamesFragment : Fragment() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
launch {
|
launch {
|
||||||
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
repeatOnLifecycle(Lifecycle.State.RESUMED) {
|
||||||
gamesViewModel.shouldSwapData.collect {
|
gamesViewModel.shouldSwapData.collect {
|
||||||
if (it) {
|
if (it) {
|
||||||
(binding.gridGames.adapter as GameAdapter).submitList(
|
(binding.gridGames.adapter as GameAdapter).submitList(
|
||||||
|
@ -122,7 +122,7 @@ class GamesFragment : Fragment() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
launch {
|
launch {
|
||||||
repeatOnLifecycle(Lifecycle.State.CREATED) {
|
repeatOnLifecycle(Lifecycle.State.RESUMED) {
|
||||||
gamesViewModel.shouldScrollToTop.collect {
|
gamesViewModel.shouldScrollToTop.collect {
|
||||||
if (it) {
|
if (it) {
|
||||||
scrollToTop()
|
scrollToTop()
|
||||||
|
|
Loading…
Reference in a new issue