step to reduce:
carousel will have a bounce when reach first position and auto scroll a offset happened in lands landscape
I believe this is the behavior of the default LinearSnapHelper. Something similar can be observed in the epoxy sample app.
Given that this snap helper is the standard behavior provided by google I didn't look into it too much yet, but it would be a good thing to investigate.
In the meantime can set your own default snap helper to change the snapping behavior, or set it to no snap helper.
Carousel.setDefaultGlobalSnapHelperFactory(null to disable or a custom value if you want)
I'm considering using a library such as https://github.com/rubensousa/RecyclerViewSnap as the default, but I want to be a little careful about including other libraries.
Thanks, it works , but why SnapHelperFactory is abstract static class
This sort of explains this problem with LinearSnapHelper
https://github.com/rubensousa/RecyclerViewSnap
I used the above mentioned library in the onBind callback, and set the global default to null. (else it will start to dance between the 2 snapping strategies)
Carousel.setDefaultGlobalSnapHelperFactory(null)
carousel {
id("some_id")
numViewsToShowOnScreen(2.2f)
models(listOfModels)
onBind{ _, recyclerView, _ ->
GravitySnapHelper(Gravity.START)
.attachToRecyclerView(recyclerView)
}
}
Most helpful comment
I believe this is the behavior of the default LinearSnapHelper. Something similar can be observed in the epoxy sample app.
Given that this snap helper is the standard behavior provided by google I didn't look into it too much yet, but it would be a good thing to investigate.
In the meantime can set your own default snap helper to change the snapping behavior, or set it to no snap helper.