From: DeaDDooMER Date: Sun, 29 Jul 2018 19:40:06 +0000 (+0300) Subject: Android: added navigation bar hiding hack X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=7865a4777ac1d3f4c759b7bec136c69ebbfaf7ac;p=d2df-sdl.git Android: added navigation bar hiding hack --- diff --git a/android/src/org/d2df/app/Doom2DF.java b/android/src/org/d2df/app/Doom2DF.java index 07e63ee..6141102 100644 --- a/android/src/org/d2df/app/Doom2DF.java +++ b/android/src/org/d2df/app/Doom2DF.java @@ -23,6 +23,7 @@ public class Doom2DF extends SDLActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + CopyAssets.copyAssets(SDL.getContext(), ""); CopyAssets.copyAssets(SDL.getContext(), "data"); CopyAssets.copyAssets(SDL.getContext(), "data/models"); diff --git a/android/src/org/libsdl/app/SDLActivity.java b/android/src/org/libsdl/app/SDLActivity.java index 57f931e..585ad30 100644 --- a/android/src/org/libsdl/app/SDLActivity.java +++ b/android/src/org/libsdl/app/SDLActivity.java @@ -217,6 +217,8 @@ public class SDLActivity extends Activity { SDLActivity.onNativeDropFile(filename); } } + + hideNavigationBar(); } // Events @@ -241,6 +243,8 @@ public class SDLActivity extends Activity { mNextNativeState = NativeState.RESUMED; mIsResumedCalled = true; + hideNavigationBar(); + if (SDLActivity.mBrokenLibraries) { return; } @@ -456,6 +460,8 @@ public class SDLActivity extends Activity { InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0); + hideNavigationBar(); + mScreenKeyboardShown = false; } break; @@ -843,6 +849,15 @@ public class SDLActivity extends Activity { return messageboxSelection[0]; } + public static void hideNavigationBar() { + if (Build.VERSION.SDK_INT >= 19) { + int opt = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + mSingleton.getWindow().getDecorView().setSystemUiVisibility(opt); + } + } + @Override protected Dialog onCreateDialog(int ignore, Bundle args) {