Loading app/src/main/java/io/eelo/appinstaller/search/SearchFragment.kt +7 −1 Original line number Diff line number Diff line Loading @@ -83,6 +83,13 @@ class SearchFragment : Fragment(), SearchView.OnQueryTextListener, SearchView.On recyclerView.setHasFixedSize(true) recyclerView.layoutManager = LinearLayoutManager(context) recyclerView.adapter = ApplicationListAdapter(activity!!, applicationList) recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { if (!recyclerView.canScrollVertically(1)) { searchViewModel.loadMore(context!!) } } }) // Bind search view suggestions adapter to search suggestions list in view model searchViewModel.getSuggestions().observe(this, Observer { Loading @@ -98,7 +105,6 @@ class SearchFragment : Fragment(), SearchView.OnQueryTextListener, SearchView.On applicationList.addAll(it) progressBar.visibility = View.GONE recyclerView.adapter.notifyDataSetChanged() recyclerView.scrollToPosition(0) if (applicationList.isEmpty()) { recyclerView.visibility = View.GONE } else { Loading app/src/main/java/io/eelo/appinstaller/search/model/SearchModel.kt +7 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,13 @@ class SearchModel : SearchModelInterface { override fun onSearchComplete(error: Error?, applicationList: ArrayList<Application>) { if (error == null) { if (pageNumber > 1 && this.applicationList.value != null) { val combinedAppList = this.applicationList.value!! combinedAppList.addAll(applicationList) this.applicationList.value = combinedAppList } else { this.applicationList.value = applicationList } if (applicationList.isEmpty()) { screenError.value = Error.NO_RESULTS } Loading Loading
app/src/main/java/io/eelo/appinstaller/search/SearchFragment.kt +7 −1 Original line number Diff line number Diff line Loading @@ -83,6 +83,13 @@ class SearchFragment : Fragment(), SearchView.OnQueryTextListener, SearchView.On recyclerView.setHasFixedSize(true) recyclerView.layoutManager = LinearLayoutManager(context) recyclerView.adapter = ApplicationListAdapter(activity!!, applicationList) recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { if (!recyclerView.canScrollVertically(1)) { searchViewModel.loadMore(context!!) } } }) // Bind search view suggestions adapter to search suggestions list in view model searchViewModel.getSuggestions().observe(this, Observer { Loading @@ -98,7 +105,6 @@ class SearchFragment : Fragment(), SearchView.OnQueryTextListener, SearchView.On applicationList.addAll(it) progressBar.visibility = View.GONE recyclerView.adapter.notifyDataSetChanged() recyclerView.scrollToPosition(0) if (applicationList.isEmpty()) { recyclerView.visibility = View.GONE } else { Loading
app/src/main/java/io/eelo/appinstaller/search/model/SearchModel.kt +7 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,13 @@ class SearchModel : SearchModelInterface { override fun onSearchComplete(error: Error?, applicationList: ArrayList<Application>) { if (error == null) { if (pageNumber > 1 && this.applicationList.value != null) { val combinedAppList = this.applicationList.value!! combinedAppList.addAll(applicationList) this.applicationList.value = combinedAppList } else { this.applicationList.value = applicationList } if (applicationList.isEmpty()) { screenError.value = Error.NO_RESULTS } Loading