SOLVED Help hide the Navbar

Monkey Targets Forums/Android/SOLVED Help hide the Navbar

Manux(Posted April) [#1]
Hello fellow Monkeys,

I try to hide the Android Navbar now for like 2 days. Without success.

I know i need to use some native java code and i could successfully implement the loading mechanism into monkey.

However, the native code bit is not working. There are so many examples out there and no imports are given ever...

The only thing i managed was to compile a whole class for hiding the navbar ( https://gist.github.com/gelldur/9c22ab760ebbc976c95b ), but then, i believe it is not possible to generate a new class instance from native code.

Could someone share his working native java code for hiding the navbar please ?

And or provide some insight, if i can indeed generate a new object from an external class.

For interested ones i get: getWindow() does not exist....

Thanks!
Manux


TeaBoy(Posted April) [#2]
you have probably tried this, but have you looked at the code sample here : https://developer.android.com/training/system-ui/navigation.html


Manux(Posted April) [#3]
Hello TeaBoy,

Thanks for the reply. Yes i have tried to use the code but as it is not a fully functioning method (imports are missing and so on) i was not able to make it work.
Also i tried to put the code into a static method and load it (i copied a lot of import from other clases and tried to import view and so on...) i get the above error:

View decorView = getWindow().getDecorView();
getWindow() does not exist..

I get basically the same error as described here (useing the same code and variations of it): http://www.monkey-x.com/Community/posts.php?topic=7995
Sadly this thread does not have a solution. :-((

All in all i can say that all the native java stuff is a bit of a mystery to me. I also need help with resetting opengl es 2.0 in the resume method and so on but i will make a second thread for this.

Thanks for the help so far!


therevills(Posted April) [#4]
Maybe you want immersive full-screen instead?

Try this native code:

https://github.com/swoolcock/diddy/blob/develop/src/diddy/native/fullscreen.android.java


Manux(Posted April) [#5]
Hello revills,

Thanks for the code!

After some fiddeling, i made it. Its not 100% clear why it has to be like that. But it works and thats what counts.

Here is my code:
#If TARGET="android"
  	Import "native/hideNav.java"
Extern
	Class NativeFullScreen = "NativeFullScreen" 'The native name of this class is 'xyzDriver'.
		'Method NativeFullScreen() 'By default, native name is same as declaration name - Method1 here.
		Method EnableFullScreenMode() 'native name is Method2
		Method IsFullScreen() 'native name is Method2
		Method DisableFullScreenMode() 'native name is Method2
		Method onResume() 'native name is Method2
	End
		
#Endif	



in the onCreate()
#If TARGET="android"
		Local nFullScreen:NativeFullScreen = New NativeFullScreen
		nFullScreen.EnableFullScreenMode()
		nFullScreen.IsFullScreen()
		nFullScreen.onResume()
		nFullScreen.DisableFullScreenMode()
		
		#EndIf