Enter fullscreen mode only on devices with API >= 19

This commit is contained in:
Alexander Sytnyk 2017-11-01 15:22:32 +02:00
parent 9e88a67182
commit fe803ac326

View file

@ -687,17 +687,14 @@ public class MapControlsLayer extends OsmandMapLayer {
} }
public void switchStatusbarAndNavbarVisibility() { public void switchStatusbarAndNavbarVisibility() {
int uiOptions = mapActivity.getWindow().getDecorView().getSystemUiVisibility();
if (Build.VERSION.SDK_INT >= 14) {
uiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
}
if (Build.VERSION.SDK_INT >= 16) {
uiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
}
if (Build.VERSION.SDK_INT >= 19) { if (Build.VERSION.SDK_INT >= 19) {
View decorView = mapActivity.getWindow().getDecorView();
int uiOptions = decorView.getSystemUiVisibility();
uiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
uiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
uiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; uiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
decorView.setSystemUiVisibility(uiOptions);
} }
mapActivity.getWindow().getDecorView().setSystemUiVisibility(uiOptions);
} }
public void startNavigation() { public void startNavigation() {