Skip to content
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

weird orientation behavior #1698

Closed
zworkb opened this issue Feb 10, 2019 · 15 comments · Fixed by kivy/kivy#6164
Closed

weird orientation behavior #1698

zworkb opened this issue Feb 10, 2019 · 15 comments · Fixed by kivy/kivy#6164

Comments

@zworkb
Copy link
Contributor

zworkb commented Feb 10, 2019

with a current p4 master checkout and the python3 recipe I encounter a strange behavior concerning the app orientation on the device:

  • when the orientation is set to portrait the app behaves as expected
  • when orientation=landscape the app starts as expected until I come into the python code, then the app suddenly rotates 180 degrees and the app stands upside-down.
  • also trying other orientation (reverseLandscape, fullSensor) settings did not help, in those cases tha app switches to portrait mode.

Thanks
Philipp

@N43j
Copy link

N43j commented Feb 12, 2019

I have a similar problem when launching my application on my Android phone.

Whether I set “orientation” (to portrait) in the p4a options or not, my app goes to landscape mode, whatever I do.

I’m also using Python 3 and the master version of Python for Android, plus Kivy 1.10.1, Android API 28 and NDK r17c. I’m on Windows and using Windows subsystem for Ubuntu 18.04.

My app used to work fine, but a few days I go I did a full reinstallation. Since then I’m struggling to build a working application.

@OptimusGREEN
Copy link
Contributor

Have you tried using kivy master also?

@N43j
Copy link

N43j commented Feb 12, 2019

Yes (that’s what I meant by “the master version of Python for Android”).

@OptimusGREEN
Copy link
Contributor

you said you're using kivy 1.10.1, try adding kivy==master to your requirements.

@N43j

This comment has been minimized.

@tito
Copy link
Member

tito commented Feb 13, 2019

Just compiled with latest p4a master, got the issue :/
"* when orientation=landscape the app starts as expected until I come into the python code, then the app suddenly rotates 180 degrees and the app stands upside-down." < exactly

@ghost
Copy link

ghost commented Feb 13, 2019

I have a similar problem when launching my application on my Android phone.

Whether I set “orientation” (to portrait) in the p4a options or not, my app goes to landscape mode, whatever I do.

same problem after p4a update :(

@ghost
Copy link

ghost commented Feb 13, 2019

@tito @everyoneelse just to make it clear, this is expected behavior when using a kivy older than this commit kivy/kivy@b0befbe with a p4a with this commit or newer: 16b07ed

This is because old SDL2 ignored kivy always requesting landscape mode even when the app started up differently (which kivy did due to a bug), and 2.0.9 actually reacts to this breaking things in the process (so kivy needed to be updated to fix this).

So this is why kivy==master is required to fix this unless a kivy release with the commit above was already done, I'm not completely up to date on the kivy releases since I personally don't use it

@ghost
Copy link

ghost commented Feb 13, 2019

Also if you want to use sensor orientation, you'll need an even newer kivy with this commit or newer: kivy/kivy@775cd9e

Not sure what the state with user orientation is, but sensor & portrait & landscape should work fine if your kivy is new enough. (If user doesn't then it probably needs a similar fix as the sensor one in that particular commit)

@ghost
Copy link

ghost commented Feb 13, 2019

Follow-up from chat: kivy/kivy#6163 this could also possibly the issue here, I just made an assumption that might be wrong about another recent change regarding orientations

@ghost
Copy link

ghost commented Feb 14, 2019

kivy==master --> orientation is OK --> but no FULLSCREEN mode (.spec fullscreen=1)

@AndreMiras
Copy link
Member

The kivy recipe is already running on a version more recent than the last release, see https://github.com/kivy/python-for-android/blob/999df75/pythonforandroid/recipes/kivy/__init__.py
It's currently running on this commit kivy/kivy@a95d67f does it need to be update to an even more recent version?

@guysoft
Copy link

guysoft commented Feb 14, 2019

Ineed, fullscreen has a crazy refresh issue with kivy==master can confirm on my end too.

@inclement
Copy link
Member

Just merged a fix for the orientation issue.

@inclement
Copy link
Member

@guysoft Is there already a different issue for the fullscreen refresh? I'm not clear what the problem is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants