Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizing for Waterfall Displays? #1

Open
morta5 opened this issue Apr 13, 2022 · 17 comments
Open

Optimizing for Waterfall Displays? #1

morta5 opened this issue Apr 13, 2022 · 17 comments
Labels
bug Something isn't working can't reproduce This bug can't be reproduced by the developers and needs more information

Comments

@morta5
Copy link

morta5 commented Apr 13, 2022

I just opened the app for the first time(in fullscreen) on my Moto Edge Plus and noticed it's not optimized for Waterfall Displays. I can use it normally after disabling the edge screen but it would of course be better if optimized.
See the attached screenshots
Screenshot_20220413-194748
Screenshot_20220413-194733
Screenshot_20220413-194727
Screenshot_20220413-194730
Screenshot_20220413-194704
Screenshot_20220413-194424-599
Screenshot_20220413-194419

@grishka
Copy link
Member

grishka commented Apr 13, 2022

TIL that this device exists. It looks pretty similar to the Galaxy S9 I mostly debug the app on.

But, things getting beneath the status bar is something I'd like to avoid. Do they do something special with the window insets (it feels like they do)? Do they have any developer docs about that?

@morta5
Copy link
Author

morta5 commented Apr 13, 2022

https://developer.android.com/reference/android/view/DisplayCutout.html#getWaterfallInsets()

@grishka
Copy link
Member

grishka commented Apr 13, 2022

That's about the edges, but doesn't explain why systemWindowInsets seemingly aren't returned correctly 🤔

@morta5
Copy link
Author

morta5 commented Apr 13, 2022

Not sure but after tapping on the settings-icon and going back it is getting displayed correctly
Screenshot_20220413-210513
Edit: the screenshot I uploaded doesn't include the waterfall-area, which was in #282c37 when I made this screenshot. I think my device just disabled the waterfall.

@grishka
Copy link
Member

grishka commented Apr 13, 2022

Okay. Does it also fix itself if you rotate the screen? And it's Android 11 and stock ROM, right?

It might well be that my handling of window insets isn't 100% correct, so for now I'll wait to see if this issue happens on any other devices. In particular, I only have one device with a screen cutout (Pixel 4a), so my testing in this area is somewhat limited.

@morta5
Copy link
Author

morta5 commented Apr 13, 2022

No, it doesn't fix itself when rotating and yes, it's the stock Android 11 rom.
Btw can't you just emulate the waterfall in developer settings?
Screenshot_20220413-211748

@grishka
Copy link
Member

grishka commented Apr 13, 2022

Indeed I can, but I still can't reproduce the "toolbar ends up behind the status bar" thing 🤔
(this is an emulator with android 12)
screenshot

@morta5
Copy link
Author

morta5 commented Apr 13, 2022

It does only happen when using the "fullscreen" option to open the app, which should enable(or force idk.) the waterfall area.
Screenshot_20220413-212928-327

@grishka
Copy link
Member

grishka commented Apr 13, 2022

I'm leaning towards this being something Motorola did that can't be reproduced on AOSP/Pixel, but as I said, I'd like to collect more reports to see how many, and which, devices are affected, if any.

It does only happen when using the "fullscreen" option to open the app, which should enable(or force idk.) the waterfall area.

It does look like an OEM addition. There's no such thing on the emulator.

screenshot

@morta5
Copy link
Author

morta5 commented Apr 13, 2022

Sure, but do you also have (black)/#282c37/unused bars at the right and left of the screen on your S9 and are these intended?
The toolbar thing wasn't actually why I opened this issue, it was about the unused waterfall area(which is probably why this sometimes happens).

@grishka
Copy link
Member

grishka commented Apr 13, 2022

Sure, but do you also have (black)/#282c37/unused bars at the right and left of the screen on your S9 and are these intended?

Nope. But then it runs Android 9, and waterfall insets were only added in 10.

@grishka
Copy link
Member

grishka commented Apr 13, 2022

Anyway, I was bored and I wanted something similar for quite some time, so I made a simple app that visualizes the window insets in an easy to understand form. Could you please install it and take screenshots in both modes?

For those curious, here it is running on different devices

screenshot

screenshot

screenshot

screenshot

app-debug.apk.zip (remove .zip after downloading because github is picky about file types)

@morta5
Copy link
Author

morta5 commented Apr 13, 2022

Sure. Here are all screenshots in both modes (but there doesn't seem to be any difference between fullscreen and normal):
Screenshot_20220414-011002
Screenshot_20220414-010955
Screenshot_20220414-010937
Screenshot_20220414-010919
Screenshot_20220414-010906
Screenshot_20220414-010850
Screenshot_20220414-010813
Screenshot_20220414-010732

@grishka
Copy link
Member

grishka commented Apr 13, 2022

Thanks!

Setting LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS was probably not a good idea (and the Mastodon app doesn't do it). Try this one, there should be a difference in those modes with the checkbox unchecked:
app-debug.apk.zip

@morta5
Copy link
Author

morta5 commented Apr 13, 2022

Those marked with "F" were made in fullscreen mode
Screenshot_20220414-013154-272
Screenshot_20220414-013139-551
Screenshot_20220414-013110
Screenshot_20220414-013104
Screenshot_20220414-013049
Screenshot_20220414-013041
Screenshot_20220414-013030-241
Screenshot_20220414-013016-580
Edit: The screenshot of the last picture(fullscreen, no LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS) doesn't include the waterfall area which I can see. The visualisation in the background doesn't make a difference in fullscreen when checking and unchecking the box(for me, on the screen).

@grishka
Copy link
Member

grishka commented Apr 13, 2022

Hm. Yes it does look like I expect it to (the top system inset is there), the toolbar getting behind the status bar must be a bug in the way I handle insets then. Also strange how no DisplayCutout is returned at all when you don't set that layout mode 🤔

@morta5
Copy link
Author

morta5 commented Apr 13, 2022

Also strange how no DisplayCutout is returned at all when you don't set that layout mode 🤔

That seems to be a bug. I tried it a second time and now I am seeing the display cutout.
Screenshot_20220414-015013~2
Screenshot_20220414-015055
Edit: If fullscreen is enabled before opening it the first time after force-closing, you'll always get the cutout. If it was disabled, you only get it if this layout-mode is set.

@grishka grishka added bug Something isn't working can't reproduce This bug can't be reproduced by the developers and needs more information labels May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working can't reproduce This bug can't be reproduced by the developers and needs more information
Projects
None yet
Development

No branches or pull requests

2 participants