mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 14:52:13 -04:00
Improved the code, removed unnecessary parentheses
This commit is contained in:
parent
7e0bf3442d
commit
bfdc00a009
@ -116,7 +116,7 @@ class SearchFragment : BaseFragment() {
|
||||
val totalItemCount = layoutManager.itemCount
|
||||
val lastVisibleItem = layoutManager.findLastVisibleItemPosition()
|
||||
// Check if the user is about to reach the last item
|
||||
if (!isDataLoading && totalItemCount <= (lastVisibleItem + VISIBLE_ITEMS_THRESHOLD)) {
|
||||
if (!isDataLoading && totalItemCount <= lastVisibleItem + VISIBLE_ITEMS_THRESHOLD) {
|
||||
// Load more data when the last item is almost visible
|
||||
loadMoreSearchResult()
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ data class SearchState(
|
||||
searchResultsWithTerm.search?.let {
|
||||
val maximumResults = it.estimatedMatches
|
||||
val safeEndIndex =
|
||||
if ((startIndex + 100) < maximumResults) startIndex + 100 else maximumResults
|
||||
if (startIndex + 100 < maximumResults) startIndex + 100 else maximumResults
|
||||
val searchIterator =
|
||||
it.getResults(startIndex, safeEndIndex.toInt())
|
||||
val searchResults = mutableListOf<SearchListItem.RecentSearchListItem>()
|
||||
|
Loading…
x
Reference in New Issue
Block a user