Skip to content

"--orientation sensor" no longer works #1688

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

Closed
RobertFlatt opened this issue Feb 7, 2019 · 2 comments · Fixed by kivy/kivy#6138
Closed

"--orientation sensor" no longer works #1688

RobertFlatt opened this issue Feb 7, 2019 · 2 comments · Fixed by kivy/kivy#6138

Comments

@RobertFlatt
Copy link
Contributor

Versions

  • Python: 3.6
  • OS: Ububtu 18.04
  • Kivy: default
  • Cython: 29.1

Description

using p4a (master) installed 2/6/2019 (same with installed 2/2/2019)
this uses SDL 2.0.9

App is stuck in portrait mode regardless of p4a --orientation
Example uses --orientation sensor

Cause seems to be "LandscapeLeft LandscapeRight" (see log file below)
I thought these were iOS things, so perhaps some code overflow?

main.py:

from kivy.app import App
from kivy.uix.label import Label
from kivy.graphics import Color, Rectangle
from kivy.core.window import Window

class Demo(App):
    def set_background_color(self):
        with self.label.canvas.before:
            Color(0.5, 0.0, 0.5)
            Rectangle(size=Window.size) 
       
    def _resize_handler(self,obj,size):
        self.set_background_color()

    def build(self):
        Window.bind(size=self._resize_handler)
        self.label = Label(text = 'Greetings Earthlings')
        self.set_background_color()
        return self.label

if __name__ == '__main__':
    Demo().run()

buildozer.spec

Command:

p4a apk

Spec file:
.p4a

--dist_name=ex
--private .
--package=com.example.ex
--name Ex
--requirements=python3,kivy
--arch=armeabi-v7a
--orientation sensor
--sdk_dir /home/bobf/androidtools/sdk
--ndk_dir /home/bobf/androidtools/android-ndk-r17c
--android_api 28
--ndk-api 21
--version 0.0.0

Logs

logcat:

02-06 14:56:09.498 31440 31468 I python  : [WARNING] Could not satisfy Android orientation "LandscapeLeft LandscapeRight", only {portrait,landscape} are currently supported. Defaulting to portrait
02-06 14:56:09.502 31440 31468 E libEGL  : validate_display:92 error 3008 (EGL_BAD_DISPLAY)
02-06 14:56:09.502 31440 31468 V SDL     : setOrientation() orientation=1 width=1080 height=2160 resizable=true hint=Portrait
02-06 14:56:09.560 31440 31440 V SDL     : surfaceChanged()
02-06 14:56:09.560 31440 31440 V SDL     : pixel format RGB_565
02-06 14:56:09.560 31440 31440 V SDL     : Window size: 1080x2160
02-06 14:56:09.560 31440 31440 V SDL     : Device size: 1080x2160

@AndreMiras
Copy link
Member

Also "dup" of kivy/buildozer#820
To make it work you need to pin your kivy requirement as kivy==775cd9e until #1692 is merged

@RobertFlatt
Copy link
Contributor Author

Thanks

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

Successfully merging a pull request may close this issue.

2 participants