Re: How to give swiping precedence over scrolling on mobile?

2018-12-20 Thread Terry Judd via use-livecode
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

On 21/12/2018 9:18 am, "use-livecode on behalf of Terry Judd via use-livecode" 
 wrote:

Thanks Brahmanathaswami - was thinking about this again last night and in 
my case I think I might be able to get it to work for me if I just use 
touchmove (and only track the y delta) for the vertical scrolling and touchend 
for the swiping, which is for card to card navigation rather than horizontal 
scrolling.

Regards,

Terry...

On 20/12/2018 11:53 pm, "use-livecode on behalf of Sannyasin 
Brahmanathaswami via use-livecode"  wrote:

Terry, I'm interested in this also.

Get the SivaSiva app ( no space... from iOS and Google Play)

In the Listen Module, with Elanor's help, I tried to set up a "Spotify" 
UX with categories of audio scroll and up and down, and within on categories, 
left to right.

I also get, what is a probably the same as you get, a "conflict" 
between Elanor touch events -- from scrolling left with right and up and down. 

In this case we don’t use the mobileScroller at all in mobile, both up 
and down, left and right,  are implement with touch. But I think it is the same 
thing as you have... 

What I am seeing is: when the up and down in active, the left to right 
touch is disabled. It "kinda" works for the user but is very "clunky". I tried 
playing with touch startx and y numbers. It gets "worse" as you go down in size.

The script is small enough to put here. Would be nice of this were 
fixed but I don’t seeing how the engine would do it. It would seem that the 
pTouchX and pTouchY are managing the scroll independently. 

So you try a "swipe" gesture with your thumb that goes "diagonally"  
that is, changes is location on the  both "x" and "y" axes ... the engine is 
going to focus on say just the "y" cords -- you get an up to down scroll or 
vice-versa-- but "x" coord are not "seen" and  you don't get any left of right 
behavior -- in you case, a card swipe, in my case a group swipe left to right 
fails. 

Until you stop and "focus" carefully on "x" axes gesture (left to 
right, or vice versa). then you get you Card/Group swipe horizontally...

on touchStart pTouchID
   put empty into sStartX
   put empty into sStartY
   
   put the vScroll of grp "all-collections" into sStartYScroll
   
   put the long owner of the target into tHGroup  
   put the hScroll of tHGroup into sStartHScroll
end touchStart

on touchMove pTouchID, pTouchX, pTouchY
  if sStartY is empty then 
 put pTouchY into sStartY
  end if
  
  if sStartX is empty then
 put pTouchX into sStartX
  end if
  
  // Check for vertical scroll
  
  if pTouchY > (sStartY + 20) or pTouchY < (sStartY - 20) then
 set the vScroll of group "all-collections" to sStartYScroll + 
(sStartY-pTouchY)
  else
 
 if pTouchX > (sStartX + 10) or pTouchX < (sStartX - 10) then
// Check for horizontal scroll

put the long owner of the target into tHGroup  
set the hScroll of tHGroup to sStartHScroll + 
(sStartX-pTouchX)

 end if
  end if
  
   end touchMove

 

Re: Using the Compass / GPS features of LC

2018-12-20 Thread Rick Harrison via use-livecode
Hi Mike,

Did you work your way through the following lesson?

http://lessons.livecode.com/m/4069/l/30379-how-do-i-get-the-location-and-use-the-digital-compass
 


Good luck!

Rick

> On Dec 20, 2018, at 5:29 PM, Mike for GDC via use-livecode 
>  wrote:
> 
> Is anyone familiar with using LC to "guide" the user to a specific location.
> For instance, if I have a marked and saved lat/long location, I want to have
> the app show directions of how to return to the location after walking away
> from it.  Not using google maps but instead using something like a "compass"
> app to direct the user to the location while always pointing to the
> destination.  Thanks.
> 
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Using the Compass / GPS features of LC

2018-12-20 Thread Mike for GDC via use-livecode
Is anyone familiar with using LC to "guide" the user to a specific location.
For instance, if I have a marked and saved lat/long location, I want to have
the app show directions of how to return to the location after walking away
from it.  Not using google maps but instead using something like a "compass"
app to direct the user to the location while always pointing to the
destination.  Thanks.

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


Re: How to give swiping precedence over scrolling on mobile?

2018-12-20 Thread Terry Judd via use-livecode
Thanks Brahmanathaswami - was thinking about this again last night and in my 
case I think I might be able to get it to work for me if I just use touchmove 
(and only track the y delta) for the vertical scrolling and touchend for the 
swiping, which is for card to card navigation rather than horizontal scrolling.

Regards,

Terry...

On 20/12/2018 11:53 pm, "use-livecode on behalf of Sannyasin Brahmanathaswami 
via use-livecode"  wrote:

Terry, I'm interested in this also.

Get the SivaSiva app ( no space... from iOS and Google Play)

In the Listen Module, with Elanor's help, I tried to set up a "Spotify" UX 
with categories of audio scroll and up and down, and within on categories, left 
to right.

I also get, what is a probably the same as you get, a "conflict" between 
Elanor touch events -- from scrolling left with right and up and down. 

In this case we don’t use the mobileScroller at all in mobile, both up and 
down, left and right,  are implement with touch. But I think it is the same 
thing as you have... 

What I am seeing is: when the up and down in active, the left to right 
touch is disabled. It "kinda" works for the user but is very "clunky". I tried 
playing with touch startx and y numbers. It gets "worse" as you go down in size.

The script is small enough to put here. Would be nice of this were fixed 
but I don’t seeing how the engine would do it. It would seem that the pTouchX 
and pTouchY are managing the scroll independently. 

So you try a "swipe" gesture with your thumb that goes "diagonally"  that 
is, changes is location on the  both "x" and "y" axes ... the engine is going 
to focus on say just the "y" cords -- you get an up to down scroll or 
vice-versa-- but "x" coord are not "seen" and  you don't get any left of right 
behavior -- in you case, a card swipe, in my case a group swipe left to right 
fails. 

Until you stop and "focus" carefully on "x" axes gesture (left to right, or 
vice versa). then you get you Card/Group swipe horizontally...

on touchStart pTouchID
   put empty into sStartX
   put empty into sStartY
   
   put the vScroll of grp "all-collections" into sStartYScroll
   
   put the long owner of the target into tHGroup  
   put the hScroll of tHGroup into sStartHScroll
end touchStart

on touchMove pTouchID, pTouchX, pTouchY
  if sStartY is empty then 
 put pTouchY into sStartY
  end if
  
  if sStartX is empty then
 put pTouchX into sStartX
  end if
  
  // Check for vertical scroll
  
  if pTouchY > (sStartY + 20) or pTouchY < (sStartY - 20) then
 set the vScroll of group "all-collections" to sStartYScroll + 
(sStartY-pTouchY)
  else
 
 if pTouchX > (sStartX + 10) or pTouchX < (sStartX - 10) then
// Check for horizontal scroll

put the long owner of the target into tHGroup  
set the hScroll of tHGroup to sStartHScroll + (sStartX-pTouchX)

 end if
  end if
  
   end touchMove

on touchEnd pTouchID
  -- code
end touchEnd

on touchRelease pTouchID
   -- code
end touchRelease


I wish there was are easy fix...but I suspect "not"

Brahmanathaswami
 

On 12/19/18, 2:58 PM, "use-livecode on behalf of Terry Judd via 
use-livecode"  wrote:

This is a problem that I have run into before and have never been able 
to solve satisfactorily. I’m using touchStart and touchEnd handlers to detect 
the direction and speed of a finger movement and if it is within certain bounds 
(large enough x, small enough y, and fast enough) then the user can swipe back 
and forwards through a series of cards. Good so far except when the area they 
are swiping on also includes a mobile scroller (to scroll a list selection 
widget/thingy). In that situation the swiping becomes a bit of a hit and miss 
thing – works sometimes but not others. On iOS there are a few scroller 
parameters look potentially useful (canCancelTouches, delayTouches, and 
lockDirection) but it’s not really clear (to me at least) which of these might 
help and if so whether I should be setting them to true or false.

Any ideas?

Terry...

___
use-livecode mailing list
use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Versions 7.1.1 and 8.1.3 no long working properly

2018-12-20 Thread Rick Harrison via use-livecode
Hi Jim,

Those are older versions.

Try version 7.1.4 and 8.1.10 to see 
if you still have the same problem.

Hope it works!

Rick

> On Dec 20, 2018, at 3:22 PM, James Hurley via use-livecode 
>  wrote:
> 
> I am having trouble running a stack on 7.1.1, Community
> 
> I have had no problem with it in the past. 
> 
> But now it will not display the Tools Palette. 
> 
> Closing any window I get the message “Do you want to save….” I have to click 
> “Cancel” to proceed
> 
> The stack runs, but erratically. 
> 
> So I thought I would try 8.1.3 and have similar problems. Still the message 
> “Do yo want to save…” when I close any window.
> 
> Is it me?
> 
> Jim Hurley

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

Versions 7.1.1 and 8.1.3 no long working properly

2018-12-20 Thread James Hurley via use-livecode
I am having trouble running a stack on 7.1.1, Community

I have had no problem with it in the past. 

But now it will not display the Tools Palette. 

Closing any window I get the message “Do you want to save….” I have to click 
“Cancel” to proceed

The stack runs, but erratically. 

So I thought I would try 8.1.3 and have similar problems. Still the message “Do 
yo want to save…” when I close any window.

Is it me?

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

Re: [ANN] bnGuides alignment tool on ivecodeshare

2018-12-20 Thread Niggemann, Bernd via use-livecode
Thanks Tom, Matthias,

glad you like "bnGuides"


>Bob Sneidar via 
>use-livecode<https://www.mail-archive.com/search?l=use-livecode@lists.runrev.com=from:%22Bob+Sneidar+via+use%5C-livecode%22>
> Thu, 20 Dec 2018 07:53:51 
>-0800<https://www.mail-archive.com/search?l=use-livecode@lists.runrev.com=date:20181220>

>Cool. Now I haven't tried it yet, but what would REALLY be cool is if it
>aligned a group based upon the contents of another group. That may be asking
>too much though.

>The way Illustrator goes about it is it tracks all points, then indicates
>whenever points align. Not sure how you did it though.



Thanks Bob,


Actually coming to think of it it would be easiest for you to just try 
"bnGuides".


When dealing with groups try with "Select Grouped" turned on and off. When 
turned on select the members of the group and click one control as the leading 
control.

When "Select Grouped" is turned off just select the group and drag it around 
and see how it deals with the members of the other group.


Note, the datagrid is just one group, the elements of the datagrid are not 
scanned.


for your convenience

http://livecodeshare.runrev.com/stack/918/BnGuides


or from "user samples" from within LC


Kind regards
Bernd
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: [ANN] bnGuides alignment tool on ivecodeshare

2018-12-20 Thread Bob Sneidar via use-livecode
Cool. Now I haven't tried it yet, but what would REALLY be cool is if it 
aligned a group based upon the contents of another group. That may be asking 
too much though. 

The way Illustrator goes about it is it tracks all points, then indicates 
whenever points align. Not sure how you did it though. 

Bob S


> On Dec 19, 2018, at 15:57 , Tom Glod via use-livecode 
>  wrote:
> 
> This is a cool little plugin for the community
> 
> PS >  I can't wait for the new stack share center.


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


Re: FYI: How to reliably identify an Android Tablet microSD Card

2018-12-20 Thread Bob Sneidar via use-livecode
Interesting approach. Of course, the downside is that if anything changes, the 
method becomes ineffective for that new device or for all andriods if the 
change is fundamental enough. 

Bob S


> On Dec 19, 2018, at 03:37 , Peter Reid via use-livecode 
>  wrote:
> 
> FYI
> 
> I've managed to put together some code that reliably locates the microSD card 
> in 4 very different Android-based tablets. The approach involves 3 different 
> methods:
> 
> 1. Search for a known folder on the SD card starting in the standard "/mnt" 
> folder using a breadth-first search strategy.
> 
> 2. Search for a known folder on the SD card starting in the less standard 
> "/storage" folder using a breadth-first search strategy.
> 
> 3. Search for a known folder using full paths that are used by specific 
> manufacturers. These look as though they should be located by method 1. (they 
> are all paths from "/mnt") but sometimes fail 1. however they work if the 
> full path is specified!
> 
> Here's my code for "findSDcard"...
> 
> 
> 
> on findSDcard
>   constant \
>  cSDcardRoot1 = "/mnt/ext_sdcard/Android/data/com.myorg.myapp/files", \
>  cSDcardRoot2 = "/mnt/sdcard2/Android/data/com.myorg.myapp/files", \
>  cSDcardRoot3 = "/mnt/m_external_sd/Android/data/com.myorg.myapp/files", \
>  cSDcardRoot4 = "/mnt/sdcard/Android/data/com.myorg.myapp/files", \
>  cSDcardRoot5 = "/mnt/extSdCard/Android/data/com.myorg.myapp/files", \
>  cSDcardRoot6 = "/mnt/external_sd/Android/data/com.myorg.myapp/files", \
>  cSDcardRoot7 = "/mnt/SDCard/Android/data/com.myorg.myapp/files"
> 
>global gDataPath -- /myapp-data
>global gSDcard -- path to app's data folder
> 
>   set wholeMatches to true
>   put empty into gSDcard
>   put (char 2 to -1 of gDataPath) into tTargetFolderName
>   if the platform is "android" then
>  put "/mnt" into tDeviceRoot
>  if there is a folder tDeviceRoot then
> -- search in standard /mnt folders:
> put empty into tFoundPath
> folderExists tTargetFolderName, tDeviceRoot, tFoundPath
> if tFoundPath is not empty then
>put tFoundPath into gSDcard
> end if
>  end if
>  if gSDcard is empty then
> -- try non-standard /storage folders:
> if there is a folder "/storage" then
>-- search in non-standard /storage folders:
>put "/storage" into tDeviceRoot
>put empty into tFoundPath
>folderExists tTargetFolderName, tDeviceRoot, tFoundPath
>if tFoundPath is not empty then
>   put tFoundPath into gSDcard 
>end if
> end if
>  end if
>  if gSDcard is empty then
> -- try bespoke SD locations:
> if there is a folder cSDcardRoot1 then
>put cSDcardRoot1 into gSDcard-- Huawei
> else if there is a folder cSDcardRoot2 then
>put cSDcardRoot2 into gSDcard-- Amazon
> else if there is a folder cSDcardRoot3 then
>put cSDcardRoot3 into gSDcard-- Lenovo
> else if there is a folder cSDcardRoot4 then
>put cSDcardRoot4 into gSDcard-- Fusion
> else if there is a folder cSDcardRoot5 then
>put cSDcardRoot5 into gSDcard-- ??
> else if there is a folder cSDcardRoot6 then
>put cSDcardRoot6 into gSDcard-- ??
> else if there is a folder cSDcardRoot7 then
>put cSDcardRoot7 into gSDcard-- Hudl?
> end if
>  end if
>   end if
> end findSDcard
> 
> on folderExists pFolderName, pRootPath, @pFoundPath
>   constant cNoDotsRegex = "^\..*"
> 
>   -- breadth-first search for a given folder
>   put empty into pPath
>   if there is a folder pRootPath then
>  put empty into tSubFolders
>  put folders(pRootPath) into tFolderList
>  filter lines of tFolderList without regex cNoDotsRegex
>  repeat for each line tFolder in tFolderList
> if tFolder = pFolderName then
>-- found it:
>put pRootPath into pFoundPath
>exit folderExists
> else
>-- add sub-folder to list for checking:
>put pRootPath & "/" & tFolder & return after tSubFolders
> end if
>  end repeat
>  if tSubFolders is empty then
> exit folderExists
>  end if
>  repeat for each line tSubFolder in tSubFolders
> folderExists pFolderName, tSubFolder, pFoundPath
> if pFoundPath is not empty then
>exit folderExists
> end if
>  end repeat
>   end if
> end folderExists
> 
> 
> 
> Note that the above was necessary because specialFolderPath("external 
> documents") doesn't work reliably across the 4 Android-based tablets I'm 
> trying to support.
> 
> If anyone has a more elegant or succinct method, please let me know.  In the 
> meantime you're welcome to use the above code.
> 
> Peter
> --
> Peter Reid
> Loughborough, UK
> 
>> On 28 Nov 

Re: How to give swiping precedence over scrolling on mobile?

2018-12-20 Thread Sannyasin Brahmanathaswami via use-livecode
Terry, I'm interested in this also.

Get the SivaSiva app ( no space... from iOS and Google Play)

In the Listen Module, with Elanor's help, I tried to set up a "Spotify" UX with 
categories of audio scroll and up and down, and within on categories, left to 
right.

I also get, what is a probably the same as you get, a "conflict" between Elanor 
touch events -- from scrolling left with right and up and down. 

In this case we don’t use the mobileScroller at all in mobile, both up and 
down, left and right,  are implement with touch. But I think it is the same 
thing as you have... 

What I am seeing is: when the up and down in active, the left to right touch is 
disabled. It "kinda" works for the user but is very "clunky". I tried playing 
with touch startx and y numbers. It gets "worse" as you go down in size.

The script is small enough to put here. Would be nice of this were fixed but I 
don’t seeing how the engine would do it. It would seem that the pTouchX and 
pTouchY are managing the scroll independently. 

So you try a "swipe" gesture with your thumb that goes "diagonally"  that is, 
changes is location on the  both "x" and "y" axes ... the engine is going to 
focus on say just the "y" cords -- you get an up to down scroll or vice-versa-- 
but "x" coord are not "seen" and  you don't get any left of right behavior -- 
in you case, a card swipe, in my case a group swipe left to right fails. 

Until you stop and "focus" carefully on "x" axes gesture (left to right, or 
vice versa). then you get you Card/Group swipe horizontally...

on touchStart pTouchID
   put empty into sStartX
   put empty into sStartY
   
   put the vScroll of grp "all-collections" into sStartYScroll
   
   put the long owner of the target into tHGroup  
   put the hScroll of tHGroup into sStartHScroll
end touchStart

on touchMove pTouchID, pTouchX, pTouchY
  if sStartY is empty then 
 put pTouchY into sStartY
  end if
  
  if sStartX is empty then
 put pTouchX into sStartX
  end if
  
  // Check for vertical scroll
  
  if pTouchY > (sStartY + 20) or pTouchY < (sStartY - 20) then
 set the vScroll of group "all-collections" to sStartYScroll + 
(sStartY-pTouchY)
  else
 
 if pTouchX > (sStartX + 10) or pTouchX < (sStartX - 10) then
// Check for horizontal scroll

put the long owner of the target into tHGroup  
set the hScroll of tHGroup to sStartHScroll + (sStartX-pTouchX)

 end if
  end if
  
   end touchMove

on touchEnd pTouchID
  -- code
end touchEnd

on touchRelease pTouchID
   -- code
end touchRelease


I wish there was are easy fix...but I suspect "not"

Brahmanathaswami
 

On 12/19/18, 2:58 PM, "use-livecode on behalf of Terry Judd via use-livecode" 
 wrote:

This is a problem that I have run into before and have never been able to 
solve satisfactorily. I’m using touchStart and touchEnd handlers to detect the 
direction and speed of a finger movement and if it is within certain bounds 
(large enough x, small enough y, and fast enough) then the user can swipe back 
and forwards through a series of cards. Good so far except when the area they 
are swiping on also includes a mobile scroller (to scroll a list selection 
widget/thingy). In that situation the swiping becomes a bit of a hit and miss 
thing – works sometimes but not others. On iOS there are a few scroller 
parameters look potentially useful (canCancelTouches, delayTouches, and 
lockDirection) but it’s not really clear (to me at least) which of these might 
help and if so whether I should be setting them to true or false.

Any ideas?

Terry...

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