android.view.animation.AccelerateInterpolator#getInterpolation()源码实例Demo

下面列出了android.view.animation.AccelerateInterpolator#getInterpolation() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: DroidSpeech   文件: AnimatorBarRms.java
private void animateUp(long delta)
{
    boolean finished = false;
    int minHeight = (int) (fromHeightPart * bar.getMaxHeight());
    int toHeight = (int) (bar.getMaxHeight() * toHeightPart);

    float timePart = (float) delta / BAR_ANIMATION_UP_DURATION;

    AccelerateInterpolator interpolator = new AccelerateInterpolator();
    int height = minHeight + (int) (interpolator.getInterpolation(timePart) * (toHeight - minHeight));

    if (height < bar.getHeight()) {
        return;
    }

    if (height >= toHeight) {
        height = toHeight;
        finished = true;
    }

    bar.setHeight(height);
    bar.update();

    if (finished) {
        isUpAnimation = false;
        startTimestamp = System.currentTimeMillis();
    }
}
 
源代码2 项目: android-speech   文件: BarRmsAnimator.java
private void animateUp(long delta) {
    boolean finished = false;
    int minHeight = (int) (fromHeightPart * bar.getMaxHeight());
    int toHeight = (int) (bar.getMaxHeight() * toHeightPart);

    float timePart = (float) delta / BAR_ANIMATION_UP_DURATION;

    AccelerateInterpolator interpolator = new AccelerateInterpolator();
    int height = minHeight + (int) (interpolator.getInterpolation(timePart) * (toHeight - minHeight));

    if (height < bar.getHeight()) {
        return;
    }

    if (height >= toHeight) {
        height = toHeight;
        finished = true;
    }

    bar.setHeight(height);
    bar.update();

    if (finished) {
        isUpAnimation = false;
        startTimestamp = System.currentTimeMillis();
    }
}
 
源代码3 项目: SpeechRecognitionView   文件: BarRmsAnimator.java
private void animateUp(long delta) {
    boolean finished = false;
    int minHeight = (int) (fromHeightPart * bar.getMaxHeight());
    int toHeight = (int) (bar.getMaxHeight() * toHeightPart);

    float timePart = (float) delta / BAR_ANIMATION_UP_DURATION;

    AccelerateInterpolator interpolator = new AccelerateInterpolator();
    int height = minHeight + (int) (interpolator.getInterpolation(timePart) * (toHeight - minHeight));

    if (height < bar.getHeight()) {
        return;
    }

    if (height >= toHeight) {
        height = toHeight;
        finished = true;
    }

    bar.setHeight(height);
    bar.update();

    if (finished) {
        isUpAnimation = false;
        startTimestamp = System.currentTimeMillis();
    }
}