The Notch

Ralph DiMola rdimola at evergreeninfo.net
Tue Jan 29 20:40:50 EST 2019


For iOS it returns the rect of the largest rectangle on the screen in any of
3 orientations (iPhone X does not allow portrait upside down). An iPhone X
not only has the notch but rounded corners and the "swipe up home deal" area
that's always at the bottom and must remain visible and unimpaired.

Another wrinkle is "landscape and the iPhone X(all models)".

There are two layout choices for a rectangular landscape app. This assumes
you are already adding a margin on the notch and bottom(home swipe area)
sides.
#1) Use up to the top of the screen and add a margin on the non-notch side
so the app is not in the "curve" of the corner. This is what GetCardRect()
does.
#2) Use all the way to the edge of the non-notch side and add a top margin
so the app is not in the "curve" of the upper left or upper right
corner(depending on landscape left or right).
So you can choose 1 of 2 different aspect ratios for a landscape iPhone X LC
App.

< headache headache headache headache headache>

GetCardRect() also has the option to return the rect that does/doesn't
include the keyboard area if visible.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net


-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf
Of J. Landman Gay via use-livecode
Sent: Tuesday, January 29, 2019 6:35 PM
To: How to use LiveCode
Cc: J. Landman Gay
Subject: Re: The Notch

While Richard's recommendation is appealing, I can't really ask my customers
to follow through. ;) I guess what I need to know is:

What does the screenrect return on a notched phone?
How about the rect of the card? Is it different than the screenrect?

Google says the default display, with no flags set, places the app window
fully under the notch and blacks out the areas at the sides. How does this
affect the card size? Does it get shorter? Or crop? Or scale to the smaller
area as though the phone had a different aspect ratio, resulting in
pillarboxing?

Android has flags that allow the app to use the areas around the notch, but
LC doesn't tell us where those are, or even that a notch exists. I'm not
sure what iOS does. I'll have to fire up simulators and emulators I suppose,
but I'm hoping to save a lot of testing time if someone has already gone
through this.

On 1/29/19 4:40 PM, Ralph DiMola via use-livecode wrote:
> I have not yet addressed the Android notch. My LG v20 has an offset to 
> the right notch but it's reserved for the OS. For the iPhone I have a 
> function GetCardRect(). It returns a standard issue 4 item rect. I 
> don't use things like the "the top of this card...". As well as taking 
> in account for the keyboard it accounts for the iPhone notches. I select
"show the status bar"
> in the iOS standalone settings and GetCardRect() takes care of the 
> rest. You can even test in the IDE. I detect if the aspect ratio is an 
> iPhone with a notch and you can see what will happen on the X. This 
> was an easy implementation for me because I rolled my own device 
> independence control placement library long ago using GetCardRect() to
deal with the keyboard.
> This was long before the iPhoneX.  When the X appeared on the scene I 
> just added a dozen or so lines of code in GetCardRect() to deal with 
> it. iOS was very predictable because of Apples strict human interface 
> guidelines. It's out in the field and working nicely. But the Android is
another matter.
> There are so many variants to deal with. I just don't know how we can 
> deal with the Android notch without an LC implementation of an OS API 
> hook or a new Android manifest "Notch" key to keep the app out of the
notch(or both).
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdimola at evergreeninfo.net
> 
> 
> -----Original Message-----
> From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On 
> Behalf Of J. Landman Gay via use-livecode
> Sent: Tuesday, January 29, 2019 4:30 PM
> To: LiveCode Mailing List
> Cc: J. Landman Gay
> Subject: The Notch
> 
> I don't have an Android or iPhone with a notch. How do we deal with 
> positioning for those? Anything I need to know?
> 


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list