This commit is contained in:
Thomas 2020-11-25 09:31:39 +01:00
parent 3634e5e232
commit 85164c18e9
1 changed files with 6 additions and 6 deletions

View File

@ -1353,11 +1353,9 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
private void toogleFullscreen(boolean fullscreen) {
if (fullscreen) {
WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
attrs.flags &= ~WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
getWindow().setAttributes(attrs);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN |
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Objects.requireNonNull(getSupportActionBar()).hide();
binding.bottomVideo.setVisibility(View.GONE);
Objects.requireNonNull(getSupportActionBar()).hide();
if (videoOrientationType == videoOrientation.LANDSCAPE) {
@ -1366,7 +1364,9 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
} else {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
Objects.requireNonNull(getSupportActionBar()).show();
binding.bottomVideo.setVisibility(View.VISIBLE);
Objects.requireNonNull(getSupportActionBar()).show();
}