Can't set the vscroll of a native scroller

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
giovanni_c
Posts: 52
Joined: Sat Sep 08, 2012 10:50 am

Can't set the vscroll of a native scroller

Post by giovanni_c » Thu Jan 23, 2014 4:50 pm

Hi all!
I'm here to ask a little question.
I'm using a native scroller for a group in a card of the stack.
After the creation of the scroller I set the "vscroll" property of the scroller to the formattedHeight of the group to scroll because I want to initialize my group starting from its bottom.
My code sound like this:

Code: Select all

put the rect of myGroup into tRect
put 0 into item 2 of tRect
put formattedHeight of myGroup into item 4 of tRect
               
mobileControlSet "scroller_notizia", "rect", the rect of myGroup
mobileControlSet "scroller_notizia", "contentRect", tRect
mobileControlSet "scroller_notizia", "visible", "true"
mobileControlSet "scroller_notizia", "hscroll", 0
mobileControlSet "scroller_notizia", "vscroll", item 4 of tRect
mobileControlSet "scroller_notizia", "canBounce", "true"
mobileControlSet "scroller_notizia", "pagingEnabled", "false"
mobileControlSet "scroller_notizia", "canScrollToTop", "true"
This works correctly under iOS but not in Android in which the "vscroll" setting is ignored. My scroller always starts from top.
There's something wrong in my script or is a bug in the engine?!
Thank you very much for your replies!

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Contact:

Re: Can't set the vscroll of a native scroller

Post by splash21 » Fri Jan 24, 2014 12:24 pm

Here's what I get in the android simulator;

If I scroll the list to the top by swiping and letting the list scroll up to the top, then the next time I try to set the vscroll, I receive a scrollerDidScroll message with a value of 0. The same happens if I swipe and let the list scroll to the bottom until it stops. The next time I try to set the vscroll, I get a scrollerDidScroll message sent with the maximum vscroll value.

If I move the list by touching and keeping my finger on it, then letting go - everything seems to work fine (even moving to vscroll 0). It only gives the wrong result if the list is allowed to scroll freely after a swipe and it hit's either the start or end bound.

Looks like you've found a bug - have you filed it in the QCC?
LiveCode Development & Training : http://splash21.com

giovanni_c
Posts: 52
Joined: Sat Sep 08, 2012 10:50 am

Re: Can't set the vscroll of a native scroller

Post by giovanni_c » Sat Jan 25, 2014 10:43 am

Hi Splash, thank you for your reply.
I've not filed this on the QCC because I was not sure if this behavior was related to a mistake of mine.
But after your reply I'll go to add a new report to the QCC. Thank you!

giovanni_c
Posts: 52
Joined: Sat Sep 08, 2012 10:50 am

Re: Can't set the vscroll of a native scroller

Post by giovanni_c » Sat Jan 25, 2014 4:19 pm


billhemsley
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 22
Joined: Wed Sep 21, 2011 12:24 pm

Re: Can't set the vscroll of a native scroller

Post by billhemsley » Sun Sep 20, 2015 6:59 pm

This bug, which has not yet been fixed, applies to the hscroll as well (I've added this on QCC).

I'm trying to start horizontal scrolling in the centre of a set of items.

Does anyone know of a workaround?

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Can't set the vscroll of a native scroller

Post by MaxV » Wed Sep 23, 2015 11:27 am

On Android you must add to Vscroll the distance of the top of the scroller from the top of the screen.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Can't set the vscroll of a native scroller

Post by jacque » Wed Sep 23, 2015 6:00 pm

I usually set the scroll of the group to 0 before creating the native scroller to make sure everything aligns right. If you do that, does the bug still happen?

Also, the rect of the scroller should be the same size as the group. Is there a reason to make it start higher up?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply