Example usage for android.animation ValueAnimator getCurrentPlayTime

List of usage examples for android.animation ValueAnimator getCurrentPlayTime

Introduction

In this page you can find the example usage for android.animation ValueAnimator getCurrentPlayTime.

Prototype

public long getCurrentPlayTime() 

Source Link

Document

Gets the current position of the animation in time, which is equal to the current time minus the time that the animation started.

Usage

From source file:Main.java

public static float getAnimatedFraction(ValueAnimator animator) {
    float fraction = ((float) animator.getCurrentPlayTime()) / animator.getDuration();
    fraction = Math.min(fraction, 1f);
    fraction = animator.getInterpolator().getInterpolation(fraction);
    return fraction;
}

From source file:Main.java

public static float getAnimatedFraction(ValueAnimator animator) {
    float fraction = animator.getDuration() > 0L
            ? (float) animator.getCurrentPlayTime() / (float) animator.getDuration()
            : 0.0F;/*from  w  w w. j  av  a 2  s . c  o m*/
    fraction = Math.min(fraction, 1.0F);
    fraction = animator.getInterpolator().getInterpolation(fraction);
    return fraction;
}

From source file:Main.java

static float getAnimatedFraction(ValueAnimator animator) {
    float fraction = animator.getDuration() > 0L
            ? (float) animator.getCurrentPlayTime() / (float) animator.getDuration()
            : 0.0F;//w  ww  . j a  v  a  2 s.co  m

    fraction = Math.min(fraction, 1.0F);
    fraction = animator.getInterpolator().getInterpolation(fraction);
    return fraction;
}

From source file:Main.java

static float getAnimatedFraction(ValueAnimator animator) {
    float fraction = animator.getDuration() > 0
            ? ((float) animator.getCurrentPlayTime()) / animator.getDuration()
            : 1f;//from   www.j a  v  a 2 s . c  o m

    fraction %= 1f;
    fraction = min(fraction, 1f);
    fraction = animator.getInterpolator().getInterpolation(fraction);
    return fraction;
}

From source file:Main.java

static float getAnimatedFraction(ValueAnimator animator) {
    float fraction = animator.getDuration() > 0
            ? ((float) animator.getCurrentPlayTime()) / animator.getDuration()
            : 0f;/*ww  w.j a  v  a 2  s .  c o m*/

    fraction = min(fraction, 1f);
    fraction = animator.getInterpolator().getInterpolation(fraction);
    return fraction;
}

From source file:Main.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@SuppressLint("NewApi")
static float getAnimatedFraction(ValueAnimator animator) {
    float fraction = animator.getDuration() > 0
            ? ((float) animator.getCurrentPlayTime()) / animator.getDuration()
            : 0f;//from  w ww . j a  v  a  2  s.  c  o m

    fraction = min(fraction, 1f);
    fraction = animator.getInterpolator().getInterpolation(fraction);
    return fraction;
}

From source file:ch.berta.fabio.fabprogress.FabProgress.java

private float getAnimatedFraction(@NonNull ValueAnimator animator) {
    float fraction = ((float) animator.getCurrentPlayTime()) / animator.getDuration();
    fraction = Math.min(fraction, 1f);
    fraction = animator.getInterpolator().getInterpolation(fraction);
    return fraction;
}