fullscreenmode and rect of a substack on mobile device ?

J. Landman Gay jacque at hyperactivesw.com
Mon Aug 20 04:50:42 EDT 2018


On 8/19/18 11:11 PM, Brian Milby via use-livecode wrote:
> When the engine resizes the stack, I’m assuming that it takes into account any system furniture? That isn’t a consideration for iOS (at least yet). I’m excluding keyboard for the moment.

The screenrect is always the actual size of the screen. The stack rect 
is the size of the available space minus the OS furniture. On my old 
Nexus tablet:

Actual stack size in IDE: 493 x 597
Nexus screenrect: 0,0,600,912
Nexus stack rect: 0,24,600,912 -- 24 px status bar at the top
Nexus card rect: 0,0,600,888

These are logical pixels. The Nexus 7 has a pixel density of 323 ppi, 
aspect ratio 16:10, screen pixels 1920 x 1200.

> I’m not sure why there should be a difference between any platform though. Line 14 put the group’s center 25px above the bottom of the stack which should have put it right on the bottom edge of the screen. The group is 50px tall and the icons are 32px square. I can see them being off left/right side of narrower devices, but if off the bottom that does not seem right. Maybe we should replace the group with a single grc as a test. Also, the top of the group rect should match the bottom of the browser rect. Everything is done by logical px on iOS... is it different on Android?

On Android, screen sizes and pixel densities vary a lot. LC does use 
logical pixels for some metrics but without fullScreenMode you're on 
your own to figure out what ratio and resizing you need to use to get 
the placement just right. I'm guessing that the group wasn't scaled for 
my phone and was just too tall to display fully.

LC automatically calculates and scales logical pixels on iOS, so 
non-retina and retina devices give you back the same numbers. You can 
work with the real screen pixels on iOS by setting the 
iphoneUseDeviceResolution, which may show a difference. Without 
fullscreenMode, LC doesn't auto-scale controls on Android, you need to 
set the rects of everything.

> 
> In the end, I guess I need to get an Android device so I can start testing.

To really test on Android you need 5 or 6 devices. :)

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





More information about the use-livecode mailing list