Example usage for android.animation ObjectAnimator setRepeatCount

List of usage examples for android.animation ObjectAnimator setRepeatCount

Introduction

In this page you can find the example usage for android.animation ObjectAnimator setRepeatCount.

Prototype

public void setRepeatCount(int value) 

Source Link

Document

Sets how many times the animation should be repeated.

Usage

From source file:org.protocoderrunner.apprunner.api.PUI.java

@ProtocoderScript
@APIMethod(description = "Makes the view blink", example = "")
@APIParam(params = { "View", "speed", "num" })
public void blink(View v, int speed, int num) {
    ObjectAnimator anim = ObjectAnimator.ofFloat(v, "alpha", 1f, 0f, 1f);
    anim.setDuration(speed);//  w w w  .  ja  v a 2  s  . co  m
    //anim.setInterpolator(new CycleInterpolator(num));
    anim.setRepeatCount(num);
    anim.start();
}

From source file:org.protocoderrunner.apprunner.api.PUI.java

@ProtocoderScript
@APIMethod(description = "Makes the view blink", example = "")
@APIParam(params = { "View", "num" })
public void blink(View v, int num) {
    ObjectAnimator anim = ObjectAnimator.ofFloat(v, "alpha", 1f, 0f, 1f);
    anim.setDuration(AppSettings.animGeneralSpeed);
    anim.setInterpolator(new CycleInterpolator(1));
    anim.setRepeatCount(num);
    anim.start();/*w w w  .  j  a v  a2  s .  c o m*/
}

From source file:com.klinker.android.sliding.MultiShrinkScroller.java

/**
 * Scroll the activity off the bottom of the screen.
 *//*  ww w .  j  a  va  2 s. c  o  m*/
public void scrollOffBottom() {
    isTouchDisabledForDismissAnimation = true;
    scroller.forceFinished(true);

    if (!willUseReverseExpansion()) {
        final Interpolator interpolator = new AcceleratingFlingInterpolator(EXIT_FLING_ANIMATION_DURATION_MS,
                getCurrentVelocity(), getScrollUntilOffBottom());
        ObjectAnimator translateAnimation = ObjectAnimator.ofInt(this, "scroll",
                getScroll() - getScrollUntilOffBottom());
        translateAnimation.setRepeatCount(0);
        translateAnimation.setInterpolator(interpolator);
        translateAnimation.setDuration(EXIT_FLING_ANIMATION_DURATION_MS);
        translateAnimation.addListener(exitAnimationListner);
        translateAnimation.start();
    } else {
        reverseExpansionAnimation();
    }

    if (listener != null) {
        listener.onStartScrollOffBottom();
    }
}