Comments (9)
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.
@SiminaNicolae
please find this commit 294e16b. If you don't have any objections, I'll create new tag
Thanks
from carousellayoutmanager.
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.
@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.
Ok...thank you.
from carousellayoutmanager.
Hi SiminaNicolae,
Upload new version with this checks: 1.1.4
from carousellayoutmanager.
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.
I figured out my problem, it was with my code, it is working fine now, thank you
from carousellayoutmanager.
Hi @engzico
We also figured out our problem. Fixed in commit cf4fcb2. Upload new version: 1.1.5
from carousellayoutmanager.
Related Issues (20)
- How enable auto scroll HOT 1
- 请问怎么设置缩放大小?How do I set the zoom size?
- 你好,可以设置子view的高度或缩小比例吗?
- Click Listener
- Number of item count while scrolling
- Fatal Exception: java.lang.NullPointerException Attempt to read from field 'androidx.recyclerview.widget.RecyclerView$ViewFlinger androidx.recyclerview.widget.RecyclerView.mViewFlinger' on a null object reference HOT 5
- how Switch to increase transparency during sliding
- Consider migrating from jcenter HOT 5
- All items can be in a position from top to bottom HOT 2
- Gradient Color Background Items
- How to add item fade effect HOT 1
- How to disable smoothScrollToPosition HOT 8
- My app cant open in my andorid after build the app HOT 7
- can't display image with using <androidx.recyclerview.widget.RecyclerView>
- One swipe, many scrolling
- how does it look like ViewPager
- How to correctly offset elements? HOT 1
- No item visible
- Set item selected on initialization HOT 1
- Have you achieve to add dot indicator to your Carousel ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carousellayoutmanager.