You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/08/29 18:41:52 UTC
[GitHub] [cordova-android] Chuckytuh opened a new pull request #823: Prevent
exit fullscreen mode from closing application
Chuckytuh opened a new pull request #823: Prevent exit fullscreen mode from closing application
URL: https://github.com/apache/cordova-android/pull/823
### Platforms affected
Android
### Motivation and Context
<!-- Why is this change required? What problem does it solve? -->
This PR proposes a simple, quick, solution to overcome a problem with full screen mode that, when on and back button is pressed, the application is closed instead of exiting full screen.
For more details see #822 and also https://bugs.chromium.org/p/chromium/issues/detail?id=999212
Fixes #822
### Description
The custom view provided by WebKit on SystemWebChromeClients's `onShowCustomView` method is wrapped in a custom FrameLayout in order to be able to grab key events and redirect them into `SystemWebView`'s `dispatchKeyEvent`.
Given that the custom view is the one with the focus, that's the one handling input, for this reason, we can hijack those key events and redirect them so that they end up closing the custom view because, as stated on the linked chromium bug ([#999212](https://bugs.chromium.org/p/chromium/issues/detail?id=999212)), the `onHideCustomView` method from the WebChromeClient subclass is not being executed for recent versions of Chrome, hence, not exiting full screen mode and instead, closing the MainActivity/ Application.
### Testing
Manual tests on a Pixel (Android 7.1.2) and Pixel 2 XL (Android 10) with Chrome updated to the most recent version.
### Checklist
- [X] I've run the tests to see all new and existing tests pass
- [ ] I added automated test coverage as appropriate for this change
- [X] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
- [X] 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](https://help.github.com/articles/closing-issues-using-keywords/))
- [ ] I've updated the documentation if necessary
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org