-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recreate views on config changes #189
base: develop
Are you sure you want to change the base?
Conversation
5c3366b
to
bee8128
Compare
@EricKuck would you mind taking a look at this when you have a chance? |
bee8128
to
90b7add
Compare
Rebased, resolved conflicts, was bee8128 |
This is typically necessary when the Activity has specified in the manifest that it will handle configuration changes such as an orientation change. If the top Controller.setRecreateViewOnConfigChange(true) has been called before a configuration change happens, that Controller's current view will be removed and a recreated view will be added to the parent. For Controllers that are lower in the stack, those Controllers' view will only be recreated if the Controller also has a RetainViewMode of RetainViewMode#RETAIN_DETACH.
90b7add
to
e2be5e8
Compare
Rebased, resolved conflicts, was 90b7add |
Recreating views on all config changes seems a little heavy-handed, doesn't it? I can see people potentially wanting to do this for landscape -> portrait, but what if they don't want to recreate views for keyboard availability events or multi-window changes? |
Maybe it is reasonable to allow user to pass predicate which would filter appropriate configchanges for view hierarchy recreation? Approach with view hierarchy recreation without destroying activity seems very usable |
Or maybe it would be better to just add recreateViews() method to router allowing users to invoke it in Activity::onConfigurationChanged? |
ping? |
Any updates on this? |
This is typically necessary when the Activity has specified in the manifest that it will handle configuration changes such as an orientation change.
If the top Controller.setRecreateViewOnConfigChange(true) has been called before a configuration change happens, that Controller's current view will be removed and a recreated view will be added to the parent.
For Controllers that are lower in the stack, those Controllers' view will only be recreated if the Controller also has a RetainViewMode of RetainViewMode#RETAIN_DETACH.