MobilecontrolSet native scroller on LC10. Does it works?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

trevix
Posts: 962
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

MobilecontrolSet native scroller on LC10. Does it works?

Post by trevix » Wed May 10, 2023 6:29 pm

I'm having problems with the native scroller, both on scrolling a group and using Datagrid tables, on LC10 (unfortunately I am stuck with this version).
Is this me or some new bug is born?
My problems are with the contentRect (completely disalagned, no matter wha,t on respect to the content) and on vscroll. Also i get different behaviours on iOS simulator, iOS hardware and Android.

Before putting together a test stack, I would like to know if others had similar problems.
Thanks
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

trevix
Posts: 962
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by trevix » Thu May 11, 2023 10:02 am

Hello.
I attached a sample stack, that should work on IDE, on iOS and Android.
It seems to me that the problem could be me and not LC10, since I cannot find a correct "fullscreenmode" combination (most of my standalone is run in "letterbox").
I would like the 2 scolling list to be resized in height, according to the available screen height, taking in account screen peculiarity like in iPhone Pro Max (the OS forniture, like the camera).
But, of course, I need the scrolling to work, showing all the names when scrolled down.

I have done several mobile scrollers in the past, but I always struggle to get them to work correctly .
Any help?

Thanks
Trevix
Attachments
ScrollerTest 2.livecode.zip
(6.38 KiB) Downloaded 58 times
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by bn » Thu May 11, 2023 1:05 pm

Hi Trevix,

looking at your code regarding scrolling on mobile in the scripts of group "GroupTeams" and group "GroupPlayers":

Code: Select all

     mobileControlSet sScrollerId, "contentRect", (0, 0, tWidth, tFormattedHeight)

Code: Select all

     set the height of field "FldList" of me to tFormattedHeight -- < this line
     set the top of field "FldList" of me to the top of me
     
     --set the listbehavior of fld "FldList" of me to true --false
end StartScroller
You set the contentRect to tFormattedHeight and then set the height of the field to tFormattedHeight.
If both are the same there is nothing to scroll.
Try to set the height of field "FldList" to the height it should have on the screen and if tFormattedHeight of the field is greater than the height of the field the scroller should kick in.

Unfortunately I can not test this for mobile because my setup is not up to date.

KInd regards
Bernd

trevix
Posts: 962
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by trevix » Thu May 11, 2023 1:42 pm

For what I understand...
On line 21 I set the height of the field to the same height of the group that conatains it.
This in order to be able to scroll "the field" in the IDE, since on line 23 I exit "StartScroll" if not mobile.

On mobile instead (on the following lines) the field is FormattedHeighted, so that the mobile control can scroll it, showing only the group height.

The mobilescroller works fine if on PreOpencard I set the fullscreenmode to empty, but the display is not (objects are not entered as they should):
Simulator  - iPhone 14 Pro Max - 1.png
If instead on PreOpencard I set the fullscreenmode to letterbox, the display is correct, but the scroller does not seem to work well (Simulator - iPhone 14 Pro Max - 2)
Simulator - iPhone 14 Pro Max - 2.png
You can test it also on simulator with LC 9.6.9

What am I doing wrong?
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

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

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by bwmilby » Fri May 12, 2023 2:13 am

I can’t get on my computer to look right now but the problem that you are running into is that the mobile scroller uses the actual screen coordinates which becomes a math problem when using any fullscreenmode. Best way, in my opinion, is to write a resizeStack handler to adjust the layout.
Brian Milby

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

trevix
Posts: 962
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by trevix » Fri May 12, 2023 9:02 am

I have a resizestack handler, but apparently it is not correct.
Interesting what you said, that the mobile scroller uses different screen coordinates then what I am using.
Will have to explore this.
Any suggestion on the two "parallel" world?
Essentially what I need, for example, using the various fullscreenmode, is to get the screen height according to the mobile control and the screen height according to LC. "working screenRect" ?
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

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

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by bwmilby » Fri May 12, 2023 12:43 pm

There was a thread about this type of issue on the list a while back. I can't test right now, but this is what was used as part of the solution:

Code: Select all

put globalloc(the topleft of grc "scan"),globalloc(the bottomright of grc "scan") into newRect
Brian Milby

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

trevix
Posts: 962
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by trevix » Fri May 12, 2023 6:50 pm

How stupid I was..the resizeStack wasn't running , because on preopenCard I had:

Code: Select all

set the rect of this stack to the rect of this stack
Replaced with

Code: Select all

   resizeStack the width of this stack, the height of this stack
So, now everything works using the fullscreenmode set to empty.
(I tried with "letterBox" but there is no way I can make the mobile scroller work.)

Unfortunately, in my standalone, I get to this card coming from another card of the same stack where the fullscreenmode is set to "letterBox".
Recap:
  • I open my substack with fullscreenmode is set to "letterBox"
  • I navigate saveral cards without changing the fullscreenmode
  • Before going to my vertical list card, I set the fullscreenmode to empty
  • I go next: the mobile scroller does not work
It looks like the fullscreenmode gets set once for the substack and cannot be changed from card to card.
Can someone confirm me this?
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7238
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by jacque » Fri May 12, 2023 9:04 pm

I haven't looked at your stack (sorry) but a couple of tips. You may already be doing some of this.

Mobile scrollers must be created dynamically when needed (usually on pre- or openCard) and deleted when leaving the card.

Set the scroll of the content field to 0 before creating the scroller. The gap you see at the top is usually caused by a field that is already partly scrolled when the mobile scroller is created. It doesn't hurt to also set the vScroll of the mobile scroller to 0 as well just to be safe.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

trevix
Posts: 962
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by trevix » Fri May 12, 2023 9:21 pm

Here is my updated sample stack.
Run it on the iPhone simulator
On launch, if you chose "empty" at the FullScreenMode prompt, everything works fine.
If you chose "letterBox", the mobile scroller gets screwed up.

As you see, changing the FullScreenMode going from card to card does not make a difference.

I hope you can help (it has been a long f...g week on this, now :shock: )
Attachments
ScrollerTest 2.livecode.zip
(6.66 KiB) Downloaded 61 times
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

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

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by bwmilby » Mon May 15, 2023 5:54 pm

I’ve downloaded the stack and observed the issue. Hopefully I will get some time to work with it over the next few days. My initial solution didn’t pan out though (trying to figure out global coordinates for the scroller).

I think you should be able to set the fullscreenmode upon arriving at the card (and restore upon leaving if needed). I know that the SivaSiva project that I have worked on mixes fullscreenmodes, but mainly when switching between stacks.
Brian Milby

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

trevix
Posts: 962
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: MobilecontrolSet native scroller on LC10. Does it works?SOLVED

Post by trevix » Tue May 16, 2023 9:21 am

I can't believe it!
After almost a week of testing, the solution was to place a delay of 300 milliseconds before creating the mobile scroller.
Apparently the resizing of the card on opening, overlap the mobile control creation.
I don't know. I am just glad it is over.

Let me grumble a little:
Instead of diverting resources to some AI no code future project, LC should commit to its initial idea: an easy multiplatform code environment.
How long have we been waiting for unified controls that work on all platform?
Now we have an IDE field, a mobile control field for iOS and Android, an Android only native field. Same for buttons. Each one with its idiosyncrasies :(
Trevix
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

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

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by bwmilby » Tue May 16, 2023 7:22 pm

Glad to hear you solved the issue. Did you stick with letterbox or change to none?
Brian Milby

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by FourthWorld » Tue May 16, 2023 8:32 pm

Why don't scrolling fields just scroll?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7238
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: MobilecontrolSet native scroller on LC10. Does it works?

Post by jacque » Tue May 16, 2023 10:42 pm

FourthWorld wrote:
Tue May 16, 2023 8:32 pm
Why don't scrolling fields just scroll?
If all the Xavvi stuff happens I'm guessing they will. There's supposed to be a lot of cross platform, universal widgets. I hope they make their goal. I increased my pledge because I want to use databases without knowing anything about them.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”