Giter Club home page Giter Club logo

Comments (5)

idanatz avatar idanatz commented on May 30, 2024

Hi @palVikas9
can you share the paging module definition?
please expand on the scenario, what's the current behavior and your expected behavior
is it a bug or an API functionality addition - to be able to call the load page without scrolling?
Thanks

from oneadapter.

palVikas9 avatar palVikas9 commented on May 30, 2024

Hi @idanatz ,

Yeah, sure.

inner class PagingModuleImpl : PagingModule() { init { config { layoutResource = R.layout.layout_progress_bar visibleThreshold = 4 } onLoadMore { currentPage -> profileDetailViewModel.postPage = currentPage + 1 profileDetailViewModel.callGetUserPostAPI(selfUserId, profileDetailViewModel.postPage) } } }

It is a functionality that when I get the response from API call for page 1, then API call for the page 2 should be trigged by PagingModule of oneAdapter without scrolling of the recyclerview.

Right now, is there any existing way that we can do that ?`

from oneadapter.

idanatz avatar idanatz commented on May 30, 2024

You are right, it's a bug and will be fixed in the next version - the onLoad will be triggered automatically when the conditions for paging are met after each data submission.

Regarding a quick-fix,
I haven't found a way around it... since the RecyclerView is not scrollable in this usecase, the scroll listener is not being invoked in any programmatically way I tried.

But, you can try and trigger your logic manually when detecting this usecase by using the getVisibleItems() and verifing it's the same number as Items you got in your API response.
It's not the cleanest way and you won't get the currentPage param but from your description its safe to assume its happening in the first API response so it will be 1.

from oneadapter.

palVikas9 avatar palVikas9 commented on May 30, 2024

Thanks.

For the time being, I have added a workaround in my code.

If the condition for next api call is satisfied then it is called and in the loadmore, I call currentPage+2 instead of 1.

It is a lovely library to work with. Have made my life so much easier.

from oneadapter.

idanatz avatar idanatz commented on May 30, 2024

Thanks for the kind words!
a fix has been released with v2.1.1, check it out.

from oneadapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.