Git Product home page Git Product logo

Comments (9)

mig35 avatar mig35 commented on September 14, 2024

Hi @SiminaNicolae
I'll add position check to this code. But generally you should call RecyclerView.smoothScrollToPosition method instead of LayoutManager one.
The other thing that both infinite and non-infinite will crash (I'll add this) if you pass wrong position that is not in [0, adapger.getCount()-1].
Are you agree with this?
Thanks.

from carousellayoutmanager.

mig35 avatar mig35 commented on September 14, 2024

@SiminaNicolae
please find this commit 294e16b. If you don't have any objections, I'll create new tag

Thanks

from carousellayoutmanager.

SiminaNicolae avatar SiminaNicolae commented on September 14, 2024

Hi @mig35
Thank you for investigating it. I am not 100% sure that with this fix you will still be able to smooth scroll to left if the centered item from carousel is the first one from the list. I am thinking about the case of infinite scroll carousel where you have to go to the end of the list. (but I am sure that you tested it already ;) )

Thanks

from carousellayoutmanager.

mig35 avatar mig35 commented on September 14, 2024

@SiminaNicolae
This works fine if you pass 0 (this will go to the first element). Bug if you pass carouselLayoutManager.getCenterItemPosition() - 1, then it will crash because this will be -1 and there can not be an element with index -1. And this is true for infinite carousel too.
So any way you will have to add code that checks position bounds.

Thanks

from carousellayoutmanager.

SiminaNicolae avatar SiminaNicolae commented on September 14, 2024

Ok...thank you.

from carousellayoutmanager.

mig35 avatar mig35 commented on September 14, 2024

Hi SiminaNicolae,
Upload new version with this checks: 1.1.4

from carousellayoutmanager.

engzico avatar engzico commented on September 14, 2024

dear mig35

i am also having same issue, not able to do smoothScrollToPositon after initializing the view, RecyclerView.State.getItemCount() giving 0 therefore it is firing "position can't be great then adapter items count. ..."

can you please help

from carousellayoutmanager.

engzico avatar engzico commented on September 14, 2024

I figured out my problem, it was with my code, it is working fine now, thank you

from carousellayoutmanager.

azoft-dev-team avatar azoft-dev-team commented on September 14, 2024

Hi @engzico
We also figured out our problem. Fixed in commit cf4fcb2. Upload new version: 1.1.5

from carousellayoutmanager.

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.