Page 3 of 3

Re: iPhoneSafeAreaInsets

Posted: Thu Nov 03, 2022 5:42 pm
by SWEdeAndy
jacque wrote: Thu Nov 03, 2022 5:25 pm
stam wrote: Wed Nov 02, 2022 5:35 pm I’m sure there are Android phones with a notch as well? Or am I mistaken?
There were a few back when iPhones first got the notch and Android manufacturers copied it. It was almost universally hated so it disappeared fairly quickly.
That sounds promising, and may reduce the nightmare potential a bit. I see, however, that e.g. most Samsung Galaxy models have a "hole-punch" for the front camera, which is not as intrusive as a notch, but still makes it necessary for the app designer to make sure no UI elements end up in the middle of it.

At least the new iPhone 14 has done away with the notch. Oh wait, it has a "dynamic island" instead! :shock:

Re: iPhoneSafeAreaInsets

Posted: Thu Nov 03, 2022 5:48 pm
by stam
Had a quick gander at google images - seems like it was full carbon-copy of iPhones around 2018-2019 and many had a proper notch, but many have reduced this significantly in size although still present in some form or other.

What made me laugh were some 'authoritative' articles mentioning that this was better than iPhone - as proof they showed iPhones with faked massive notches filling 90% of the top of the screen - gotta love photoshop lol ;)

Re: iPhoneSafeAreaInsets

Posted: Thu Nov 03, 2022 6:41 pm
by jacque
SWEdeAndy wrote: Thu Nov 03, 2022 5:42 pm That sounds promising, and may reduce the nightmare potential a bit. I see, however, that e.g. most Samsung Galaxy models have a "hole-punch" for the front camera, which is not as intrusive as a notch, but still makes it necessary for the app designer to make sure no UI elements end up in the middle of it.
The hole punch is common now. Android developers can make use of it and there are wallpapers that use the hole as part of their design, for example, an animal where the hole is the eye pupil. I've installed an extension that draws a ring around the hole to show the battery level and whether the device is charging.
https://play.google.com/store/apps/deta ... nergy_ring
(The labels are in English on my phone).

Re: iPhoneSafeAreaInsets

Posted: Sun Sep 27, 2026 5:37 pm
by trevix
Hello.

I took the Mark's "Test safeAreaInsets.livecode", renamed to "Test safeAreaInsets2.livecode" and added a little code, using LC 10.0.6 RC1, on the card, in order to verify what happens on rotation.

On iPad, where the OS status bar is always visible, on portrait and on landscape: works correctly, placing the button always below the status bar.

On iPhone, where the OS status bar is visible on portrait, BUT not on landscape:
1 corret position on portrait after launch (below the OS status bar)
2 correct position on landscape (top of the screen), since the status bar is hidden.
3 wrong position returning to portrait (covers the OS status bar making it unreadable)

Anyone knows what is going on?

One more question: is the "working" screenrect really working on iOS? Shouldn't it return the same values as the following code?

Code: Select all

command defineSafeAreaRect
   -- defines the safe area of the screen. Result is put into lSafeAreaRect
   put the screenRect into lSafeAreaRect
   add item 1 of iphoneSafeAreaInsets() to item 1 of lSafeAreaRect
   add item 2 of iphoneSafeAreaInsets() to item 2 of lSafeAreaRect
   subtract item 3 of iphoneSafeAreaInsets() from item 3 of lSafeAreaRect
   subtract item 4 of iphoneSafeAreaInsets() from item 4 of lSafeAreaRect
end defineSafeAreaRect
Test safeAreaInsets2.livecode.zip
(1.96 KiB) Downloaded 16 times

Re: iPhoneSafeAreaInsets ADDENDUM

Posted: Sun Sep 27, 2026 9:49 pm
by trevix
I just discovered that If I put a wait "1 milliseconds with messages" before the "defineSafeAreaRect" of the "resizeStack" handler, it works.

Note:
NOT 0 milliseconds
Onlys > 0 milliseconds

This is ridicolous: how can a programmer handle these things...