Skip to content
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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

hansonchris
Copy link

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.

@hansonchris
Copy link
Author

@EricKuck would you mind taking a look at this when you have a chance?

@hansonchris
Copy link
Author

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.
@hansonchris
Copy link
Author

Rebased, resolved conflicts, was 90b7add

@EricKuck
Copy link
Member

EricKuck commented Feb 6, 2017

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?

@Tagakov
Copy link

Tagakov commented Apr 22, 2017

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

@Tagakov
Copy link

Tagakov commented May 1, 2017

Or maybe it would be better to just add recreateViews() method to router allowing users to invoke it in Activity::onConfigurationChanged?

@Tagakov
Copy link

Tagakov commented May 31, 2017

ping?

@CebotariM
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants