Java Code Examples for android.view.animation.DecelerateInterpolator#getInterpolation()
The following examples show how to use
android.view.animation.DecelerateInterpolator#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: AnimatorBarRms.java From DroidSpeech with Apache License 2.0 | 6 votes |
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(); }
Example 2
Source File: BarRmsAnimator.java From android-speech with Apache License 2.0 | 6 votes |
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(); }
Example 3
Source File: BarRmsAnimator.java From SpeechRecognitionView with Apache License 2.0 | 6 votes |
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(); }