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.
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
Asked: 2021-04-26 11:00:00 +0000
Seen: 9 times
Last updated: Jul 13 '21
How can a list be sorted alphabetically within a console application?
What is the accurate method for sinking to BigQuery by utilizing Dataflow Apache Beam?
How can the rejection of the class text_plain from JavaMail API due to a VerifyError be confirmed?
What is the process for generating a dynamic subdomain/URL using vue.js?
How can the style of the loader be modified while the form submission is being processed?
I'm attempting to develop a Javascript-based comments section for my website.
What are some feasible methods to enable MIDI file playback on a web browser?
How can I resolve the issue of being unable to use Fetch to POST an array of Selected Checkboxes?