airbnb / epoxy

Epoxy is an Android library for building complex screens in a RecyclerView
https://goo.gl/eIK82p
Apache License 2.0
8.46k stars 730 forks source link

Carousels scrolling position does not work properly #1297

Open Veeksi opened 2 years ago

Veeksi commented 2 years ago

When navigating from fragment that contains nested nested recyclerview with carousel to other fragment, the carousels scrolling position is not restored properly if you navigate back to first fragment instantly. However, if you wait some time in second fragment and then navigate back, the carousels position is restored properly.

I am using default CarouselModel and I have overridden carousels card model with shouldSaveViewState method

viroth-ty commented 1 year ago

Try this in fragment:

in onCreate method epoxyController.onRestoreInstanceState(savedInstanceState)

onSaveInstanceState epoxyController.onSaveInstanceState(outState)

shawnlinboy commented 7 months ago

Not a very good solution, it even makes whole list position reset to top.

Try this in fragment:

in onCreate method epoxyController.onRestoreInstanceState(savedInstanceState)

onSaveInstanceState epoxyController.onSaveInstanceState(outState)