case MotionEvent.ACTION_POINTER_UP: updateStateByEvent(event); resetState(); break; resetState(); break; updateStateByEvent(event); && Math.abs(getShovePixelsDelta()) > 0.5f) { final boolean updatePrevious = mListener.onShove(this); if (updatePrevious) {
resetState(); // In case we missed an UP/CANCEL event mPrevEvent = MotionEvent.obtain(event); mTimeDelta = 0; updateStateByEvent(event); mSloppyGesture = isSloppyGesture(event); if(!mSloppyGesture){ mSloppyGesture = isSloppyGesture(event); if(!mSloppyGesture){
@Override public boolean onTouch(View view, MotionEvent event) { //we handle all the touch stuff ourselves, rather than //allowing the proxy to do it. This is because //we have to alter panTapGestureDetector and //it is private within TouchInput if(event.getActionMasked() == MotionEvent.ACTION_UP) { //notify the responder that the long press is finished if(longPressActive) { if(longPressResponder != null) longPressResponder.onLongPressUp(event.getX(), event.getY()); longPressActive = false; } } panTapGestureDetector.onTouchEvent(event); longPressGestureDetector.onTouchEvent(event); scaleGestureDetector.onTouchEvent(event); shoveGestureDetector.onTouchEvent(event); rotateGestureDetector.onTouchEvent(event); return true; }
public MyTouchInput(Context context, TouchInput onTouchListener) { this.orig = onTouchListener; this.panTapGestureDetector = new GestureDetector(context, this); this.panTapGestureDetector.setIsLongpressEnabled(false); this.longPressGestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() { @Override public void onLongPress(MotionEvent e) { MyTouchInput.this.onLongPress(e); } } ); this.scaleGestureDetector = new ScaleGestureDetector(context, this); this.rotateGestureDetector = new RotateGestureDetector(context, this); this.shoveGestureDetector = new ShoveGestureDetector(context, this); }
case MotionEvent.ACTION_POINTER_UP: updateStateByEvent(event); resetState(); break; resetState(); break; updateStateByEvent(event); && Math.abs(getShovePixelsDelta()) > 0.5f) { final boolean updatePrevious = mListener.onShove(this); if (updatePrevious) {
resetState(); // In case we missed an UP/CANCEL event mPrevEvent = MotionEvent.obtain(event); mTimeDelta = 0; updateStateByEvent(event); mSloppyGesture = isSloppyGesture(event); if (!mSloppyGesture) { mSloppyGesture = isSloppyGesture(event); if (!mSloppyGesture) {