Closed woxblom closed 7 years ago
So I take it that you have a data change which is clearing the position that is to be restored.
When I rotate onCreateView will be called again and the onLoadFinished where my loader delivers the result. I need to set the data on the adapter again when rotating, this works fine with the standard LinearLayoutManager and also works fine with a ListView solution. Feels like the superslim layoutmanager does not handle the rotate in a correct way somehow as the standard layout manager handles it.
Does it work for you to keep the scroll position on rotate with superslim? In that case how do you set the data again after rotate?
At the moment, setting a new adapter will cause the layout state in SuperSLiM to be lost.
Is it planned to support configuration changes?
The example app doesn't have this problem and persists its position through configuration changes.
If I scroll down to item 15 for example and then rotate the screen the scroll position is reset and back to 0. It works if I use the standard LinearLayoutManager.
I can see that the scrollposition is saved in onSaveInstanceState and restored in onRestoreInstanceState but the mRequestPosition is set to -1 in onItemsChanged before it has been used or any children has been laid out.