Open alinberce opened 6 years ago
Hi @alinberce
We have OnCenterItemSelectionListener
for this situation with addOnItemSelectionListener
method. This listener will be fired on every new center item change event. But this listener will be fired when it is a visual change. So imagine that user is scrolling really slow. And the center item now is 0. And when 1 item will be upper then 0 - this event will be fired. So it may take some time while user will move this new 1 item to the center...
So basically I don't have what you need - there is no event when item is going through the center position. May be I will add this event as a part of androidx
update.
Hi,
First of all, awesome awesome library. Thank you for it. Secondly, I am trying play a small sound each time an item goes through the center position. I've tried implementing my own
CarouselLayoutManager.PostLayoutListener
but it does not work as extended because this fires only when an item remains stationary. The problem is when doing asmoothScrollToPostion
or when the user flings the recyclerview and a lot of scroll happens on the screen.So what event should I be looking for in order to be notified each time an item goes through the center position, independent if it's programatically or scrolled by the user?
Thank you again for this awesome work.