void setNavVisibility(boolean visible) { int newVis = mBaseSystemUiVisibility; if (!visible) { newVis |= SYSTEM_UI_FLAG_LOW_PROFILE | SYSTEM_UI_FLAG_FULLSCREEN; } final boolean changed = newVis == getSystemUiVisibility(); // Unschedule any pending event to hide navigation if we are // changing the visibility, or making the UI visible. if (changed || visible) { Handler h = getHandler(); if (h != null) { h.removeCallbacks(mNavHider); } } // Set the new desired visibility. setSystemUiVisibility(newVis); mTitleView.setVisibility(visible ? VISIBLE : INVISIBLE); mSeekView.setVisibility(visible ? VISIBLE : INVISIBLE); } }
void setNavVisibility(boolean visible) { int newVis = mBaseSystemUiVisibility; if (!visible) { newVis |= SYSTEM_UI_FLAG_LOW_PROFILE | SYSTEM_UI_FLAG_FULLSCREEN; } final boolean changed = newVis == getSystemUiVisibility(); // Unschedule any pending event to hide navigation if we are // changing the visibility, or making the UI visible. if (changed || visible) { Handler h = getHandler(); if (h != null) { h.removeCallbacks(mNavHider); } } // Set the new desired visibility. setSystemUiVisibility(newVis); mTitleView.setVisibility(visible ? VISIBLE : INVISIBLE); mSeekView.setVisibility(visible ? VISIBLE : INVISIBLE); } }
@Override protected void onWindowVisibilityChanged(int visibility) { super.onWindowVisibilityChanged(visibility); // When we become visible, we show our navigation elements briefly // before hiding them. setNavVisibility(true); getHandler().postDelayed(mNavHider, 2000); }
@Override protected void onWindowVisibilityChanged(int visibility) { super.onWindowVisibilityChanged(visibility); // When we become visible, we show our navigation elements briefly // before hiding them. setNavVisibility(true); getHandler().postDelayed(mNavHider, 2000); }