bugfix
This commit is contained in:
parent
cf6f74ec53
commit
a9925feed4
14
kivyblocks/android_rotation.py
Normal file
14
kivyblocks/android_rotation.py
Normal 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
|
Loading…
Reference in New Issue
Block a user