Skip to content

Commit

Permalink
posting to recyclerview was moved to InfiniteScrollListener
Browse files Browse the repository at this point in the history
  • Loading branch information
fobo66 committed Nov 9, 2017
1 parent 81e0dca commit e9a8e23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 1 addition & 6 deletions app/src/main/java/io/plaidapp/ui/HomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
import io.plaidapp.util.AnimUtils;
import io.plaidapp.util.DrawableUtils;
import io.plaidapp.util.ViewUtils;
import io.plaidapp.util.glide.GlideApp;


public class HomeActivity extends Activity {
Expand Down Expand Up @@ -186,11 +185,7 @@ public int getSpanSize(int position) {
grid.addOnScrollListener(new InfiniteScrollListener(layoutManager, dataManager) {
@Override
public void onLoadMore() {
grid.post(new Runnable() {
@Override public void run() {
dataManager.loadAllDataSources();
}
});
dataManager.loadAllDataSources();
}
});
grid.setHasFixedSize(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
final int firstVisibleItem = layoutManager.findFirstVisibleItemPosition();

if ((totalItemCount - visibleItemCount) <= (firstVisibleItem + VISIBLE_THRESHOLD)) {
onLoadMore();
recyclerView.post(new Runnable() {
@Override public void run() {
onLoadMore();
}
});
}
}

Expand Down

0 comments on commit e9a8e23

Please sign in to comment.