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

Handling Android orientation in surface rotation tutorial #113

Closed
PavelRudko-ARM opened this issue Apr 28, 2020 · 2 comments · Fixed by #143
Closed

Handling Android orientation in surface rotation tutorial #113

PavelRudko-ARM opened this issue Apr 28, 2020 · 2 comments · Fixed by #143
Labels
documentation Improvements or additions to documentation feature request Request for a new feature or improvement

Comments

@PavelRudko-ARM
Copy link
Contributor

A code snippet in the surface rotation tutorial suggests using APP_CMD_CONTENT_RECT_CHANGED to handle orientation changes.
However, this event is never generated by the current version of NDK without some extra work which is done in the framework (using onContentRectChanged).
This is not mentioned in the tutorial, so the advice is a little bit misleading (see this issue).
Probably it is good to add a little Note section with an explanation.
This NDK issue is already reported and it's very likely that it will be fixed in the version 22, so it would be good to keep in mind (and probably update the code and the tutorial).

@TomAtkinsonArm
Copy link
Contributor

TomAtkinsonArm commented Apr 29, 2020

Here is the fixed callback in the ndk version 22. We could add a note and say this is fixed in NDK 22.

Another option would be to implement this method and its supporting methods and add it to the onContentRectChanged callback if the callback is currently NULL. The note would then be that we have implemented a fix for older ndks to mimic the functionality of future versions

Currently using NDK version 20 the following callbacks are null in android_main:

  • OnNativeWindowResize
  • OnNativeWindowRedrawNeeded
  • OnContentRectChanged

@TomAtkinsonArm
Copy link
Contributor

This said after reviewing both the ndk implementation and the on_content_rect_changed implementation in this project both methods are effectively doing the same thing

@TomAtkinsonArm TomAtkinsonArm added enhancement documentation Improvements or additions to documentation labels Jun 10, 2020
@ghost ghost added feature request Request for a new feature or improvement and removed enhancement labels Jun 10, 2020
@ghost ghost closed this as completed in #143 Jun 22, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature request Request for a new feature or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants