Page 1 of 1

Stop a scroller in motion

Posted: Tue Jan 06, 2015 5:20 am
by grimaldiface
I am creating an app that is very similar to the "Contacts" app-- there is a bunch of alphabetic content that the user can scroll through. On the right is the alphabet listed--which allows the user to quickly jump to any part of the scroller (see screen shot). Currently, it works by detecting a movement over the alphabet--then it finds the proper vscroll and sets the vscroll of the scroller. The problem I'm having is that if the user flicks the scroller, then starts using the alphabet thingy, the two "compete" for setting the vscroll. It's a jerky mess. Is there a command that will stop a scroller that is already in motion?

Re: Stop a scroller in motion

Posted: Tue Jan 06, 2015 10:12 am
by Dixie
Ciuld you perhaps use the 'dragging' property of the scroller to determine if a scroll (drag action) is already taking place and if it is then don't allow another scroll ( drag action) to take place until the first one has finished... Since the 'dragging' property for the scroller is boolean, if should be fairly simple to determine...

Re: Stop a scroller in motion

Posted: Wed Jan 07, 2015 2:07 am
by grimaldiface
Dixie wrote:Ciuld you perhaps use the 'dragging' property of the scroller to determine if a scroll (drag action) is already taking place and if it is then don't allow another scroll ( drag action) to take place until the first one has finished... Since the 'dragging' property for the scroller is boolean, if should be fairly simple to determine...
well, there really aren't "two" scroll actions. I'm just trying to terminate a scroll in progress. Imagine a scroller with a large amount of content. You give it a quick flip and watch it fly. It will eventually slow down and come to a stop, but I want to manually stop it. Like press a button and the scroller stops moving (similar to if you were to just put your finger down on it while it was in motion).

Re: Stop a scroller in motion

Posted: Sat Jan 10, 2015 11:00 pm
by grimaldiface
Still searching for an answer to this. Anybody?

Re: Stop a scroller in motion

Posted: Sun Jan 11, 2015 4:18 am
by Simon
This;

Code: Select all

on scrollerDidScroll hOffset, vOffset
   if goodToGo then
      set the vScroll of group "scrollArea" to vOffset
   end if
end scrollerDidScroll
Putting false into goodToGo stops it dead.
Sorry only tested on Android.

Simon
Scroller Example.zip
(3.39 KiB) Downloaded 244 times

Re: Stop a scroller in motion

Posted: Sun Jan 11, 2015 9:15 pm
by jacque
I haven't tried it, but see if you can trap either the scrollerEndDecelerate or the scrollerEndDrag message. One of those might tell you when the user stops the scroller.

Re: Stop a scroller in motion

Posted: Mon Jan 12, 2015 1:40 am
by grimaldiface
Simon wrote:This;

Code: Select all

on scrollerDidScroll hOffset, vOffset
   if goodToGo then
      set the vScroll of group "scrollArea" to vOffset
   end if
end scrollerDidScroll
Putting false into goodToGo stops it dead.
Sorry only tested on Android.

Simon
Scroller Example.zip
This works pretty well, in that it stops the content from moving. The downside is that the native scroller still maintains it's momentum regardless. If I set gGoodToGo to false, it stops the content from scrolling. However, if gGoodToGo is set back to true while the nativeScroller is still decelerating, then the content will start moving again. However, this is getting closer to exactly what I want, so thanks!

Ideally there should be a mobileControlSet "stopmovingyoustupidscroller" to send to the native scroller.

Re: Stop a scroller in motion

Posted: Wed Jan 21, 2015 5:16 pm
by keram
Hi Simon,

Just came across your post with the sample stack and tested it on my Android tablet.
When scrolling down it does not go all to the bottom of the text (see the screen shot) - there are still many lines below the bottom edge.
Any idea why?

keram

Re: Stop a scroller in motion

Posted: Thu Jan 22, 2015 1:15 am
by Simon
Hi keram,
That field is locked, just unlock it and reset it's height.
Note... The field not the group :)

Simon