Java Code Examples for android.animation.ValueAnimator#removeAllUpdateListeners()

The following examples show how to use android.animation.ValueAnimator#removeAllUpdateListeners() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TapTargetView.java    From styT with Apache License 2.0 6 votes vote down vote up
void onDismiss(boolean userInitiated) {
    if (isDismissed) return;

    isDismissed = true;

    for (final ValueAnimator animator : animators) {
        animator.cancel();
        animator.removeAllUpdateListeners();
    }

    ViewUtil.removeOnGlobalLayoutListener(getViewTreeObserver(), globalLayoutListener);
    visible = false;

    if (listener != null) {
        listener.onTargetDismissed(this, userInitiated);
    }
}
 
Example 2
Source File: TapTargetView.java    From TapTargetView with Apache License 2.0 6 votes vote down vote up
void onDismiss(boolean userInitiated) {
  if (isDismissed) return;

  isDismissing = false;
  isDismissed = true;

  for (final ValueAnimator animator : animators) {
    animator.cancel();
    animator.removeAllUpdateListeners();
  }

  ViewUtil.removeOnGlobalLayoutListener(getViewTreeObserver(), globalLayoutListener);
  visible = false;

  if (listener != null) {
    listener.onTargetDismissed(this, userInitiated);
  }
}
 
Example 3
Source File: AlarmDismissActivity.java    From SuntimesWidget with GNU General Public License v3.0 6 votes vote down vote up
@TargetApi(11)
private void stopAnimateColors(TextView[] labels, Button[] buttons)
{
    clockText.setTextColor(timeColor);
    //alarmTitle.setTextColor(titleColor);

    ValueAnimator animation = (ValueAnimator)animationObj;
    if (animation != null) {
        animation.removeAllUpdateListeners();
    }

    for (TextView label : labels){
        if (label != null) {
            label.setTextColor(textColor);
        }
    }

    ColorStateList buttonColors = SuntimesUtils.colorStateList(enabledColor, disabledColor, pressedColor);
    for (Button button : buttons) {
        if (button != null) {
            button.setTextColor(buttonColors);
            colorizeButtonCompoundDrawable(enabledColor, button);
        }
    }
}
 
Example 4
Source File: EyebrowsView.java    From Eyebrows with MIT License 5 votes vote down vote up
/**
 * stop the anim
 */
public void stop(){
    viewRefreshAnimator.setRepeatCount(0);
    viewRefreshAnimator.removeAllListeners();
    viewRefreshAnimator.removeAllUpdateListeners();
    viewRefreshAnimator.cancel();
    viewRefreshAnimator.end();
    for (ValueAnimator valueAnimator : eyebrowsAnimators) {
        valueAnimator.setRepeatCount(0);
        valueAnimator.removeAllListeners();
        valueAnimator.removeAllUpdateListeners();
        valueAnimator.cancel();
        valueAnimator.end();
    }
}
 
Example 5
Source File: ViewHelper.java    From Common with Apache License 2.0 5 votes vote down vote up
@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
public static void clearValueAnimator(ValueAnimator animator) {
    if (animator != null) {
        animator.removeAllListeners();
        animator.removeAllUpdateListeners();
        if (Build.VERSION.SDK_INT >= 19) {
            animator.pause();
        }
        animator.cancel();
    }
}
 
Example 6
Source File: Indicator.java    From XKnife-Android with Apache License 2.0 5 votes vote down vote up
private void stopAnimators() {
    if (mAnimators != null) {
        for (ValueAnimator animator : mAnimators) {
            if (animator != null && animator.isStarted()) {
                animator.removeAllUpdateListeners();
                animator.end();
            }
        }
    }
}
 
Example 7
Source File: BallPulseView.java    From AgentWebX5 with Apache License 2.0 5 votes vote down vote up
public void stopAnim() {
    if (mAnimators != null) {
        for (ValueAnimator animator : mAnimators) {
            if (animator != null && animator.isStarted()) {
                animator.removeAllUpdateListeners();
                animator.end();
            }
        }
    }
    setIndicatorColor(normalColor);
}
 
Example 8
Source File: ViewHelper.java    From DMusic with Apache License 2.0 5 votes vote down vote up
public static void clearValueAnimator(ValueAnimator animator) {
    if (animator != null) {
        animator.removeAllListeners();
        animator.removeAllUpdateListeners();
        if (Build.VERSION.SDK_INT >= 19) {
            animator.pause();
        }
        animator.cancel();
    }
}
 
Example 9
Source File: Indicator.java    From LRecyclerView with Apache License 2.0 5 votes vote down vote up
private void stopAnimators() {
    if (mAnimators!=null){
        for (ValueAnimator animator : mAnimators) {
            if (animator != null && animator.isStarted()) {
                animator.removeAllUpdateListeners();
                animator.end();
            }
        }
    }
}
 
Example 10
Source File: BallPulseView.java    From TwinklingRefreshLayout with Apache License 2.0 5 votes vote down vote up
public void stopAnim() {
    if (mAnimators != null) {
        for (ValueAnimator animator : mAnimators) {
            if (animator != null && animator.isStarted()) {
                animator.removeAllUpdateListeners();
                animator.end();
            }
        }
    }
    setIndicatorColor(normalColor);
}
 
Example 11
Source File: DotLoader.java    From DotLoader with Apache License 2.0 5 votes vote down vote up
private ValueAnimator clonePositionAnimatorForDot(ValueAnimator animator, final Dot dot) {
    ValueAnimator valueAnimator = animator.clone();
    valueAnimator.removeAllUpdateListeners();
    valueAnimator.addUpdateListener(new DotYUpdater(dot, this));
    valueAnimator.setStartDelay(DELAY_BETWEEN_DOTS * dot.position);
    valueAnimator.removeAllListeners();
    valueAnimator.addListener(new AnimationRepeater(dot, mColors));
    return valueAnimator;
}
 
Example 12
Source File: BeerView.java    From BeerSwipeRefresh with Apache License 2.0 5 votes vote down vote up
@Override protected void onDetachedFromWindow() {
  if (mAlphaAnimator != null) {
    mAlphaAnimator.end();
    mAlphaAnimator.removeAllUpdateListeners();
  }
  for (ValueAnimator animator : mFrothAnimators) {
    if (animator != null) {
      animator.end();
      animator.removeAllUpdateListeners();
    }
  }
  super.onDetachedFromWindow();
}
 
Example 13
Source File: DotLoader.java    From DotLoader with Apache License 2.0 4 votes vote down vote up
private ValueAnimator cloneColorAnimatorForDot(ValueAnimator colorAnimator, Dot dot) {
    ValueAnimator valueAnimator = colorAnimator.clone();
    valueAnimator.removeAllUpdateListeners();
    valueAnimator.addUpdateListener(new DotColorUpdater(dot, this));
    return valueAnimator;
}