Swipe over native scroller

Jim MacConnell jmac at consensustech.com
Thu Jan 31 12:41:35 EST 2019


The only way I've been able to get swipe functionality with a native
scroller is to keep the native scroller narrower than the screen by enough
that someone swiping is able to easily start the swipe on the background.
I've found when people try to swipe and it doesn't work, they'll try again
starting closer to the edge of the screen.... which I can trap. 

Definitely not ideal but it's all I've been able to come up with since I
don't really want to have to code bounce, etc.

-----Original Message-----
From: use-livecode <use-livecode-bounces at lists.runrev.com> On Behalf Of J.
Landman Gay via use-livecode
Sent: Thursday, January 31, 2019 9:04 AM
To: How to use LiveCode <use-livecode at lists.runrev.com>
Cc: J. Landman Gay <jacque at hyperactivesw.com>
Subject: Re: Swipe over native scroller

That's similar to the handlers I'm using but they all fail because no
mouseUp or touchEnd messages are ever sent if you are over a native
scroller. The issue isn't with the calculations, it's because the app is
never informed thar the swipe has completed.

I'll try fiddling with touchMove again, but the message isn't sent
consistently on slow hardware and sometimes fails.

--
Jacqueline Landman Gay | jacque at hyperactivesw.com HyperActive Software |
http://www.hyperactivesw.com On January 31, 2019 7:20:38 AM Sannyasin
Brahmanathaswami via use-livecode <use-livecode at lists.runrev.com> wrote:

> Did you try Terry script? Elanor did something similar this in the 
> Listen module, it not very refined. Terry put time in it with subtle 
> time parameters. I have yet to try it. It here on the list
>
> Terry, do we have a place for a repository for code snippits? Maybe 
> you can put in on the forum.
>
> I don't think  you are going to get response to the bug problem. I 
> have been trying to get smooth scrolling for 3 years!  I think it is 
> more a question of something deep in the engine that "can't be done", 
> at least not cross platform. Otherwise they would have responded by now.
>
> Here's Terry code from Dec. 20...Terry.... have improved it?
>
> ===========
> Terry:
> So, it seems like this approach works ok. Turned out there was an 
> addition complication in that the items in my scrolling list are also 
> selectable and I needed to prevent them being toggled on or off during 
> a left/right swipe action. Anyway, this is what I ended up doing...
>
> In the card script...
>
> local pLoc, pTime, pV, pScroll
>
> on touchStart pTouchID
>   put the mouseLoc into pLoc
>   put the millisecs into pTime
>   put the scroll of grp "checkList" into pScroll
>   put the mouseV into pV
> end touchStart
>
> on touchMove pTouchID, pTouchX, pTouchY
>   put pV-pTouchY into tY
>   put pScroll+tY into tScroll
>   set the scroll of grp "checkList" to tScroll end touchMove
>
> on touchEnd pTouchID
>   put the mouseLoc into pLoc1
>   put (item 1 of pLoc)-(item 1 of pLoc1) into tX
>   put (item 2 of pLoc)-(item 2 of pLoc1) into tY
>   put the millisecs - pTime into tElapsed
>   if abs(tX)>100 then # horizontal swipe
>      if abs(tY)< 50 then # small vertical movement
>         if tElapsed < 500 then # not too slow
>            if tX > 0 then
>               send "mouseUp" to grp "nextBtn"
>            else
>               send "mouseUp" to grp "backBtn"
>            end if
>         end if
>      end if
>   end if
> end touchEnd
>
> And in the "checklist" script...
>
> local pX
>
> on mouseDown
>   put the mouseH into pX
> end mouseDown
>
> on mouseUp
>   if abs((the mouseH)-pX) > 50 then exit mouseUp
>   # list selection code
> end mouseUp
>
> BR
>
>
> ?On 1/30/19, 7:17 PM, "use-livecode on behalf of J. Landman Gay via 
> use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of 
> use-livecode at lists.runrev.com> wrote:
>
>    Thanks, I was afraid of that. I'll see if I can bump the bug report for
>    attention.
>
>    On 1/30/19 5:49 PM, Terry Judd via use-livecode wrote:
>> Not much of a workaround I'm afraid, but for a recent app (iOS and 
>> Android) I got rid of the native scroller and used the touch messages 
>> to both scroll the object and detect the swipes.
>> Terry...
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list