Skip to content

Commit

Permalink
Fix #7
Browse files Browse the repository at this point in the history
Added page number to query parameters to future proof pagination
  • Loading branch information
Akash Ramani committed Jul 17, 2015
1 parent 947af13 commit edcb429
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public static void getItemDetails(String path, String sort,int pageNum, final It
.scheme("http").authority("materialup.com")
.appendPath("posts")
.appendPath("c")
.appendPath(path);
.appendPath(path)
.appendQueryParameter("page",String.valueOf(pageNum));

if (!StringUtils.isEmpty(sort)) {
uriBuilder.appendQueryParameter("sort", sort);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.support.v7.widget.RecyclerView;

/**
* Created by Akash.
* Created by gaara87.
*/
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
Expand Down Expand Up @@ -38,13 +38,8 @@ public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
}
if (!loading && (totalItemCount - visibleItemCount)
<= (firstVisibleItem + visibleThreshold)) {
// End has been reached

// Do something
current_page++;

onLoadMore(current_page);

loading = true;
}
}
Expand Down

0 comments on commit edcb429

Please sign in to comment.