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
  • Sorry if that was confusing I edited my code above. The main issue is that I want to do separate things dependent on the swipe direction. And in this case, I'm only able to catch left swipes. Up/Down swipes never register, or are caught.

Comment
  • Sorry if that was confusing I edited my code above. The main issue is that I want to do separate things dependent on the swipe direction. And in this case, I'm only able to catch left swipes. Up/Down swipes never register, or are caught.

Children