idanatz / OneAdapter

A Viewholderless Adapter for RecyclerView, who supports builtin diffing, states (paging, empty...), events (clicking, swiping...), and more.
MIT License
470 stars 45 forks source link

Support for StateRestorationPolicy #32

Closed meruiden closed 3 years ago

meruiden commented 3 years ago

Hi,

Could you add support to get and set the StateRestorationPolicy? this is currently not accessible since the adapter is private.

Edit: After peeking in OneAdapter.kt it can be done simply by adding this line:

    var stateRestorationPolicy: StateRestorationPolicy
        get() = internalAdapter.stateRestorationPolicy
        set(value) {
            internalAdapter.stateRestorationPolicy = value
        }

and it would be nice if the paginator could also implement some sort of state restoring so that after a state has been restored the pagination can go on where it left off

idanatz commented 3 years ago

Hi I will expose the StateRestorationPolicy in the next version. Also, I will try to integrate state restoration in the paginator as well. Thanks

meruiden commented 3 years ago

Hi, any updates on this?

idanatz commented 3 years ago

Hi Haven't got to the restoration request (busy schedule) but exposing the StateRestorationPolicy will be available in a couple of days in the next minor release. Thanks

idanatz commented 3 years ago

v2.0.2 is out with your request