Re-think `ForceBundler.saveToBundle()` and `onSaveInstanceState()`
Zhuinden opened this issue · 2 comments
It is currently called from preSaveViewState()
in SingleRootDispatcher
(before super.onSaveInstanceState()
), but this callback can be missed by users of SingleRootDispatcher
. Also, currently toBundle()
is used to create the bundle, and is mapped to the state directly.
But what if we want nested dispatchers (multiple nested container dispatchers, for example) and we don't want to write event delegation logic (and just use an encapsulated single root dispatcher instead)?
Question is:
- Composite state management
- calling
preSaveViewState()
manually - ForceBundler API (how to directly access keyManager without access to Activity, should it need the activity?)
Solution will be to keep preSaveViewState()
for doing things before onSaveInstanceState()
and will be a manual call, BUT also add onSaveInstanceState()
integration to InternalLifecycleIntegration
to automatically provide Bundleable
call through SingleRootDispatcher
.