Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The correct class access in pyjnius to create a Kivy app in fullscreen mode is to use the android.view.View class to set the app window to full screen by accessing the setSystemUiVisibility method. Here is an example code snippet:

from jnius import autoclass
from kivy.logger import Logger

PythonActivity = autoclass('org.kivy.android.PythonActivity')
View = autoclass('android.view.View')

class FullScreenApp:
    def __init__(self):
        Logger.info('FullScreenApp: Initializing full screen app')
        activity = PythonActivity.mActivity
        decorView = activity.getWindow().getDecorView()
        decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_FULLSCREEN)

In this example, the autoclass function is used to import the necessary Java classes, including PythonActivity and View. The FullScreenApp class sets the system UI visibility of the app window to SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, and SYSTEM_UI_FLAG_FULLSCREEN to achieve a full screen mode.