Loading app/src/main/java/foundation/e/apps/search/SearchFragment.kt +6 −1 Original line number Diff line number Diff line Loading @@ -290,13 +290,18 @@ class SearchFragment : updateProgressOfInstallingApps(it) } if (searchText.isNotEmpty()) { if (shouldRefreshData()) { mainActivityViewModel.authData.value?.let { refreshData(it) } } } private fun shouldRefreshData() = searchText.isNotEmpty() && recyclerView?.adapter != null && searchViewModel.hasAnyAppInstallStatusChanged( (recyclerView?.adapter as ApplicationListRVAdapter).currentList ) override fun onPause() { binding.shimmerLayout.stopShimmer() super.onPause() Loading app/src/main/java/foundation/e/apps/search/SearchViewModel.kt +17 −1 Original line number Diff line number Diff line Loading @@ -29,13 +29,16 @@ import foundation.e.apps.api.ResultSupreme import foundation.e.apps.api.fused.FusedAPIRepository import foundation.e.apps.api.fused.data.FusedApp import foundation.e.apps.home.model.HomeChildFusedAppDiffUtil import foundation.e.apps.manager.pkg.PkgManagerModule import foundation.e.apps.utils.enums.Status import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import javax.inject.Inject @HiltViewModel class SearchViewModel @Inject constructor( private val fusedAPIRepository: FusedAPIRepository private val fusedAPIRepository: FusedAPIRepository, private val pkgManagerModule: PkgManagerModule ) : ViewModel() { val searchSuggest: MutableLiveData<List<SearchSuggestEntry>?> = MutableLiveData() Loading Loading @@ -81,4 +84,17 @@ class SearchViewModel @Inject constructor( } return false } fun hasAnyAppInstallStatusChanged(currentList: List<FusedApp>): Boolean { currentList.forEach { if (it.status == Status.INSTALLATION_ISSUE) { return@forEach } val currentAppStatus = pkgManagerModule.getPackageStatus(it.package_name, it.latest_version_code) if (it.status != currentAppStatus) { return true } } return false } } Loading
app/src/main/java/foundation/e/apps/search/SearchFragment.kt +6 −1 Original line number Diff line number Diff line Loading @@ -290,13 +290,18 @@ class SearchFragment : updateProgressOfInstallingApps(it) } if (searchText.isNotEmpty()) { if (shouldRefreshData()) { mainActivityViewModel.authData.value?.let { refreshData(it) } } } private fun shouldRefreshData() = searchText.isNotEmpty() && recyclerView?.adapter != null && searchViewModel.hasAnyAppInstallStatusChanged( (recyclerView?.adapter as ApplicationListRVAdapter).currentList ) override fun onPause() { binding.shimmerLayout.stopShimmer() super.onPause() Loading
app/src/main/java/foundation/e/apps/search/SearchViewModel.kt +17 −1 Original line number Diff line number Diff line Loading @@ -29,13 +29,16 @@ import foundation.e.apps.api.ResultSupreme import foundation.e.apps.api.fused.FusedAPIRepository import foundation.e.apps.api.fused.data.FusedApp import foundation.e.apps.home.model.HomeChildFusedAppDiffUtil import foundation.e.apps.manager.pkg.PkgManagerModule import foundation.e.apps.utils.enums.Status import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import javax.inject.Inject @HiltViewModel class SearchViewModel @Inject constructor( private val fusedAPIRepository: FusedAPIRepository private val fusedAPIRepository: FusedAPIRepository, private val pkgManagerModule: PkgManagerModule ) : ViewModel() { val searchSuggest: MutableLiveData<List<SearchSuggestEntry>?> = MutableLiveData() Loading Loading @@ -81,4 +84,17 @@ class SearchViewModel @Inject constructor( } return false } fun hasAnyAppInstallStatusChanged(currentList: List<FusedApp>): Boolean { currentList.forEach { if (it.status == Status.INSTALLATION_ISSUE) { return@forEach } val currentAppStatus = pkgManagerModule.getPackageStatus(it.package_name, it.latest_version_code) if (it.status != currentAppStatus) { return true } } return false } }