mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-10-23 19:37:39 +00:00
Android 11: transparent navigation and status bars
This commit is contained in:
@@ -2003,6 +2003,10 @@ public class VideoDetailFragment
|
||||
}
|
||||
activity.getWindow().getDecorView().setSystemUiVisibility(0);
|
||||
activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
||||
if (Build.VERSION.SDK_INT >= 30 /*Android 11*/) {
|
||||
activity.getWindow().setStatusBarColor(ThemeHelper.resolveColorFromAttr(
|
||||
requireContext(), android.R.attr.colorPrimary));
|
||||
}
|
||||
}
|
||||
|
||||
private void hideSystemUi() {
|
||||
|
@@ -27,6 +27,7 @@ import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.ContentObserver;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Point;
|
||||
import android.net.Uri;
|
||||
@@ -1475,6 +1476,9 @@ public class VideoPlayerImpl extends VideoPlayer
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
|
||||
getParentActivity().getWindow().getDecorView().setSystemUiVisibility(visibility);
|
||||
if (Build.VERSION.SDK_INT >= 30 /*Android 11*/) {
|
||||
getParentActivity().getWindow().setStatusBarColor(Color.TRANSPARENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user