aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-01-22 17:25:23 -0800
committerScott Jackson <daneren2005@gmail.com>2016-01-22 17:25:23 -0800
commitae391131cb73f08c25686bab0abb33c5e408c996 (patch)
treee4361e5e700ba59b27000541d01d0d1d431c0772 /app/src/main
parent48e1ba9468c5cb7f12cffef0a31aa2d30b633fab (diff)
downloaddsub-ae391131cb73f08c25686bab0abb33c5e408c996.tar.gz
dsub-ae391131cb73f08c25686bab0abb33c5e408c996.tar.bz2
dsub-ae391131cb73f08c25686bab0abb33c5e408c996.zip
Fix Infinite adapter doing uncessary calls in case of only loading 5 items
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/adapter/EntryInfiniteGridAdapter.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/EntryInfiniteGridAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/EntryInfiniteGridAdapter.java
index a757149a..6c1c14da 100644
--- a/app/src/main/java/github/daneren2005/dsub/adapter/EntryInfiniteGridAdapter.java
+++ b/app/src/main/java/github/daneren2005/dsub/adapter/EntryInfiniteGridAdapter.java
@@ -89,6 +89,10 @@ public class EntryInfiniteGridAdapter extends EntryGridAdapter {
this.type = type;
this.extra = extra;
this.size = size;
+
+ if(super.getItemCount() < size) {
+ allLoaded = true;
+ }
}
public void loadMore() {
@@ -111,7 +115,7 @@ public class EntryInfiniteGridAdapter extends EntryGridAdapter {
appendCachedData(newData);
loading = false;
- if(newData.isEmpty()) {
+ if(newData.size() < size) {
allLoaded = true;
notifyDataSetChanged();
}