Non Fullscreen Mode request

AndroidHarness has a variable set the orientation, but it doesn’t look like the window size can be changed. It would be nice to be able to create apps that still allow the notification bar to be displayed while the app is running.



Can a variable be added to AndroidHarness to allow for the window size to be set so the notification bar is still displayed?

I don`t know currently if a non fullscreen opengl surface is possible.



If you know how to do it i would be glad to integrate it 8)

@larynx



I was unable to get the sources to compile in Netbeans, but instead I created a new copy of AndroidHarness to do some testing. Here is what I came up with…



In the beginning of AndroidHarness, I added the following:



[java]

/**

  • Set the screen window size
  • if screenFullSize is true, then the notification bar and title bar are
  • removed and the screen covers the entire display
  • if screenFullSize is false, then the notification bar remains visible
  • if screenShowTitle is true while screenFullScreen is false, then the
  • title bar is also displayed under the notification bar<br />
    

*/

protected boolean screenFullScreen = false;

protected boolean screenShowTitle = true;

[/java]



Then in the onCreate of AndroidHarness, I made changes to the section that sets the window to full screen:



[java]

if (screenFullScreen) {

requestWindowFeature(Window.FEATURE_NO_TITLE);

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,

WindowManager.LayoutParams.FLAG_FULLSCREEN);

} else {

if (!screenShowTitle) {

requestWindowFeature(Window.FEATURE_NO_TITLE);

}

}

[/java]



When the display is left as default (ie. not setting fullscreen and not setting no_title), the surfaceview is automatically sized to leave the notification bar and title bar visible.



It seems to work well. However, I did find a side effect that I could not figure out. It looks like settings height and width gets changed to the correct width and height after simpleInitApp is finished but before simpleUpdate starts. For example, If a picture is attached to guiNode during simpleInitApp, settings.getHeight returns the full screen height. If a picture is attached to guiNode during simpleUpdate, settings.getHeight returns the lower height value (ie. after subtracting the notification bar and title bar).



Is that something you can look into? It’s working for me now, as long as I place my guiNode objects in the first scan of simpleUpdate instead of in simpleInitApp. Not the best. Would be better if simpleInitApp was done after the screen is created.



Let me know what you think.