From 981a7c78512801b417f861b0862cabfbd79eb97a Mon Sep 17 00:00:00 2001 From: seven332 Date: Sat, 6 Apr 2019 12:43:33 +0800 Subject: [PATCH] Apply fullscreen for phone with notch --- app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java b/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java index 671c9b945..27e1cc643 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java +++ b/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java @@ -375,6 +375,11 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { // Screen lightness setScreenLightness(Settings.getCustomScreenLightness(), Settings.getScreenLightness()); + // Cutout + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + getWindow().getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + if (Settings.getGuideGallery()) { FrameLayout mainLayout = (FrameLayout) ViewUtils.$$(this, R.id.main); mainLayout.addView(new GalleryGuideView(this));