Hiding the system navigation bar

I have a video player app and I try my best to hide the navigation 100% of the time. My problem occurs when I quickly double tap the screen. I would imagine the navigator will hide along with the rest of the system interface on a second tap, but it stays on the screen. This does not happen if I wait half a second or more between taps.

Debugging the application shows that the method hideSystemUI()

is called at the appropriate time, it just doesn't do what it expected.

Any idea on what might be wrong? Tested on 5.1.1.

Relevant code:

MediaPlayerWrapper

public void hideSystemUI()
{
    setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
            | View.SYSTEM_UI_FLAG_FULLSCREEN ); // hide status bar*/

}

      

CustomMediaController extends MediaController

public void onWindowVisibilityChanged(int visibility)
{
    super.onWindowVisibilityChanged(visibility);
    if (!isShowing())
    {
        _mediaPlayerWrapper.hideSystemUI();
    }
}

      

+3


source to share





All Articles