epoxy icon indicating copy to clipboard operation
epoxy copied to clipboard

[Carousel] Wrong snapping center at the start/end of list

Open beigirad opened this issue 4 years ago • 2 comments
trafficstars

When I set numViewsToShowOnScreen on an even number with a point (ex: 4.3, 6.1, 6.8), Carousels sniping on the centered item at the start and end of the list. but with odd numbers (with point) is working well.

As you can see the initial position is ok, but when I scroll it a little bit, it won't stick to start again.

carousel

I tried 4.3.1 and 4.5.0. both of them has this issue

beigirad avatar Apr 25 '21 12:04 beigirad

I am still having this exact same issue

Veeksi avatar Jun 01 '22 05:06 Veeksi

Fixed with this:

@ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT)
internal class YourCarousel(context: Context) : Carousel(context) {
    override fun getSnapHelperFactory(): SnapHelperFactory? {
        return null
    }
}

https://github.com/airbnb/epoxy/issues/1022#issuecomment-785119686

gold24park avatar Apr 04 '23 23:04 gold24park