I'm trying to display my app edge-to-edge but results are not even consistent across devices. ViewCompat.setOnApplyWindowInsetsListener
is called on Pixel 4a/5 but not on Pixel 3 XL and Essential PH-1, the app just draws behind the status bar when I try to set padding (with or without android:fitsSystemWindow="true"
). I suspect it's because of the notch (edge-to-edge doesn't work on Pixel 3 XL and Essential PH-1). I'm also using CoordinatorLayout
, DrawerLayout
, etc, so there's the whole fitsSystemWindow
thing. I can't seem to get it to work no matter what. Watched a couple of Chris Banes' presentations but I'm still clueless.
Asked
Active
Viewed 453 times
0

imashnake_
- 171
- 9
1 Answers
1
Could this problem be related to Display Cutoffs? Pixel 4a/5 have cutoffs whereas Pixel 3 doesn't.
From class WindowInsets.java:482
* Returns the display cutout if there is one.
* Note: the display cutout will already be consumed during dispatch to *View.onApplyWindowInsets, unless the window has requested a WindowManager.LayoutParams.layoutInDisplayCutoutMode other than never or default.
* Returns:
* the display cutout or null if there is none
* See Also:
* DisplayCutout
public DisplayCutout getDisplayCutout() {
return mDisplayCutout;
}

nsko
- 310
- 1
- 8
-
Very likely. This issue doesn't concern me anymore but in hindsight, that was probably what I would've checked. – imashnake_ Mar 21 '23 at 04:11