Sends a flick gesture to the current view.

@param xSpeed The horizontal speed in pixels/second
@param ySpeed The vertical speed in pixels/second
@return self
338340
public TouchActions flick(int xSpeed, int ySpeed) {
    if (touchScreen != null) {
      action.addAction(new FlickAction(touchScreen, xSpeed, ySpeed));
    }
    return this;
  }
454245
public TouchActions move(int x, int y) {
    if (touchScreen != null) {
      action.addAction(new MoveAction(touchScreen, x, y));
    }
    return this;
  }
312946
public void fling(int velocityY) {
		if (getChildCount() > 0) {
			int height = getHeight() - getPaddingBottom() - getPaddingTop();
			int bottom = getChildAt(0).getHeight();

			mScroller.fling(getScrollX(), getScrollY(), 0, velocityY, 0, 0, 0,
					Math.max(0, bottom - height), 0, height/2);

			ViewCompat.postInvalidateOnAnimation(this);
		}
	}
1221844
public TouchActions scroll(WebElement onElement, int xOffset, int yOffset) {
    if (touchScreen != null) {
      action.addAction(new ScrollAction(touchScreen, (Locatable) onElement, xOffset, yOffset));
    }
    return this;
  }
1274886
public void setOffsetByMotionEvent(MotionEvent event) {
        int x = (int) event.getRawX();
        int y = (int) event.getRawY();

        if (x + contentParams.width + FINGER_SIZE < screenWidth) {
            setContentOffset(x, y, Translation.HORIZONTAL, FINGER_SIZE);
        } else if (x - FINGER_SIZE - contentParams.width > 0) {
            setContentOffset(x, y, Translation.HORIZONTAL, -1 * FINGER_SIZE);
        } else if (y + contentParams.height + FINGER_SIZE < screenHeight) {
            setContentOffset(x, y, Translation.VERTICAL, FINGER_SIZE);
        } else if (y - FINGER_SIZE - contentParams.height > 0) {
            setContentOffset(x, y, Translation.VERTICAL, -1 * FINGER_SIZE);
        } else {
            // it won't fit anywhere
            if (x < screenWidth / 2) {
                setContentOffset(x, y, Translation.HORIZONTAL, FINGER_SIZE);
            } else {
                setContentOffset(x, y, Translation.HORIZONTAL, -1 * FINGER_SIZE);
            }
        }
    }
652979
function(animData) {
		// calculate swipe speed for Y axis (paanning)
		animData.calculateSwipeSpeed('y');

		_currPanBounds = self.currItem.bounds;
		
		animData.backAnimDestination = {};
		animData.backAnimStarted = {};

		// Avoid acceleration animation if speed is too low
		if(Math.abs(animData.lastFlickSpeed.x) <= 0.05 && Math.abs(animData.lastFlickSpeed.y) <= 0.05 ) {
			animData.speedDecelerationRatioAbs.x = animData.speedDecelerationRatioAbs.y = 0;

			// Run pan drag release animation. E.g. if you drag image and release finger without momentum.
			animData.calculateOverBoundsAnimOffset('x');
			animData.calculateOverBoundsAnimOffset('y');
			return true;
		}

		// Animation loop that controls the acceleration after pan gesture ends
		_registerStartAnimation('zoomPan');
		animData.lastNow = _getCurrentTime();
		animData.panAnimLoop();
	}
1288633
@SuppressWarnings("WeakerAccess")
  public SnackbarBuilder swipeDismissCallback(final SnackbarSwipeDismissCallback callback) {
    callbacks.add(new SnackbarCallback() {
      public void onSnackbarSwiped(Snackbar snackbar) {
        callback.onSnackbarSwiped(snackbar);
      }
    });
    return this;
  }
578520
def move_by_offset(self, xoffset, yoffset):
        
        if self._driver.w3c:
            self.w3c_actions.pointer_action.move_by(xoffset, yoffset)
            self.w3c_actions.key_action.pause()
        else:
            self._actions.append(lambda: self._driver.execute(
                Command.MOVE_TO, {
                    'xoffset': int(xoffset),
                    'yoffset': int(yoffset)}))
        return self
664796
public void handleCameraPreviewTouchEvent(MotionEvent ev) {
        if (mFullScreen != null) mFullScreen.handleTouchEvent(ev);
        if (mDisplayRenderer != null) mDisplayRenderer.handleTouchEvent(ev);
    }
175114
function fly(cam, rotPad, movePad){
    var xRot = Qt.fromAxisAngle(V3_(1, 0, 0), rotPad.x);
    var yRot = Qt.fromAxisAngle(V3_(0, 1, 0), rotPad.y);
    var zRot = Qt.fromAxisAngle(V3_(0, 0, 1), rotPad.z);
    var camX = Qt.rotate(cam.rot, V3_(1, 0, 0));
    var camY = Qt.rotate(cam.rot, V3_(0, 1, 0));
    var camZ = Qt.rotate(cam.rot, V3_(0, 0, 1));
    return Camera(
      V3.add(V3.add(V3.add(
        cam.pos,
        V3.scale(movePad.x, camX)),
        V3.scale(movePad.y, camY)),
        V3.scale(movePad.z, camZ)),
      Qt.multiply(Qt.multiply(Qt.multiply(
        cam.rot,
        xRot), yRot), zRot));
  }
992300
public static View blink(View view, int duration, int offset) {

        android.view.animation.Animation anim = new AlphaAnimation(0.0f, 1.0f);
        anim.setDuration(duration);
        anim.setStartOffset(offset);
        anim.setRepeatMode(android.view.animation.Animation.REVERSE);
        anim.setRepeatCount(android.view.animation.Animation.INFINITE);
        view.startAnimation(anim);
        return view;

    }
957117
function gestureStart(element, clientX, clientY) {
  element[startXKey] = clientX;
  element[startYKey] = clientY;
  element[previousXKey] = clientX;
  element[previousYKey] = clientY;
  element[previousTimeKey] = Date.now();
  element[previousVelocityKey] = 0;
  element.setState({ swipeFraction: 0 });
}
447278
@Override
  public boolean onGenericMotionEvent(MotionEvent event) {
    if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) {
      switch (event.getAction()) {
        case MotionEvent.ACTION_SCROLL: {
          if (!mIsBeingDragged) {
            final float vscroll = event.getAxisValue(MotionEvent.AXIS_VSCROLL);
            final float hscroll = event.getAxisValue(MotionEvent.AXIS_HSCROLL);
            if (vscroll != 0) {
              final int verticalScrollRange = getVerticalScrollRange();
              final int horizontalScrollRange = getHorizontalScrollRange();
              int oldScrollY = getScrollY();
              int oldScrollX = getScrollX();
              int newScrollY = (int) (oldScrollY - vscroll);
              int newScrollX = (int) (oldScrollX - hscroll);
              if (newScrollY < 0) {
                newScrollY = 0;
              } else if (newScrollY > verticalScrollRange) {
                newScrollY = verticalScrollRange;
              }
              if (newScrollX < 0) {
                newScrollX = 0;
              } else if (newScrollX > horizontalScrollRange) {
                newScrollX = horizontalScrollRange;
              }
              if (newScrollY != oldScrollY || newScrollX != oldScrollX) {
                super.scrollTo(newScrollX, newScrollY);
                return true;
              }
            }
          }
        }
      }
    }
    return super.onGenericMotionEvent(event);
  }
267606
function(xy) {
        if(this.kinetic) {
            this.kinetic.update(xy);
        }
        this.panned = true;
        this.map.pan(
            this.handler.last.x - xy.x,
            this.handler.last.y - xy.y,
            {dragging: true, animate: false}
        );
    }
1219746
function() {
		// temp local vars
		var lastFlickDuration,
			tempReleasePos;

		// s = this
		var s = {
			lastFlickOffset: {},
			lastFlickDist: {},
			lastFlickSpeed: {},
			slowDownRatio:  {},
			slowDownRatioReverse:  {},
			speedDecelerationRatio:  {},
			speedDecelerationRatioAbs:  {},
			distanceOffset:  {},
			backAnimDestination: {},
			backAnimStarted: {},
			calculateSwipeSpeed: function(axis) {
				

				if( _posPoints.length > 1) {
					lastFlickDuration = _getCurrentTime() - _gestureCheckSpeedTime + 50;
					tempReleasePos = _posPoints[_posPoints.length-2][axis];
				} else {
					lastFlickDuration = _getCurrentTime() - _gestureStartTime; // total gesture duration
					tempReleasePos = _startPoint[axis];
				}
				s.lastFlickOffset[axis] = _currPoint[axis] - tempReleasePos;
				s.lastFlickDist[axis] = Math.abs(s.lastFlickOffset[axis]);
				if(s.lastFlickDist[axis] > 20) {
					s.lastFlickSpeed[axis] = s.lastFlickOffset[axis] / lastFlickDuration;
				} else {
					s.lastFlickSpeed[axis] = 0;
				}
				if( Math.abs(s.lastFlickSpeed[axis]) < 0.1 ) {
					s.lastFlickSpeed[axis] = 0;
				}
				
				s.slowDownRatio[axis] = 0.95;
				s.slowDownRatioReverse[axis] = 1 - s.slowDownRatio[axis];
				s.speedDecelerationRatio[axis] = 1;
			},

			calculateOverBoundsAnimOffset: function(axis, speed) {
				if(!s.backAnimStarted[axis]) {

					if(_panOffset[axis] > _currPanBounds.min[axis]) {
						s.backAnimDestination[axis] = _currPanBounds.min[axis];
						
					} else if(_panOffset[axis] < _currPanBounds.max[axis]) {
						s.backAnimDestination[axis] = _currPanBounds.max[axis];
					}

					if(s.backAnimDestination[axis] !== undefined) {
						s.slowDownRatio[axis] = 0.7;
						s.slowDownRatioReverse[axis] = 1 - s.slowDownRatio[axis];
						if(s.speedDecelerationRatioAbs[axis] < 0.05) {

							s.lastFlickSpeed[axis] = 0;
							s.backAnimStarted[axis] = true;

							_animateProp('bounceZoomPan'+axis,_panOffset[axis], 
								s.backAnimDestination[axis], 
								speed || 300, 
								framework.easing.sine.out, 
								function(pos) {
									_panOffset[axis] = pos;
									_applyCurrentZoomPan();
								}
							);

						}
					}
				}
			},

			// Reduces the speed by slowDownRatio (per 10ms)
			calculateAnimOffset: function(axis) {
				if(!s.backAnimStarted[axis]) {
					s.speedDecelerationRatio[axis] = s.speedDecelerationRatio[axis] * (s.slowDownRatio[axis] + 
												s.slowDownRatioReverse[axis] - 
												s.slowDownRatioReverse[axis] * s.timeDiff / 10);

					s.speedDecelerationRatioAbs[axis] = Math.abs(s.lastFlickSpeed[axis] * s.speedDecelerationRatio[axis]);
					s.distanceOffset[axis] = s.lastFlickSpeed[axis] * s.speedDecelerationRatio[axis] * s.timeDiff;
					_panOffset[axis] += s.distanceOffset[axis];

				}
			},

			panAnimLoop: function() {
				if ( _animations.zoomPan ) {
					_animations.zoomPan.raf = _requestAF(s.panAnimLoop);

					s.now = _getCurrentTime();
					s.timeDiff = s.now - s.lastNow;
					s.lastNow = s.now;
					
					s.calculateAnimOffset('x');
					s.calculateAnimOffset('y');

					_applyCurrentZoomPan();
					
					s.calculateOverBoundsAnimOffset('x');
					s.calculateOverBoundsAnimOffset('y');


					if (s.speedDecelerationRatioAbs.x < 0.05 && s.speedDecelerationRatioAbs.y < 0.05) {

						// round pan position
						_panOffset.x = Math.round(_panOffset.x);
						_panOffset.y = Math.round(_panOffset.y);
						_applyCurrentZoomPan();
						
						_stopAnimation('zoomPan');
						return;
					}
				}

			}
		};
		return s;
	}
181328
public function flickLeft($x, $y, $distance, $duration)
    {
        return $this
            ->flick($x, $y, WebDriver_Server_Selendroid::DIRECTION_LEFT, $distance, $duration);
    }
198829
def motion_cb(self, viewer, button, data_x, data_y):
        
        self.showxy(viewer, data_x, data_y)
        return True