Using immersive mode on LibGDX

I have a portrait screen and you want to use the dive mode (not sticky dive). LibGDX also has an exciting feature:

AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); config.useImmersiveMode = true; 

But useImmsersive is a sticky dip.

+5
source share
1 answer

Instead of using useImmersive override onWindowFocusChanged in the AndroidLauncher class

  @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus && Build.VERSION.SDK_INT >= 19) { getWindows().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE); } } 
+4
source

All Articles