Java Code Examples for android.view.animation.AccelerateDecelerateInterpolator#getInterpolation()

The following examples show how to use android.view.animation.AccelerateDecelerateInterpolator#getInterpolation() . 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: AnimatorRotating.java    From DroidSpeech with Apache License 2.0 5 votes vote down vote up
private float decelerate(long delta, int scale)
{
    long accelerationDelta = delta - ACCELERATE_ROTATION_DURATION;
    AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
    float interpolatedTime = interpolator.getInterpolation((float) accelerationDelta / DECELERATE_ROTATION_DURATION);
    float decelerationAngle = -interpolatedTime * (ACCELERATION_ROTATION_DEGREES * scale);
    return ACCELERATION_ROTATION_DEGREES * scale + decelerationAngle;
}
 
Example 2
Source File: AnimatorRotating.java    From DroidSpeech with Apache License 2.0 5 votes vote down vote up
private float accelerate(long delta, int scale)
{
    AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
    float interpolatedTime = interpolator.getInterpolation((float) delta / ACCELERATE_ROTATION_DURATION);

    return interpolatedTime * (ACCELERATION_ROTATION_DEGREES * scale);
}
 
Example 3
Source File: RotatingAnimator.java    From android-speech with Apache License 2.0 5 votes vote down vote up
private float decelerate(long delta, int scale) {
    long accelerationDelta = delta - ACCELERATE_ROTATION_DURATION;
    AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
    float interpolatedTime = interpolator.getInterpolation((float) accelerationDelta / DECELERATE_ROTATION_DURATION);
    float decelerationAngle = -interpolatedTime * (ACCELERATION_ROTATION_DEGREES * scale);
    return ACCELERATION_ROTATION_DEGREES * scale + decelerationAngle;
}
 
Example 4
Source File: RotatingAnimator.java    From android-speech with Apache License 2.0 5 votes vote down vote up
private float accelerate(long delta, int scale) {
    long accelerationDelta = delta;
    AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
    float interpolatedTime = interpolator.getInterpolation((float) accelerationDelta / ACCELERATE_ROTATION_DURATION);
    float accelerationAngle = interpolatedTime * (ACCELERATION_ROTATION_DEGREES * scale);
    return accelerationAngle;
}
 
Example 5
Source File: RotatingAnimator.java    From SpeechRecognitionView with Apache License 2.0 5 votes vote down vote up
private float decelerate(long delta, int scale) {
    long accelerationDelta = delta - ACCELERATE_ROTATION_DURATION;
    AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
    float interpolatedTime = interpolator.getInterpolation((float) accelerationDelta / DECELERATE_ROTATION_DURATION);
    float decelerationAngle = -interpolatedTime * (ACCELERATION_ROTATION_DEGREES * scale);
    return ACCELERATION_ROTATION_DEGREES * scale + decelerationAngle;
}
 
Example 6
Source File: RotatingAnimator.java    From SpeechRecognitionView with Apache License 2.0 5 votes vote down vote up
private float accelerate(long delta, int scale) {
    long accelerationDelta = delta;
    AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
    float interpolatedTime = interpolator.getInterpolation((float) accelerationDelta / ACCELERATE_ROTATION_DURATION);
    float accelerationAngle = interpolatedTime * (ACCELERATION_ROTATION_DEGREES * scale);
    return accelerationAngle;
}