mastodon-android
mastodon-android copied to clipboard
Optimizing for Waterfall Displays?
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
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?
https://developer.android.com/reference/android/view/DisplayCutout.html#getWaterfallInsets()
That's about the edges, but doesn't explain why systemWindowInsets
seemingly aren't returned correctly 🤔
Not sure but after tapping on the settings-icon and going back it is getting displayed correctly
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.
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.
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?
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)
It does only happen when using the "fullscreen" option to open the app, which should enable(or force idk.) the waterfall area.
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.
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).
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.
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
app-debug.apk.zip (remove .zip after downloading because github is picky about file types)
Sure. Here are all screenshots in both modes (but there doesn't seem to be any difference between fullscreen and normal):
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
Those marked with "F" were made in fullscreen mode
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).
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 🤔
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.
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.