Ask Your Question
0

What is the correct class access in pyjnius to create a Kivy app in fullscreen mode?

asked 2021-04-26 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-07-13 04:00:00 +0000

lakamha gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-04-26 11:00:00 +0000

Seen: 9 times

Last updated: Jul 13 '21