@@ -0,0 +1,1923 @@
+package br.com.sailboat.canoe.recycler;%0A%0Aimport android.support.v7.widget.LinearLayoutManager;%0Aimport android.support.v7.widget.RecyclerView;%0Aimport android.util.Log;%0A%0Apublic abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener %7B%0A%0A    private int currentPage = 1;%0A    private int previousTotal = 0; // The total number of items in the dataset after the last load%0A    private boolean loading = true; // True if we are still waiting for the last set of data to load.%0A    private int visibleThreshold = 50; // The minimum amount of items to have below your current scroll position before loading more.%0A    int firstVisibleItem, visibleItemCount, totalItemCount;%0A%0A%0A    private LinearLayoutManager manager;%0A%0A    public EndlessRecyclerOnScrollListener(LinearLayoutManager manager) %7B%0A        this.manager = manager;%0A    %7D%0A%0A    @Override%0A    public void onScrolled(RecyclerView recyclerView, int dx, int dy) %7B%0A        super.onScrolled(recyclerView, dx, dy);%0A%0A        firstVisibleItem = manager.findFirstVisibleItemPosition();%0A        visibleItemCount = recyclerView.getChildCount();%0A        totalItemCount = manager.getItemCount();%0A%0A        Log.e(%22RECYCLER%22, %22onScrolled() visibleItemCount: %22 + visibleItemCount + %22, totalItemCount: %22 + totalItemCount + %22, firstVisibleItem: %22 + firstVisibleItem);%0A%0A        // TOTAL EXERCISES: 1000%0A        // TOTAL ITEM COUNT: 100%0A%0A%0A        if (loading) %7B%0A            if (totalItemCount %3E previousTotal) %7B%0A                loading = false;%0A                previousTotal = totalItemCount;%0A            %7D%0A        %7D%0A        if (!loading && (totalItemCount - visibleItemCount)%0A                %3C= (firstVisibleItem + visibleThreshold)) %7B%0A            // End has been reached%0A%0A            // Do something%0A            currentPage++;%0A%0A            onLoadMore(currentPage);%0A%0A            loading = true;%0A        %7D%0A    %7D%0A%0A    public abstract void onLoadMore(int current_page);%0A%0A%7D%0A

Add pagination to recyclerview