Skip to content

Instantly share code, notes, and snippets.

@kived
Created August 5, 2014 20:37
Show Gist options
  • Save kived/04c1d7a9105f0815efcd to your computer and use it in GitHub Desktop.
Save kived/04c1d7a9105f0815efcd to your computer and use it in GitHub Desktop.
make immersive (py4a)
from android.runnable import run_on_ui_thread
from jnius import autoclass
mActivity = autoclass('org.renpy.android.PythonActivity').mActivity
View = autoclass('android.view.View')
@run_on_ui_thread
def make_immersive():
view = mActivity.getWindow().getDecorView()
view.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment