This commit is contained in:
yumoqing 2021-06-30 11:09:44 +08:00
parent cf6f74ec53
commit a9925feed4

View File

@ -0,0 +1,14 @@
from kivy.utils import platform
try:
from plyer.platforms.android import activity
except:
activity = None
def get_rotation():
try:
r = activity.getWindowManager().getDefaultDisplay().getRotation()
print('get_rotation(): rotation=', r, type(r))
return r
except Exception as e:
print('get_rotation() failed',e)
return None