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

Android: Fix AppComponent reconstructed on split screen #5104

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

Somena1
Copy link
Contributor

@Somena1 Somena1 commented Nov 4, 2021

This commit fixes #5068
Switching between screen size or split screen causes Android AppComponent to be reconstructed and I'm initiate a restart.

@chrisbobbe
Copy link
Contributor

Thanks, @Somena1! I see two commits:

c4a9760 (Android) Fix AppComponent reconstructed on split screen #5068
20648f1 Android config changes set to alphabetical

It looks like the second commit is fixing up a small problem that was introduced in the first commit. Please squash the two commits together, so there's just one commit that doesn't (knowingly) introduce any problems.

For that single commit, please make sure it follows our commit-message style.

Thanks!

@Somena1
Copy link
Contributor Author

Somena1 commented Nov 6, 2021

Hello, I've resolved the squash and commit message.
Thanks for putting me through

@Somena1
Copy link
Contributor Author

Somena1 commented Nov 6, 2021

Not sure if this is the right place to say this, my PR on RN addressing this issue was accepted
commit

@Somena1
Copy link
Contributor Author

Somena1 commented Nov 10, 2021

@chrisbobbe please review changes in commit

@gnprice
Copy link
Member

gnprice commented Nov 11, 2021

Not sure if this is the right place to say this, my PR on RN addressing this issue was accepted commit

Cool! Thanks for getting that fixed upstream.

No need to @-mention maintainers pinging for a review. It can take a few business days before we review a change, but we do see them.

For cross-reference, this PR is the continuation of #5073.

This change looks good! Thanks for your work on it. Merging.

This fixes an issue where the app would restart on entering split
screen, or on resizing the app's side of a split screen.

Basically this line of the Android manifest is making an assurance to
the system that the app is prepared to handle these changes; docs here:
  https://developer.android.com/guide/topics/manifest/activity-element#config
When the system doesn't get that assurance, it just restarts the app
from scratch to be sure.

And empirically the app indeed does just fine when we add those
assurances and then go ahead and switch to split-screen mode, or
resize the app's portion of the split screen.  That layer of things is
basically all RN's job, so RN is handling this just fine -- we just
haven't been letting the system know that we're ready to do so.

Also got this fixed in the RN template app upstream:
  facebook/react-native#32536
  facebook/react-native@fc962c9b6

[greg: expanded commit message]

Fixes: zulip#5068
@gnprice gnprice merged commit 03a62af into zulip:main Nov 11, 2021
@gnprice
Copy link
Member

gnprice commented Nov 11, 2021

And done. I also revised the commit message -- take a look:

android: Fix restart on resizing or splitting screen

This fixes an issue where the app would restart on entering split
screen, or on resizing the app's side of a split screen.

Basically this line of the Android manifest is making an assurance to
the system that the app is prepared to handle these changes; docs here:
  https://developer.android.com/guide/topics/manifest/activity-element#config
When the system doesn't get that assurance, it just restarts the app
from scratch to be sure.

And empirically the app indeed does just fine when we add those
assurances and then go ahead and switch to split-screen mode, or
resize the app's portion of the split screen.  That layer of things is
basically all RN's job, so RN is handling this just fine -- we just
haven't been letting the system know that we're ready to do so.

Also got this fixed in the RN template app upstream:
  https://github.com/facebook/react-native/pull/32536
  https://github.com/facebook/react-native/commit/fc962c9b6

[greg: expanded commit message]

Fixes: #5068

Thanks again!

@Somena1 Somena1 deleted the Fix-split-screen branch November 11, 2021 20:08
@gnprice gnprice mentioned this pull request Dec 13, 2022
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.

Switching between regular and split view restarts the app
3 participants