Last active
September 28, 2016 15:55
-
-
Save SammyVimes/9c120e1c1c9d6d838449f196089b5587 to your computer and use it in GitHub Desktop.
ффф
This file contains 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
@Override | |
public void onWindowFocusChanged(boolean hasFocus) { | |
super.onWindowFocusChanged(hasFocus); | |
// логика | |
} | |
private void toggleFullscreen(final boolean fullscreen) { | |
getSupportActionBar().hide(); | |
if (fullscreen) { | |
if (Build.VERSION.SDK_INT >= 19) { | |
this.getWindow().getDecorView() | |
.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | |
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | |
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | |
| View.SYSTEM_UI_FLAG_FULLSCREEN | |
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); | |
} else { | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
} | |
} else { | |
if (Build.VERSION.SDK_INT >= 19) { | |
this.getWindow().getDecorView() | |
.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | |
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION | |
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, | |
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION | |
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); | |
} else { | |
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
} | |
} | |
} |
This file contains 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
q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment