From f0345d520105558150538033f35fc3b9090e91d1 Mon Sep 17 00:00:00 2001 From: Jonathan De Wachter Date: Fri, 20 Jun 2014 03:28:43 +0200 Subject: [PATCH] [Android] Hide the navigation bar --- src/SFML/Main/MainAndroid.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/SFML/Main/MainAndroid.cpp b/src/SFML/Main/MainAndroid.cpp index 1e55fc534..d0de4b3bb 100644 --- a/src/SFML/Main/MainAndroid.cpp +++ b/src/SFML/Main/MainAndroid.cpp @@ -421,6 +421,24 @@ void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_ ANativeActivity_setWindowFlags(activity, AWINDOW_FLAG_FULLSCREEN, AWINDOW_FLAG_FULLSCREEN); + // Hide the navigation bar + JavaVM* lJavaVM = activity->vm; + JNIEnv* lJNIEnv = activity->env; + + jobject objectActivity = activity->clazz; + jclass classActivity = lJNIEnv->GetObjectClass(objectActivity); + + jmethodID methodGetWindow = lJNIEnv->GetMethodID(classActivity, "getWindow", "()Landroid/view/Window;"); + jobject objectWindow = lJNIEnv->CallObjectMethod(objectActivity, methodGetWindow); + + jclass classWindow = lJNIEnv->FindClass("android/view/Window"); + jmethodID methodGetDecorView = lJNIEnv->GetMethodID(classWindow, "getDecorView", "()Landroid/view/View;"); + jobject objectDecorView = lJNIEnv->CallObjectMethod(objectWindow, methodGetDecorView); + + jclass classView = lJNIEnv->FindClass("android/view/View"); + jmethodID methodsetSystemUiVisibility = lJNIEnv->GetMethodID(classView, "setSystemUiVisibility", "(I)V"); + lJNIEnv->CallVoidMethod(objectDecorView, methodsetSystemUiVisibility, (jint)(2 | 4)); + // Initialize the display eglInitialize(states->display, NULL, NULL);