MarkoMilos / Paginate

Library for creating simple pagination functionality upon RecyclerView and AbsListView
Apache License 2.0
1.35k stars 225 forks source link

on load more method of Paginate Callback does not Called #4

Closed ashraful29 closed 8 years ago

ashraful29 commented 8 years ago

I implement your library but it has not effect but showing only loading view. I debug that it never called on load more method.please help me. below code is paginate declaration..

`private void setScrollListener() {
        int threshold=1;
        paginate = Paginate.with(listProduct, this)
                .addLoadingListItem(true)
                .setLoadingTriggerThreshold(threshold)
                .setLoadingListItemSpanSizeLookup(new LoadingListItemSpanLookup() {
                    @Override
                    public int getSpanSize() {
                        return newSpanCount;
                    }
                })
                .build();

    }`

Here is the where i initialize my adapter

`productAdapter = new ProductAdapter(getActivity(), productList);
            listProduct.setAdapter(productAdapter);
            productAdapter.notifyDataSetChanged();
            setScrollListener();`

and there are my callback methods ..

` @Override
    public void onLoadMore() {
        onLoadMoreCallback();
    }

    @Override
    public boolean isLoading() {
        // Indicate whether new page loading is in progress or not
        return loading;
    }

    @Override
    public boolean hasLoadedAllItems() {
        // Indicate whether all data (pages) are loaded or not
        return pageNumber == totalProductpage;
    }`
MarkoMilos commented 8 years ago

@ashraful29 Did you setup the layout manager for RecyclerView? Where does newSpanCount come from? What is returned from following line return pageNumber == totalProductpage ?

ashraful29 commented 8 years ago

Ok i Solve this problem. Sorry for late response.

y2kshane commented 8 years ago

How did you solve this?

iyashamihsan commented 5 years ago

How did you solve ... ?? plz tell us .. i also have same issue