Created
July 14, 2017 14:49
-
-
Save murano500k/4c4daea69f93bdb0855d9eb6c451e9b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
View decorView = getWindow().getDecorView(); | |
decorView.setOnSystemUiVisibilityChangeListener | |
(new View.OnSystemUiVisibilityChangeListener() { | |
@Override | |
public void onSystemUiVisibilityChange(int visibility) { | |
// Note that system bars will only be "visible" if none of the | |
// LOW_PROFILE, HIDE_NAVIGATION, or FULLSCREEN flags are set. | |
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { | |
// TODO: The system bars are visible. Make any desired | |
// adjustments to your UI, such as showing the action bar or | |
// other navigational controls. | |
} else { | |
// TODO: The system bars are NOT visible. Make any desired | |
// adjustments to your UI, such as hiding the action bar or | |
// other navigational controls. | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment