-
5 May 2012 6:06 AM #1
Detect Swipe on Screen
Detect Swipe on Screen
Ok, I've been combing through the forums and I've come across a few different ways of adding listeners and I've tried them but none seem to do what I want.
I want to detect a swipe on the screen. So the listener would be on the main viewport or application itself.. I don't know the best place to put it. Say my app is just an empty container and I want to detect a swipe on it.
I've tried adding the listener in the controller init function and it didn't seem to work. It didn't throw an error but nothing happened.
I've seen posts that said custom events can't be handled with architect right now but then I've seen other posts that I thought may contradict that.
Basically I want to be able to swipe up or down on something like a container.
-
6 May 2012 6:52 PM #2
In your container initialize event, add listener on the container element
Code:component.element.on('swipe', function () { alert('swipe'); });Bharat Nagwani
Sencha Designer Development Team
-
7 May 2012 3:46 AM #3
Bah, that works perfect, thanks!
Another quick question about this if I may, it seems as though the swipe only gets detected if it's a left or right swipe. Is there no vertical swipe event?
Not a big deal now that you have pointed me in the right direction, I can use touchdrag and grab the x / y co-ordinates if there isn't a vertical swipe event.


Reply With Quote