How To Detect Screen Rotation On Android In Kivy?
I have been searching for a Kivy solution to capture the Android device rotation from one orientation to another. I have tried both of the window methods below but neither execute
Solution 1:
I think on_rotate only tracks Kivy's internal rotation (this is done in OpenGL and doesn't relate to the Android level rotation).
You can probably use pyjnius to work with the normal Java methods for this, but I don't know the details. A simple solution that may work just as well is to watch Window.size
(from kivy.core.window import Window
) - this should detect the change from portrait to landscape.
Post a Comment for "How To Detect Screen Rotation On Android In Kivy?"