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 screen rotation #1265

Open
Sanva opened this issue Nov 14, 2020 · 1 comment
Open

Android screen rotation #1265

Sanva opened this issue Nov 14, 2020 · 1 comment

Comments

@Sanva
Copy link
Contributor

Sanva commented Nov 14, 2020

Describe the solution you'd like
An Android implementation for kha.System.screenRotation — and a notification about the screen change would be even more awesome.

Describe alternatives you've considered
Constantly polling window dimensions — it is something that can work in simple cases... but not for everything.

In fact, in my specific case (resizing and repositioning screen elements, like a gamepad) it would suffice if Window.notifyOnResize would be fired because of the screen dimensions changing... but it is not the case.

@Sanva
Copy link
Contributor Author

Sanva commented Nov 15, 2020

[...] it would suffice if Window.notifyOnResize would be fired because of the screen dimensions changing... but it is not the case.

That actually looks like a bug in Android 8, or something — I've found references about the underlying Android method (ANativeActivityCallbacks.onNativeWindowResized) firing when screen rotation changes, so I've tested it with another phone:

  • LG G5, Android 8: ANativeActivityCallbacks.onNativeWindowResized not getting called when screen orientation changes.
  • Redmi Note 8, Android 9: ANativeActivityCallbacks.onNativeWindowResized gets called when screen orientation changes.

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

No branches or pull requests

1 participant