Im developing a game for the kindle fire, the game always run with the bar hidden.
Only when the user enters to the pause menu the bar should appear , I only want that the bar shows up over the game.
But it seems that when the bar show up GlSurfaceView.getHeight() changes from 600 to 580, and my game resizes, but I dont want that behavior,
I just want that the bar shows up over the game and my game doesnt move , I've already tried with GlSurfaceView.setMinimumHeight(600);
but the kindle simply ignores that.
this is how my game always runs :
and when i activate the bar this happens :
instead of this :
you know a way to avoid this?
Thanks!
To create the GlSurfaceView i do the following:
OnCreate() {
s_activity.m_view = new GameGLSurfaceView(s_activity.getApplication(), true, pixelSize,depthSize, stencilSize);
}
public GameGLSurfaceView(Context context, boolean translucent,int pixelSize, int depth, int stencil)
{
super(context);
mRenderer = new GameRenderer(context, this);
setRenderer(mRenderer);
}
to Hide and show the bar i use this function
private static final int AMAZON_FLAG_NOSOFTKEYS = 0x80000000;
private static final int FLAG_SUPER_FULLSCREEN = AMAZON_FLAG_NOSOFTKEYS | WindowManager.LayoutParams.FLAG_FULLSCREEN;
public static void toggleKindleBar(final int toDo)
{
if( s_activity != null)
s_activity.runOnUiThread(new Runnable()
{
public void run()
{
s_activity.getWindow().clearFlags( toDo!=1? WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN : FLAG_SUPER_FULLSCREEN);
s_activity.getWindow().addFlags( toDo!=1? FLAG_SUPER_FULLSCREEN:WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
});
}