1e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase/* 2e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * Copyright (C) 2010 The Android Open Source Project 3e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * 4e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * Licensed under the Apache License, Version 2.0 (the "License"); 5e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * you may not use this file except in compliance with the License. 6e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * You may obtain a copy of the License at 7e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * 8e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * http://www.apache.org/licenses/LICENSE-2.0 9e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * 10e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * Unless required by applicable law or agreed to in writing, software 11e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * distributed under the License is distributed on an "AS IS" BASIS, 12e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * See the License for the specific language governing permissions and 14e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * limitations under the License. 15e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase */ 16e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase 17e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haasepackage android.animation; 18e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase 19e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase/** 20e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * A time interpolator defines the rate of change of an animation. This allows animations 21e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * to have non-linear motion, such as acceleration and deceleration. 22e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase */ 23e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haasepublic interface TimeInterpolator { 24e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase 25e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase /** 265c13d89c1332fcc499379b9064b891187b75ca32Chet Haase * Maps a value representing the elapsed fraction of an animation to a value that represents 27e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * the interpolated fraction. This interpolated value is then multiplied by the change in 28e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * value of an animation to derive the animated value at the current elapsed animation time. 29e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * 30e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * @param input A value between 0 and 1.0 indicating our current point 31e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * in the animation where 0 represents the start and 1.0 represents 32e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * the end 33e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * @return The interpolation value. This value can be more than 1.0 for 34e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * interpolators which overshoot their targets, or less than 0 for 35e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase * interpolators that undershoot their targets. 36e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase */ 37e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase float getInterpolation(float input); 38e0ee2e9f3102c3c14c873a75a7b04e49787e0fb9Chet Haase} 39