Commit 12316d9b authored by Nihar Thakkar's avatar Nihar Thakkar
Browse files

Fix "load more" bug

parent f4f8f38f
......@@ -108,6 +108,7 @@ class CategoryActivity : AppCompatActivity(), ApplicationManagerServiceConnectio
progressBar.visibility = View.GONE
loadMoreContainer.visibility = View.GONE
} else {
loadMoreContainer.visibility = View.GONE
isLoadingMoreApplications = false
}
} else {
......
......@@ -140,6 +140,7 @@ class SearchFragment : Fragment(), SearchView.OnQueryTextListener, SearchView.On
progressBar.visibility = View.GONE
loadMoreContainer.visibility = View.GONE
} else {
loadMoreContainer.visibility = View.GONE
isLoadingMoreApplications = false
}
} else {
......
......@@ -53,14 +53,16 @@ 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.isNotEmpty()) {
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()) {
else {
screenError.value = Error.NO_RESULTS
}
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment