Skip to content

Commit

Permalink
Merge pull request kivy#6164 from inclement/fix_android_orientation
Browse files Browse the repository at this point in the history
Removed default orientation hints on Android
  • Loading branch information
inclement authored Feb 14, 2019
2 parents 233cdd1 + 19603bf commit 51e6dae
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions kivy/core/window/_window_sdl2.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,10 @@ cdef class _WindowSDL2Storage:
if USE_IOS:
orientations = 'LandscapeLeft LandscapeRight Portrait PortraitUpsideDown'

# Override the Android orientation based on what p4a was built with, if available.
# This may be overridden again by $KIVY_ORIENTATION.
if USE_ANDROID:
env_orientations = environ.get('P4A_ORIENTATION', orientations)

if env_orientations == 'portrait':
orientations = 'Portrait'
elif env_orientations == 'landscape':
orientations = 'LandscapeLeft'
elif env_orientations == 'sensor':
orientations = 'sensor'
else:
Logger.warning(('Could not satisfy Android orientation "{}", only '
'{{portrait,landscape and sensor}} are currently supported. '
'Defaulting to portrait').format(orientations))
orientations = 'Portrait'
# Do not hint anything: by default the value in the AndroidManifest.xml will be used
# Note that the user can still override this via $KIVY_ORIENTATION if they wish
orientations = ''

# Override the orientation based on the KIVY_ORIENTATION env
# var. Note that this takes priority over any other setting.
Expand Down

0 comments on commit 51e6dae

Please sign in to comment.