swipe gestures

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
keram
Posts: 340
Joined: Fri Nov 08, 2013 4:22 am

swipe gestures

Post by keram » Sun Mar 23, 2014 5:09 am

Hello,

Is it possible to code moving from one card to another using the Android swipe gestures?
If yes, is it possible to also code changing the text display in a text field on one of these cards to the next/previous text line - on that particular card the gesture would not move to the next/previous card, but to the next/previous text line.

Are there any examples anywhere how to do it?

Thanks.

keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: swipe gestures

Post by Simon » Sun Mar 23, 2014 5:28 am

Here for swipe;
http://lessons.runrev.com/s/lessons/m/4 ... r-the-ipad
touchStart
touchMove
touchEnd


Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: swipe gestures

Post by bangkok » Sun Mar 23, 2014 10:10 am

A script for card (found on the forum) that works on desktop as well.

Code: Select all

global sStartH
on mouseDown
   put the mouseH into sStartH
end mouseDown

on mouseUp
   if abs(the mouseH - sStartH) > 50 then
       if the mouseH < sStartH then
           goNext
       else
           goPrev
       end if
   end if
end mouseUp

command goNext
	lock screen for visual effect
	go next cd
	unlock screen with visual effect push left very fast
end goNext

command goPrev
	lock screen for visual effect
	go prev cd
	unlock screen with visual effect push right very fast
end goPrev

keram
Posts: 340
Joined: Fri Nov 08, 2013 4:22 am

Re: swipe gestures

Post by keram » Mon Mar 24, 2014 10:17 am

Thanks bangkok,

This version seems to be simpler than the one described in the lesson from the link above.
It works well on the desktop. I'll test it on Android in few days.

keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit

Post Reply