Exemplo n.º 1
0
  private void setAction(Action action, boolean animate, int rotation) {
    if (action == null) {
      return;
    }

    this.rotation = rotation;
    if (currentAction == null) {
      currentAction = action;
      currentAction.flipHorizontally();
      animationProgress = 1f;
      UiHelper.postInvalidateOnAnimation(this);
      return;
    }

    if (currentAction.getClass().equals(action.getClass())) {
      return;
    }

    oldAction = currentAction;
    currentAction = action;

    if (animate) {
      animationProgress = 0f;
      if (ready) {
        startAnimation();
      } else {
        animateWhenReady = true;
      }
    } else {
      animationProgress = 1f;
      UiHelper.postInvalidateOnAnimation(this);
    }
  }
Exemplo n.º 2
0
 /**
  * Set the color used for drawing an {@link at.markushi.ui.action.Action}.
  *
  * @param color
  */
 public void setColor(final int color) {
   this.color = color;
   paint.setColor(color);
   UiHelper.postInvalidateOnAnimation(this);
 }
Exemplo n.º 3
0
 public void setAnimationProgress(float animationProgress) {
   this.animationProgress = animationProgress;
   UiHelper.postInvalidateOnAnimation(this);
 }