Page 1 of 1

Android does not recognize delayTouches

Posted: Mon Jun 25, 2018 10:04 pm
by quailcreek
I'm having a bit of a problem with a scroller for a DG on Android. I think the trouble stems from Android not recognizing delayTouches in the scroller creation script.

The card script contains the scroller create code and that gets created OK.

In the "Row Template" script of the DG I have a mouseUp handler that navigates to a cd based upon the text in fld "Name" of the Row Template.

Code: Select all

on mouseUp
  local theCard
  
  put fld "Name" of me into theCard
  visual effect "scroll left" very fast
  go cd theCard
end mouseUp
Everything works fine in iOS. However, on Android, as soon as the scroll is stopped the mouseUp event is triggered and I get sent to another card. Has anybody come up with a workaround for this?

I'm using LC 8.1.0
Android Scroller Test.livecode.zip
(5.51 KiB) Downloaded 277 times

Re: Android does not recognize delayTouches

Posted: Tue Jun 26, 2018 5:53 pm
by jacque
I think delayedTouches is iOS only. But your issue sounds like the same problem I had with the Android field widget: https://quality.livecode.com/show_bug.cgi?id=21355

You might want to add a comment there to say the problem isn't only with the widget.

Re: Android does not recognize delayTouches

Posted: Tue Jun 26, 2018 9:04 pm
by quailcreek
Thanks, Jacqueline.
Ya, I realize delayTouches is supposed to be iOS only but I believe that's what's causing this problem. I added my information to your bug report.

Re: Android does not recognize delayTouches

Posted: Mon Jul 09, 2018 10:50 pm
by quailcreek
Has anybody come up with a workaround for this? For me, at least, this essentially makes datagrids unusable on Android. All of my apps are x platform, ie the same stack for iOS and Android. All of them have multiple DGs and one has over 50.

Re: Android does not recognize delayTouches

Posted: Mon Jul 09, 2018 11:08 pm
by jacque
In a regular field I don't get mouseUps at all inside a native scroller. That's been an issue for a long time. I haven't tried it with a datagrid, but since you do get the mouseUp message, you could try tracking the distance between mouseDown and mouseUp and see how far apart they are. If they're more than 10 pixels or so, assume it's a scroll and don't do anything.

Re: Android does not recognize delayTouches

Posted: Tue Jul 10, 2018 2:01 am
by quailcreek
Excellent idea, J!! I'll let you know how it works. Thanks!

Re: Android does not recognize delayTouches

Posted: Tue Jul 10, 2018 5:21 am
by quailcreek
That solved the problem. Thanks again J.