DEADSOFTWARE

Android: added navigation bar hiding hack
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Sun, 29 Jul 2018 19:40:06 +0000 (22:40 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Sun, 29 Jul 2018 19:40:33 +0000 (22:40 +0300)
android/src/org/d2df/app/Doom2DF.java
android/src/org/libsdl/app/SDLActivity.java

index 07e63eeb8743f971221a2f252c3a1550cd79e533..614110270add01ed5a2464755993dca55259e793 100644 (file)
@@ -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");
index 57f931e356934049995e79404f0537a88dcb0c82..585ad30a12ca85d5ee928a18cf1728059259174b 100644 (file)
@@ -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) {