Developed extensions that include
Swipe behavior. This behavior attaches to any object and “handles the swipe event”.
Time (s)- duration of the swipe (default value 0.2 s);
Min Length (px)- the minimum length that the swipe must “pass” (default value 100 px).
IsDone(Condition) - swipe done or not;
StartPointY(Expression) - coordinates of the point where the swipe starts;
EndPointY(Expression) - coordinates of the swipe end point;
Length(Expression) - the length of the swipe;
DirectionY(Expression) - values of the swipe direction vector;
DirectionNormY(Expression) - values of the normalized vector of the swipe direction;
Angle(Expression) - the value of the angle of the direction vector to the zero angle [-180, 180];
Average4Direction(String Expression) - the direction value for 4 sides (UP, DOWN, LEFT, RIGHT) is displayed as a string. In this case, the “circle” is divided into 4 segments of 90 degrees;
Average8Direction(String Expression) - the direction value for 8 sides (UP, DOWN, LEFT, RIGHT, UP-LEFT, UP-RIGHT, DOWN-LEFT, DOWN-RIGHT) is displayed as a string. In this case, the “circle” is divided into 8 segments of 45 degrees.
Extension and test project: project.
Demo: web, android.