mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-10 07:48:30 -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 totalItemCount = layoutManager.itemCount
|
||||||
val lastVisibleItem = layoutManager.findLastVisibleItemPosition()
|
val lastVisibleItem = layoutManager.findLastVisibleItemPosition()
|
||||||
// Check if the user is about to reach the last item
|
// 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
|
// Load more data when the last item is almost visible
|
||||||
loadMoreSearchResult()
|
loadMoreSearchResult()
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ data class SearchState(
|
|||||||
searchResultsWithTerm.search?.let {
|
searchResultsWithTerm.search?.let {
|
||||||
val maximumResults = it.estimatedMatches
|
val maximumResults = it.estimatedMatches
|
||||||
val safeEndIndex =
|
val safeEndIndex =
|
||||||
if ((startIndex + 100) < maximumResults) startIndex + 100 else maximumResults
|
if (startIndex + 100 < maximumResults) startIndex + 100 else maximumResults
|
||||||
val searchIterator =
|
val searchIterator =
|
||||||
it.getResults(startIndex, safeEndIndex.toInt())
|
it.getResults(startIndex, safeEndIndex.toInt())
|
||||||
val searchResults = mutableListOf<SearchListItem.RecentSearchListItem>()
|
val searchResults = mutableListOf<SearchListItem.RecentSearchListItem>()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user