Stack resize in Android/IOS

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
KimD
Posts: 203
Joined: Wed Jul 08, 2015 5:51 am
Location: Wellington, New Zealand

Stack resize in Android/IOS

Post by KimD » Tue Aug 23, 2016 12:03 am

In the real world in a mobile environment - what is going to cause the need to resize a stack?
- the app first being opened on the device
- change in device orientation
- what else?

Background - I'm coming to the conclusion that I've implemented massive over-kill in my resize stack handling. I'm effectively running a resize operation every time that a card is opened or re-opened. This must be slowing down screen re-draw times on my app. I'm now thinking that I'd be OK, in my portrait only app, to only resize a card the very first time that that card is opened on device X. Is this correct, or can users drag a window on an Android or IOS app? I've never dragged a window for any app on any of my mobile devices, but maybe I am just a Luddite and the cool kids are dragging app windows all of the time.

Thanks in advance

Kim

Pistris
Posts: 146
Joined: Mon Jul 20, 2015 2:40 am

Re: Stack resize in Android/IOS

Post by Pistris » Mon Aug 29, 2016 5:20 pm

Why are you resizing when you can use fullscreenmode?

MaxV
Posts: 1576
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Stack resize in Android/IOS

Post by MaxV » Fri Sep 02, 2016 3:37 pm

Any app is fullscreen, you can't resize the app.
Unfortunately the geometry manager still doesn't work on mobile, so you need to reposition all items on the card via code in the Preopencard message.
If you app is just graphic or with few text, you can avoid to reposition all items; just use the FullScreenmode property. 8)
Click on the underlined link to see more.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

bwmilby
Posts: 293
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Stack resize in Android/IOS

Post by bwmilby » Thu Sep 28, 2017 2:57 am

I know this is an old thread, but I've discovered why the geometry manager wasn't working on mobile. (Well, I only actually verified on iOS, but am guessing it is the same for Android). I've attached a test stack that I built on my system.
Screen Shot 2017-09-27 at 8.47.34 PM.png
Screen Shot
The Grow/Shrink buttons will take the stack from iPhone 4 size to full screen and back.
The Add... button will add the revCommonLibrary script to back (which is contained in the Common button)
If you touch grow/shrink right after launch, nothing is repositioned/scaled.
After you add the backscript, then the objects will adjust.
The email functionality changes when using the common library, so a button is included so you can see the difference.

The only function that you really need is:

Code: Select all

function revTargetStack pWhich
(Note that you will need to include correctly sized screen shots on iOS for the "fullscreen" to work correctly. I'm not sure about Android.)
Attachments
GeoTest.livecode.zip
Geometry Test Stack
(15.87 KiB) Downloaded 44 times
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

tomsve
Posts: 38
Joined: Tue Jan 20, 2015 5:01 pm
Location: Ukraine/Armenia

Re: Stack resize in Android/IOS

Post by tomsve » Sat Oct 07, 2017 2:56 pm

KimD wrote:
Tue Aug 23, 2016 12:03 am
In the real world in a mobile environment - what is going to cause the need to resize a stack?
- the app first being opened on the device
- change in device orientation
- what else?
I guess the "in-call status bar" (or "Personal Hotspot"/"Location") on iOS would also affect the size of the stack. I'm right now trying to figure out how to detect when the status bar is active, so I can resize the stack (move up the nav bar), but yet I haven't managed it...

Regards,
Tom

KimD
Posts: 203
Joined: Wed Jul 08, 2015 5:51 am
Location: Wellington, New Zealand

Re: Stack resize in Android/IOS

Post by KimD » Sun Nov 26, 2017 8:53 pm

Sorry for the delay. I haven't been on the forums for several months. Thanks for your comments / advice.

I've ended up writing my more recent android apps so that they only position graphical elements when the app first starts - and I haven't spotted any problems with this approach. It seems that in 2015 and 2016 I had completely mis-understood the need to resize. Hopefully this case of pilot error is now sorted.

Regards

Kim

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”