Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recyclerview goes to the bottom automatically and triggers onLoadMore infinitely #43

Open
noecende opened this issue May 20, 2019 · 5 comments
Labels
triage In process of defining what kind of issue this is (bug, enhancement etc)

Comments

@noecende
Copy link

I don't know whats going on. I use this library with Paging library (without BoundaryCallback), when the first page is loaded, the recyclerview scrolls to the bottom and continues loading data until it loads all the items in the server.

@omarihamza
Copy link

Have you managed to fix the problem?

@MarkoMilos
Copy link
Owner

From your description, I cannot reproduce this issue.

Can you describe a bit more or better yet provide a short example demonstrating this issue?

Answering the following would also help:

  • How did you set up your Paginate?
  • How many items do you have initially?
  • How many items are you adding per page?
  • What LayoutManager do you use and how is it setup?
  • Are you performing anything else custom upon RecyclerView, LayoutManager, or Adapter that might cause scrolling besides.

@MarkoMilos MarkoMilos added the triage In process of defining what kind of issue this is (bug, enhancement etc) label Sep 20, 2020
@ravikant-dexati
Copy link

ravikant-dexati commented Jul 9, 2021

I am also facing same issue
this is how i am initializing
`private void renderPopularList(final PopularMoviesResponse moviesResponse) {
RecyclerView recyclerViewPopular = (RecyclerView) findViewById(R.id.rv_popular);
popularMovieAdapter = new PopularMovieAdapter(this, moviesResponse);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, RecyclerView.VERTICAL, false);
recyclerViewPopular.setLayoutManager(linearLayoutManager);
recyclerViewPopular.setAdapter(popularMovieAdapter);
int spacingInPixels = getResources().getDimensionPixelSize(R.dimen.spacing);
recyclerViewPopular.addItemDecoration(new SpacesItemDecoration(spacingInPixels));

    final int threshold=moviesResponse.getTotalResults() / moviesResponse.getTotalPages();
    Paginate.Callbacks callbacks = new Paginate.Callbacks() {

        @Override
        public void onLoadMore() {
            // Load next page of data (e.g. network or database)
            loading = true;
            getNewItems(moviesResponse.getPage());
        }

        @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
             boolean loaded=moviesResponse.getPage()==moviesResponse.getTotalPages();
             if(loaded)
                 loading=false;
             return loaded;
        }
    };

    Paginate.with(recyclerViewPopular, callbacks)
            .setLoadingTriggerThreshold(threshold)
            .addLoadingListItem(true)
            .setLoadingListItemCreator(new CustomLoadingListItemCreator())
            .setLoadingListItemSpanSizeLookup(new LoadingListItemSpanLookup() {
                @Override
                public int getSpanSize() {
                    return 1;
                }
            })
            .build();

}`

@mahendrarajdhami
Copy link

I am also facing same problem. any solution?

@abkoradiya
Copy link

this issue occur due to parent scrolling view like scrollview, Nestedscrollview etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage In process of defining what kind of issue this is (bug, enhancement etc)
Projects
None yet
Development

No branches or pull requests

6 participants