/*
Invoked when the user has finished a touch operation.
551088
function touchEnd(element, clientX, clientY) {
  element[symbols.dragging] = false;
  if (element[deltaXSymbol] >= 20) {
    // Finished going right at high speed.
    element[symbols.goLeft]();
  } else if (element[deltaXSymbol] <= -20) {
    // Finished going left at high speed.
    element[symbols.goRight]();
  } else {
    // Finished at low speed.
    trackTo(element, clientX);
    const travelFraction = element.travelFraction;
    if (travelFraction >= 0.5) {
      element[symbols.goRight]();
    } else if (travelFraction <= -0.5) {
      element[symbols.goLeft]();
    }
  }
  element.travelFraction = 0;
  element[deltaXSymbol] = null;
  element[deltaYSymbol] = null;
}
185708
function gestureEnd(ev) {
    if (!pointer || !typesMatch(ev, pointer)) return;

    updatePointerState(ev, pointer);
    pointer.endTime = +Date.now();

    if (ev.type !== 'pointercancel') {
      runHandlers('end', ev);
    }

    lastPointer = pointer;
    pointer = null;
  }
1215895
def on_touch_move(self, touch):
        """"""
        if hasattr(self, '_lasttouch') and self._lasttouch == touch:
            return
        if self.app.selection in self.selection_candidates:
            self.selection_candidates.remove(self.app.selection)
        if self.app.selection:
            if not self.selection_candidates:
                self.keep_selection = True
            ret = super().on_touch_move(touch)
            return ret
        elif self.selection_candidates:
            for cand in self.selection_candidates:
                if cand.collide_point(*touch.pos):
                    self.app.selection = cand
                    cand.selected = True
                    touch.grab(cand)
                    ret = super().on_touch_move(touch)
                    return ret
601338
function(elements, options, done) {
            elements = ensureAnArray(elements);
            options = merge(options, {
                pos: [300, 300],
                scale: 2,
                duration: 250,
                radius: 100,
                touches: 2
            });

            var touches = getTouches(options.pos, elements, options.touches);
            triggerGesture(elements, touches, options, function() {
                done && setTimeout(done, 25);
            });
        }
1146301
public boolean dispatchTouchEvent(final MotionEvent event) {
    checkNotNull(event, "event == null");
    boolean isEventConsumed = false;

    switch (event.getAction()) {
      case MotionEvent.ACTION_DOWN: // user started touching the screen
        onActionDown(event);
        break;
      case MotionEvent.ACTION_UP:   // user stopped touching the screen
        isEventConsumed = onActionUp(event);
        break;
      case MotionEvent.ACTION_MOVE: // user is moving finger on the screen
        onActionMove(event);
        break;
      default:
        break;
    }

    return isEventConsumed;
  }
528825
function () {
            var _startTime = 0,
                _pos = {};
    
            this._touchHandler = $B.bind(function (e) {
                var currentTime = new Date().getTime(),
                    currentPos = this._getPos(),
                    interval = currentTime - _startTime;
    
                if ( interval < this._delay && this._isSamePos(_pos, currentPos) ) {
                    this.dispatch( 'doubletab', {
                        target: e.target,
                        currentTarget: this._target,
                        stopPropagation: function () { e.stopPropagation(); },
                        preventDefault: function () { e.preventDefault(); }
                    });
                } else {
                    _startTime = currentTime;
                    _pos = currentPos;
                }
            }, this);
    
            this._touchEvent = new $B.event.TouchEvent( this._target );
            this.enable();
        }
551115
function (e) {
		var originalEvent = e.originalEvent;
		var clientX;
		var clientY;
		if (originalEvent.touches && originalEvent.touches[0] && !this._clickHandled && !this._touchHandled && !this._disableMarkers) {
			clientX = originalEvent.touches[0].clientX;
			clientY = originalEvent.touches[0].clientY;
			this._disableNewMarkers();
			this._touchHandled = true;
			this._startPoint.call(this, clientX, clientY);
			this._endPoint.call(this, clientX, clientY, e);
			this._touchHandled = null;
		}
		this._clickHandled = null;
	}
49792
function stopHandler( event ) {
					$this.unbind( touchMoveEvent, moveHandler )
						.unbind( touchStopEvent, stopHandler );

					if ( start && stop ) {
						$.event.special.swipe.handleSwipe( start, stop );
					}
					start = stop = undefined;
				}
84703
@Override
    public final void onCompleted(String pin) {
        resetStatus();
        if ("".equals(firstPin)) {
            firstPin = pin;
            setLabel(getString(R.string.message_confirm_pin));
        } else {
            if (pin.equals(firstPin)) {
                onPinSet(pin);
                setResult(SUCCESS);
                finish();
            } else {
                setLabel(getString(R.string.message_pin_mismatch));
                firstPin = "";
            }
        }
        resetStatus();
    }
1083687
private void onFinish() {
        if (planRequired && state.getTestSet().getPlan() == null) {
            throw new ParserException("Missing TAP Plan.");
        }
        parseDiagnostics();

        while (!states.isEmpty() && state.getIndentationLevel() > baseIndentation) {
            state = states.pop();
        }
    }
400020
def finished(self):
        
        self.data_service.update_activity(self.id, self.name, self.desc,
                                          started_on=self.started,
                                          ended_on=self._current_timestamp_str())
328756
@Override
	public void onMapTouchEnd(TouchEvent<?> event) {
		onUp(event);
		event.stopPropagation();
		event.preventDefault();
	}
741084
function onTouchStart(event) {
      var touches = event.touches && event.touches.length ? event.touches : [event];
      var x = touches[0].clientX;
      var y = touches[0].clientY;
      touchCoordinates.push(x, y);

      $timeout(function() {
        // Remove the allowable region.
        for (var i = 0; i < touchCoordinates.length; i += 2) {
          if (touchCoordinates[i] === x && touchCoordinates[i+1] === y) {
            touchCoordinates.splice(i, i + 2);
            return;
          }
        }
      }, PREVENT_DURATION, false);
    }
1202584
function touchLeave(jqEvent) {
			var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent;
			
			//If we have the trigger on leave property set....
			if(options.triggerOnTouchLeave) {
				phase = getNextPhase( PHASE_END );
				triggerHandler(event, phase);
			}
		}
616379
function(e) {
            for (var i=0, ii=touches.length; i<ii; ++i) {
                if (touches[i].pointerId == e.pointerId) {
                    touches.splice(i, 1);
                    break;
                }
            }
        }
178131
public void finished()
  {
    if (tc.isEntryEnabled()) 
      SibTr.entry(tc, "finished");
      
    browserIterator = null;

    if (tc.isEntryEnabled()) 
      SibTr.exit(tc, "finished");
  }
1005480
def on_touch_up(self, touch):
        """"""
        if hasattr(self, '_lasttouch') and self._lasttouch == touch:
            return
        self._lasttouch = touch
        touch.push()
        touch.apply_transform_2d(self.to_local)
        if hasattr(self, 'protodest'):
            Logger.debug("Board: on_touch_up making a portal")
            touch.ungrab(self)
            ret = self.portal_touch_up(touch)
            touch.pop()
            return ret
        if self.app.selection and hasattr(self.app.selection, 'on_touch_up'):
            self.app.selection.dispatch('on_touch_up', touch)
        for candidate in self.selection_candidates:
            if candidate == self.app.selection:
                continue
            if candidate.collide_point(*touch.pos):
                Logger.debug("Board: selecting " + repr(candidate))
                if hasattr(candidate, 'selected'):
                    candidate.selected = True
                if hasattr(self.app.selection, 'selected'):
                    self.app.selection.selected = False
                self.app.selection = candidate
                self.keep_selection = True
                parent = candidate.parent
                parent.remove_widget(candidate)
                parent.add_widget(candidate)
                break
        if not self.keep_selection:
            Logger.debug("Board: deselecting " + repr(self.app.selection))
            if hasattr(self.app.selection, 'selected'):
                self.app.selection.selected = False
            self.app.selection = None
        self.keep_selection = False
        touch.ungrab(self)
        touch.pop()
        return