code: public void rotationUpdate(final float angleNew, final boolean animate) {
          if (animate) {
              if (Math.abs(angle0 - angleNew) > ANGLE_DELTA_THRESHOLD) {
                  angle0 = angleNew;
                  this.invalidate();
              }
              animationOn = true;
          } else {
              angle1 = angleNew;
              angle2 = angleNew;
              angle0 = angleNew;
              angleLastDrawn = angleNew;
              this.invalidate();
              animationOn = false;
          }
      }
docs: Use this to set new "magnetic field" angle at which image should rotate
  
  @param angleNew new magnetic field angle, deg., relative to vertical axis.
  @param animate  true, if image shoud rotate using animation, false to set new rotation instantly