|
@@ -36,6 +36,7 @@ class SearchView: RelativeLayout, View.OnClickListener, LeftToolbarView {
|
|
|
companion object {
|
|
|
private const val SEARCH_RESULT_INIT_NUMBER = 200
|
|
|
private const val SEARCH_RESULT_ADD_NUMBER = 50
|
|
|
+ private const val SEARCH_RESULT_PRE_LOAD_BUFFER = 1
|
|
|
}
|
|
|
|
|
|
private var pdfInfoHandler: PdfInfoHandler? = null
|
|
@@ -186,7 +187,7 @@ class SearchView: RelativeLayout, View.OnClickListener, LeftToolbarView {
|
|
|
|
|
|
listView.setOnScrollListener(object : AbsListView.OnScrollListener {
|
|
|
override fun onScroll(view: AbsListView?, firstVisibleItem: Int, visibleItemCount: Int, totalItemCount: Int) {
|
|
|
- val shouldLoadMore = firstVisibleItem + visibleItemCount >= totalItemCount - 1
|
|
|
+ val shouldLoadMore = firstVisibleItem + visibleItemCount >= totalItemCount - SEARCH_RESULT_PRE_LOAD_BUFFER
|
|
|
if (shouldLoadMore) {
|
|
|
search(searchStartPage)
|
|
|
}
|