Questions tagged [display-cutouts]

19 questions
13
votes
4 answers

How to get DisplayCutout height when creating an Activity?

I have a game with full screen SurfaceView (Portrait) and thread that renders continously on the surface. The SurfaceView is initialized onCreate and its size is determined by the width and height of the screen in pixels. After it's created, it is…
luben
  • 2,512
  • 4
  • 30
  • 41
11
votes
1 answer

env(safe-area-inset-top) not working on Android Pie + WebView 69

I have a fullscreen cordova app, I used to use the css below for iPhone X's notch, padding-top: 25px; padding-top: env(safe-area-inset-top); and Android will ignore env(safe-area-inset-top), and use 25px to prevent the status bar from covering my…
Doctor.Who.
  • 607
  • 1
  • 7
  • 15
9
votes
7 answers

NULL Window Insets

I am trying to get the DisplayCutout and getting a java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.DisplayCutout android.view.WindowInsets.getDisplayCutout()' on a null object reference Here is my code: if…
slackwars
  • 504
  • 5
  • 18
7
votes
1 answer

WindowInsets.getDisplayCutout is NULL everywhere except within onAttachedToWindow in fullscreen Java app

I am having issues with getDisplayCutout() in my fullscreen Java app. I can only seem to get the value of the DisplayCutout within the onAttachedToWindow function. After that function completes, I can never get it again. Code to get the…
Lilbug
  • 171
  • 1
  • 10
7
votes
0 answers

Chrome meta viewport-fit=cover on an android with display cutouts

It appears that latest Chrome on Android 9 "Pie" does not behave as Safari on iPhone X when using the viewport-fit=cover. Safari stretches the content full screen, into the cutouts area while Chrome does not (see screenshot of Huawei Y6 below) Is…
lavirius
  • 467
  • 1
  • 5
  • 15
5
votes
2 answers

Android Navigation drawer problem with notch/display cutouts

I'm developing an Android application with the Android Studio template "Navigation Drawer Activity" but if I open the navigation drawer on a phone with Notch/display Cutouts the bigger status bar cover the top of the Navigation Drawer header. How…
Alex
  • 245
  • 3
  • 12
4
votes
1 answer

How to add LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES in Window Manager Params?

I am creating an Android App in which I am showing a floating view on top of all apps by using a service and Window Manager. I am trying to add WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES in my Window Manager params to…
3
votes
1 answer

Activity not extended below the cutout in landscape

In my activity I use the following code to turn on / off fullscreen. And by fullscreen I mean hiding / showing the status bar. The problem takes place on devices that has a Cutout (Where there's a camera) and the Status bar is visible and in…
Ashraf Alshahawy
  • 1,139
  • 1
  • 14
  • 38
2
votes
2 answers

React Native landscape mode - display over notch

I've started learning react native, and I created some simple landscape application, my issue is that the app doesn't display past the notch, which I'd want it to. I managed to solve it on portrait mode with: