Exemplo n.º 1
0
    void recursivelyHandleRotate(final RotationEvent e) {
      for (final RotationListener listener : handler.rotaters) {
        listener.rotate(e);
        if (e.isConsumed()) return;
      }

      final PerComponentNotifier next = getNextNotifierForComponent(component.getParent());
      if (next != null) next.recursivelyHandleRotate(e);
    }
  public void onTouch(MotionEvent e) {
    if (e.getPointerCount() != 2) return;

    if (e.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN) {
      mRotation = rotation(e);
    }

    float rotation = rotation(e);
    float delta = rotation - mRotation;
    mRotation += delta;
    mListener.onRotate(delta);
  }