Complete
over 5 years ago

The events were being sent to onPreviousPage() and onNextPage() in the BehaviorDelegate.

Touchscreen onSwipeEvent(evt) Inconsistent

Here is the Behavior Delegate I have implemented. 

During a Swipe, 

Right Swipe always ends up being onBack(), and up/down swipes do not seem to be registering the onSwipe action. Am I implementing this wrong? I have tried this on hand with a Vivoactive 3 and Venu.

class UpDownWrapper extends Ui.BehaviorDelegate {
	
    function initialize() {
		BehaviorDelegate.initialize();
    }

	function onSwipe(evt) {
        var event = evt.getDirection();
        Sys.println("event: " + event);
        if (event == Ui.SWIPE_LEFT) {
			// Do Left thing
		} else if (event == Ui.SWIPE_RIGHT) {
			// Do Right thing
		} else if (event == Ui.SWIPE_UP) {
			// Do up thing
		} else if (event == Ui.SWIPE_DOWN) {
			// do down thing
		} else {
			return true;
		}
	}

}

Parents Comment Children
  • It sounds like Jim Identified that the event was being eaten by onNextPage and onPreviousPage which seems to answer your question. If you still think there is a bug here, please let us know.

  • It "could" be if you return false from onNextPage()/onPreviousPage(), you'll aslo see it in onSwipe, but I've not trued it.  I did run a test where onSwipe() wasn't called with onNextPage()/onPreviousPage(), but was if you commented out next/previous.

    Go with onKey(), onSwipe() or

    onSelect(), onNextPage(), onPreviousPage()

    That's what I do in all my apps.