Azoft / CarouselLayoutManager

Android Carousel LayoutManager for RecyclerView
Apache License 2.0
2.56k stars 367 forks source link

How to change carousel parameters? #28

Closed maxglu closed 6 years ago

maxglu commented 7 years ago

Hi! You carousel is awesom :) And working fine (bug with the animations turned out to be my problev, sorry). But i have some questions:

Regards Max

mig35 commented 7 years ago

Hi @maxglu. I'll answer this questions tomorrow, have an other work that I have to do :) Sorry, Mike

nitishhhh3 commented 7 years ago

Hi @mig35 First, thanks to develop awesome carousel.

mig35 commented 7 years ago

Hi @maxglu

  1. Do you mean how many elements are there bellow the center one? If so, you can use setMaxVisibleItems method in LayoutManager and this will make a deal. By default there are 2 elements on each side of the center item.
  2. The only solution is to extend LayoutManager and change scroller (we are using standard https://developer.android.com/reference/android/support/v7/widget/LinearSmoothScroller.html)
mig35 commented 7 years ago

Hi @nitishhhh3 please provide an animation. can't understand you problem. perhaps this is not CarouselProblem, but your code cancellation image loading request problem. Because views are reused, so you should cancel previous loading and start a new one in onBind method of the adapter.

maxglu commented 7 years ago

Hi @mig35

  1. No, I meant "depth" the distance between front and rear elements. I resolve this by increase scale of all elements (except front element) in . But maybe this is wrong way. My realisation in gist
  2. I fix scrolling speed :) Thank you

Thank you for answers and help :)

mig35 commented 7 years ago

@maxglu you can simply add this code: float increasedScale = Math.min(1.0f, originalScale * 1.4f); any way it is up to you to make any PostLayoutListener implementation.

YoussefYN commented 6 years ago

Hi @maxglu,

Please tell me how you fixed the scrolling speed, I have the same opposite problem, the scrolling is slow and stikcy. :) Thanks