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

Stop webview from restarting when activity resizes #800

Merged
merged 1 commit into from
Aug 26, 2019

Conversation

breautek
Copy link
Contributor

@breautek breautek commented Aug 6, 2019

Platforms affected

Android

Motivation and Context

This change stops the webview from restarting when the activity window resizes while using Android's split-screen feature.

Fixes #799

Description

This change adds some new attributes to the default list of configChanges including:

smallestScreenSize

The current available screen size has changed.
This represents a change in the currently available size, relative to the current aspect ratio, so will change when the user switches between landscape and portrait.

screenLayout

The screen layout has changed — a different display might now be active.

uiMode

The user interface mode has changed — the user has placed the device into a desk or car dock, or the night mode has changed. For more information about the different UI modes, see UiModeManager.

All of these will allow the webview to respond to screen changes more gracefully allowing the webview to adapt to the new change without restarting the webview or reloading the page.

Testing

I've ran npm test and tested on a physical Samsung Galaxy Note 9 device running Android 9.

Special thanks to @ttencate for not only opening up an issue, but also providing the solution to the issue.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@breautek breautek marked this pull request as ready for review August 6, 2019 03:06
@breautek
Copy link
Contributor Author

Pinging for review

@brodybits
@erisu

And I'm not sure who else usually reviews android PR. Please ping anybody else as necessary. Thanks.

Copy link
Member

@timbru31 timbru31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@brodybits brodybits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with minor comments:

  • I think this should be considered for a minor or major release, not a patch release.
  • I wonder if we want to find a way to configure these items in config.xml or not (maybe more trouble than it would be worth?)

@breautek
Copy link
Contributor Author

I think this should be considered for a minor or major

I'm find with that, the current master is 8.1.0-dev so that's a pending minor release I assume?

I wonder if we want to find a way to configure these items in config.xml

If we wanted more flexibility sure, but I think this would be more appropriate for a feature request ticket.

@timbru31
Copy link
Member

No veto from any others in over one week, merging! :)

@timbru31 timbru31 merged commit 9808a0d into apache:master Aug 26, 2019
@breautek breautek deleted the resize-activity-support branch August 26, 2019 20:17
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.

App is restarted on split-screen
3 participants