|
@@ -170,11 +170,10 @@ public class PhotoFragment extends OCFileListFragment {
|
|
|
int totalItemCount = gridLayoutManager.getItemCount();
|
|
|
int firstVisibleItem = gridLayoutManager.findFirstCompletelyVisibleItemPosition();
|
|
|
|
|
|
- if ((totalItemCount - visibleItemCount) <= (firstVisibleItem + MAX_ITEMS_PER_ROW)) {
|
|
|
+ if ((totalItemCount - visibleItemCount) <= (firstVisibleItem + MAX_ITEMS_PER_ROW)
|
|
|
+ && (totalItemCount - visibleItemCount) > 0) {
|
|
|
// Almost reached the end, continue to load new photos
|
|
|
- if ((totalItemCount - visibleItemCount) > 0) {
|
|
|
- searchAndDisplay();
|
|
|
- }
|
|
|
+ searchAndDisplay();
|
|
|
}
|
|
|
}
|
|
|
}
|