Loading app/src/main/java/foundation/e/apps/ui/home/HomeFragment.kt +0 −2 Original line number Diff line number Diff line Loading @@ -266,8 +266,6 @@ class HomeFragment : TimeoutFragment(R.layout.fragment_home), ApplicationInstall appProgressViewModel.downloadProgress.observe(viewLifecycleOwner) { updateProgressOfDownloadingAppItemViews(homeParentRVAdapter, it) } homeViewModel.checkAnyChangeInAppStatus() } override fun onPause() { Loading app/src/main/java/foundation/e/apps/ui/home/HomeViewModel.kt +0 −35 Original line number Diff line number Diff line Loading @@ -181,39 +181,4 @@ class HomeViewModel @Inject constructor( return false } fun checkAnyChangeInAppStatus() { if (this.currentHomes == null) { return } val fusedHomes: MutableList<Home> = mutableListOf() checkForChangesInAppStatus(fusedHomes) if (fusedHomes.isNotEmpty() && hasAnyChange(fusedHomes)) { homeScreenData.value = ResultSupreme.Success(fusedHomes) currentHomes = fusedHomes } } private fun checkForChangesInAppStatus(fusedHomes: MutableList<Home>) { var home: Home? = null this.currentHomes?.forEach { it.list.forEach { application -> val status = applicationRepository.getFusedAppInstallationStatus(application) if (application.status != status) { application.status = status home = it.copy() // Setting a new id, so that recyclerview can find that this item is changed home?.id = UUID.randomUUID().toString() } } fusedHomes.add(home ?: it) home = null } } } Loading
app/src/main/java/foundation/e/apps/ui/home/HomeFragment.kt +0 −2 Original line number Diff line number Diff line Loading @@ -266,8 +266,6 @@ class HomeFragment : TimeoutFragment(R.layout.fragment_home), ApplicationInstall appProgressViewModel.downloadProgress.observe(viewLifecycleOwner) { updateProgressOfDownloadingAppItemViews(homeParentRVAdapter, it) } homeViewModel.checkAnyChangeInAppStatus() } override fun onPause() { Loading
app/src/main/java/foundation/e/apps/ui/home/HomeViewModel.kt +0 −35 Original line number Diff line number Diff line Loading @@ -181,39 +181,4 @@ class HomeViewModel @Inject constructor( return false } fun checkAnyChangeInAppStatus() { if (this.currentHomes == null) { return } val fusedHomes: MutableList<Home> = mutableListOf() checkForChangesInAppStatus(fusedHomes) if (fusedHomes.isNotEmpty() && hasAnyChange(fusedHomes)) { homeScreenData.value = ResultSupreme.Success(fusedHomes) currentHomes = fusedHomes } } private fun checkForChangesInAppStatus(fusedHomes: MutableList<Home>) { var home: Home? = null this.currentHomes?.forEach { it.list.forEach { application -> val status = applicationRepository.getFusedAppInstallationStatus(application) if (application.status != status) { application.status = status home = it.copy() // Setting a new id, so that recyclerview can find that this item is changed home?.id = UUID.randomUUID().toString() } } fusedHomes.add(home ?: it) home = null } } }