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

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

源代码1 项目: DroidSpeech   文件: AnimatorBarRms.java
private void animateDown(long delta)
{
    int minHeight = bar.getRadius() * 2;
    int fromHeight = (int) (bar.getMaxHeight() * toHeightPart);

    float timePart = (float) delta / BAR_ANIMATION_DOWN_DURATION;

    DecelerateInterpolator interpolator = new DecelerateInterpolator();
    int height = minHeight + (int) ((1f - interpolator.getInterpolation(timePart)) * (fromHeight - minHeight));

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

    if (height <= minHeight) {
        finish();
        return;
    }

    bar.setHeight(height);
    bar.update();
}
 
源代码2 项目: android-speech   文件: BarRmsAnimator.java
private void animateDown(long delta) {
    int minHeight = bar.getRadius() * 2;
    int fromHeight = (int) (bar.getMaxHeight() * toHeightPart);

    float timePart = (float) delta / BAR_ANIMATION_DOWN_DURATION;

    DecelerateInterpolator interpolator = new DecelerateInterpolator();
    int height = minHeight + (int) ((1f - interpolator.getInterpolation(timePart)) * (fromHeight - minHeight));

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

    if (height <= minHeight) {
        finish();
        return;
    }

    bar.setHeight(height);
    bar.update();
}
 
源代码3 项目: SpeechRecognitionView   文件: BarRmsAnimator.java
private void animateDown(long delta) {
    int minHeight = bar.getRadius() * 2;
    int fromHeight = (int) (bar.getMaxHeight() * toHeightPart);

    float timePart = (float) delta / BAR_ANIMATION_DOWN_DURATION;

    DecelerateInterpolator interpolator = new DecelerateInterpolator();
    int height = minHeight + (int) ((1f - interpolator.getInterpolation(timePart)) * (fromHeight - minHeight));

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

    if (height <= minHeight) {
        finish();
        return;
    }

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