Loading app/src/main/java/io/eelo/appinstaller/categories/category/CategoryActivity.kt +8 −5 Original line number Diff line number Diff line Loading @@ -102,14 +102,17 @@ class CategoryActivity : AppCompatActivity(), ApplicationManagerServiceConnectio // Bind to the screen error categoryViewModel.getScreenError().observe(this, Observer { if (it != null) { if (!isLoadingMoreApplications) { errorDescription.text = getString(it.description) errorContainer.visibility = View.VISIBLE progressBar.visibility = View.GONE loadMoreContainer.visibility = View.GONE } else { isLoadingMoreApplications = false } } else { errorContainer.visibility = View.GONE } isLoadingMoreApplications = false }) applicationManagerServiceConnection.bindService(this) Loading app/src/main/java/io/eelo/appinstaller/categories/category/model/CategoryModel.kt +5 −13 Original line number Diff line number Diff line Loading @@ -40,20 +40,12 @@ class CategoryModel : CategoryModelInterface { categoryApplicationsList.value = result } } else { if (page == 1) { screenError.value = error } else { screenError.value = null } } }) page++ } else { if (page == 1) { screenError.value = Error.NO_INTERNET } else { screenError.value = null } } } Loading @@ -70,10 +62,10 @@ class CategoryModel : CategoryModelInterface { } } } if (listApplications != null) { return listApplications!!.getApplications(applicationManager, context) return if (listApplications != null) { listApplications!!.getApplications(applicationManager, context) } else { return null null } } Loading app/src/main/java/io/eelo/appinstaller/search/SearchFragment.kt +8 −5 Original line number Diff line number Diff line Loading @@ -130,14 +130,17 @@ class SearchFragment : Fragment(), SearchView.OnQueryTextListener, SearchView.On // Bind to the screen error searchViewModel.getScreenError().observe(this, Observer { if (it != null) { if (!isLoadingMoreApplications) { errorDescription.text = activity!!.getString(it.description) errorContainer.visibility = View.VISIBLE progressBar.visibility = View.GONE loadMoreContainer.visibility = View.GONE } else { isLoadingMoreApplications = false } } else { errorContainer.visibility = View.GONE } isLoadingMoreApplications = false }) // Handle suggestion clicks Loading app/src/main/java/io/eelo/appinstaller/search/model/SearchModel.kt +3 −13 Original line number Diff line number Diff line Loading @@ -47,11 +47,7 @@ class SearchModel : SearchModelInterface { SearchElement(searchQuery, pageNumber, applicationManager!!, this) .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, context) } else { if (pageNumber == 1) { screenError.value = Error.NO_INTERNET } else { screenError.value = null } } } Loading @@ -64,17 +60,11 @@ class SearchModel : SearchModelInterface { } else { this.applicationList.value = applicationList } if (applicationList.isEmpty() && pageNumber == 1) { if (applicationList.isEmpty()) { screenError.value = Error.NO_RESULTS } else { screenError.value = null } } else { if (pageNumber == 1) { screenError.value = error } else { screenError.value = null } } } } Loading
app/src/main/java/io/eelo/appinstaller/categories/category/CategoryActivity.kt +8 −5 Original line number Diff line number Diff line Loading @@ -102,14 +102,17 @@ class CategoryActivity : AppCompatActivity(), ApplicationManagerServiceConnectio // Bind to the screen error categoryViewModel.getScreenError().observe(this, Observer { if (it != null) { if (!isLoadingMoreApplications) { errorDescription.text = getString(it.description) errorContainer.visibility = View.VISIBLE progressBar.visibility = View.GONE loadMoreContainer.visibility = View.GONE } else { isLoadingMoreApplications = false } } else { errorContainer.visibility = View.GONE } isLoadingMoreApplications = false }) applicationManagerServiceConnection.bindService(this) Loading
app/src/main/java/io/eelo/appinstaller/categories/category/model/CategoryModel.kt +5 −13 Original line number Diff line number Diff line Loading @@ -40,20 +40,12 @@ class CategoryModel : CategoryModelInterface { categoryApplicationsList.value = result } } else { if (page == 1) { screenError.value = error } else { screenError.value = null } } }) page++ } else { if (page == 1) { screenError.value = Error.NO_INTERNET } else { screenError.value = null } } } Loading @@ -70,10 +62,10 @@ class CategoryModel : CategoryModelInterface { } } } if (listApplications != null) { return listApplications!!.getApplications(applicationManager, context) return if (listApplications != null) { listApplications!!.getApplications(applicationManager, context) } else { return null null } } Loading
app/src/main/java/io/eelo/appinstaller/search/SearchFragment.kt +8 −5 Original line number Diff line number Diff line Loading @@ -130,14 +130,17 @@ class SearchFragment : Fragment(), SearchView.OnQueryTextListener, SearchView.On // Bind to the screen error searchViewModel.getScreenError().observe(this, Observer { if (it != null) { if (!isLoadingMoreApplications) { errorDescription.text = activity!!.getString(it.description) errorContainer.visibility = View.VISIBLE progressBar.visibility = View.GONE loadMoreContainer.visibility = View.GONE } else { isLoadingMoreApplications = false } } else { errorContainer.visibility = View.GONE } isLoadingMoreApplications = false }) // Handle suggestion clicks Loading
app/src/main/java/io/eelo/appinstaller/search/model/SearchModel.kt +3 −13 Original line number Diff line number Diff line Loading @@ -47,11 +47,7 @@ class SearchModel : SearchModelInterface { SearchElement(searchQuery, pageNumber, applicationManager!!, this) .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, context) } else { if (pageNumber == 1) { screenError.value = Error.NO_INTERNET } else { screenError.value = null } } } Loading @@ -64,17 +60,11 @@ class SearchModel : SearchModelInterface { } else { this.applicationList.value = applicationList } if (applicationList.isEmpty() && pageNumber == 1) { if (applicationList.isEmpty()) { screenError.value = Error.NO_RESULTS } else { screenError.value = null } } else { if (pageNumber == 1) { screenError.value = error } else { screenError.value = null } } } }