epoxy icon indicating copy to clipboard operation
epoxy copied to clipboard

Scroll position reset after `onDetachedFromWindow` and `recycleChildrenOnDetach == true`

Open eygraber opened this issue 4 years ago • 1 comments
trafficstars

Following the wiki guidance on avoiding memory leak I have been setting LayoutManager.recycleChildrenOnDetach = true for all of my EpoxyRecyclerViews.

I'm using one in a ViewPager now, and when scrolling away from the EpoxyRecyclerView and then coming back to it, my scroll position is lost. If I don't set recycleChildrenOnDetach = true then my scroll position is not lost.

Is there any way around this?

eygraber avatar Oct 05 '21 19:10 eygraber

i'm guessing you're not saving and restoring view state to your recyclerview correctly, since that is what controls scroll position

elihart avatar Nov 20 '21 05:11 elihart