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

Fix screen orientation of PythonActivity.java #3004

Open
2 of 5 tasks
BlackCatDevel0per opened this issue Apr 10, 2024 · 0 comments
Open
2 of 5 tasks

Fix screen orientation of PythonActivity.java #3004

BlackCatDevel0per opened this issue Apr 10, 2024 · 0 comments

Comments

@BlackCatDevel0per
Copy link

BlackCatDevel0per commented Apr 10, 2024

Checklist

  • the issue is indeed a bug and not a support request
  • issue doesn't already exist: https://github.com/kivy/python-for-android/issues
  • I have a short, runnable example that reproduces the issue
  • I reproduced the problem with the latest development version (p4a.branch = develop)
  • I used the grave accent (aka backticks) to format code or logs when appropriated

Versions

  • Python: 3.10
  • OS: Android
  • Kivy: 2.3.0
  • Cython: 0.29.37
  • OpenJDK: 17

Description

Hi, could you please modify PythonActivity.java to either add additional options or to gracefully handle cases where the android.manifest.orientation parameter is already specified in the manifest? This adjustment would prevent conflicts and ensure smoother integration with buildozer.spec configurations.

Currently, users need to set it inside the app using mActivity.setRequestedOrientation. For example: mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_USER), full minimal code:

from android import mActivity

from jnius import autoclass

ActivityInfo = autoclass('android.content.pm.ActivityInfo')

mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_USER)

Screenshot from app's ipykernel (part of my sample in git repository):

image

image

Then everything works ok..

Spec file:

orientation = portrait
android.manifest.orientation = fullUser
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

No branches or pull requests

1 participant