Re: iphoneDeviceModel lookup library

2021-10-03 Thread Mark Smith via use-livecode
Thanks Andreas. Looking forward to trying it out.

Mark

Sent from my iPhone

> On Oct 3, 2021, at 11:44 AM, Andreas Bergendal via use-livecode 
>  wrote:
> 
> Hi guys,
> 
> This is for those of you who develop for iOS. We all know the challenge of 
> getting the layout right for various iOS screens. ”The notch” (camera area at 
> the top) is especially annoying, since there’s no easy way of knowing if the 
> user’s device has one or not, and how many pixels it is (there are 4 
> variants!).
> 
> In LC 9.6.3 iphoneDeviceModel was introduced. Where machine() just returns 
> ”iphone”, iphoneDeviceModel() returns e.g. ”iPhone10,6” (=iPhone X) or 
> ”iPad13,7” (=iPad Pro 11 inch).
> 
> But the Dictionary entry on iphoneDeviceModel just links to a Wikipedia page 
> listing mammoth tables of Apple device data. There is no way of knowing what 
> ”iPhone10,6” means without a decent lookup table.
> 
> So, I’ve made one! And a library to use it with! And a demo stack to test it 
> with!
> 
> It will check the device code of the current device, and return an array with 
> values for:
> - notch margin
> - portrait bottom margin
> - landscape bottom margin
> - (device model name - in the rare case that you'd need it)
> 
> You use these for determining the safe area your UI elements can use, when 
> rearranging them in response to the resizeStack message.
> Or e.g. how much taller the Header bar widget needs to be on a ”notch” device 
> in order to look good.
> 
> It’s all here and free to get, use and modify as you need:
> https://github.com/wheninspace/WISmobDeviceLib 
> 
> 
> The demo stack has the library in its stack script, and the full lookup array 
> in a cProp, so that stack is all you need really.
> Testing must be done by deploying to physical devices though, as 
> iphoneDeviceModel() does not work in the iOS Simulator (or, it works, but 
> just returns a code for the Simulator itself…).
> 
> Let me know if anything can be improved on (of course it can)! :)
> 
> The source for my data is this excellent website:
> https://www.screensizes.app/  which has 
> comprehensive screen info on every existing iOS device since the first iPhone.
> And this list which has the device codes interpreted:
> https://gist.github.com/adamawolf/3048717#file-apple_mobile_device_types-txt 
> 
> 
> Cheers,
> Andreas
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

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


Re: Sample stacks / revOnline [was: Re: Suggestion: Non-Appbuilding Community Edition]

2021-10-03 Thread Mark Wieder via use-livecode

On 9/30/21 7:02 AM, Alex Tweedly via use-livecode wrote:


  - a "require" or "include" mechanism for dependencies in libraries


LOL. That request is now some 17 years old.
https://quality.livecode.com/show_bug.cgi?id=1712


--
 Mark Wieder
 ahsoftw...@gmail.com

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


iphoneDeviceModel lookup library

2021-10-03 Thread Andreas Bergendal via use-livecode
Hi guys,

This is for those of you who develop for iOS. We all know the challenge of 
getting the layout right for various iOS screens. ”The notch” (camera area at 
the top) is especially annoying, since there’s no easy way of knowing if the 
user’s device has one or not, and how many pixels it is (there are 4 variants!).

In LC 9.6.3 iphoneDeviceModel was introduced. Where machine() just returns 
”iphone”, iphoneDeviceModel() returns e.g. ”iPhone10,6” (=iPhone X) or 
”iPad13,7” (=iPad Pro 11 inch).

But the Dictionary entry on iphoneDeviceModel just links to a Wikipedia page 
listing mammoth tables of Apple device data. There is no way of knowing what 
”iPhone10,6” means without a decent lookup table.

So, I’ve made one! And a library to use it with! And a demo stack to test it 
with!

It will check the device code of the current device, and return an array with 
values for:
- notch margin
- portrait bottom margin
- landscape bottom margin
- (device model name - in the rare case that you'd need it)

You use these for determining the safe area your UI elements can use, when 
rearranging them in response to the resizeStack message.
Or e.g. how much taller the Header bar widget needs to be on a ”notch” device 
in order to look good.

It’s all here and free to get, use and modify as you need:
https://github.com/wheninspace/WISmobDeviceLib 


The demo stack has the library in its stack script, and the full lookup array 
in a cProp, so that stack is all you need really.
Testing must be done by deploying to physical devices though, as 
iphoneDeviceModel() does not work in the iOS Simulator (or, it works, but just 
returns a code for the Simulator itself…).

Let me know if anything can be improved on (of course it can)! :)

The source for my data is this excellent website:
https://www.screensizes.app/  which has 
comprehensive screen info on every existing iOS device since the first iPhone.
And this list which has the device codes interpreted:
https://gist.github.com/adamawolf/3048717#file-apple_mobile_device_types-txt 


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