| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.view.animation; |
| 18 |
|
| 19 |
import android.content.Context; |
| 20 |
import android.graphics.animation.HasNativeInterpolator; |
| 21 |
import android.graphics.animation.NativeInterpolator; |
| 22 |
import android.graphics.animation.NativeInterpolatorFactory; |
| 23 |
import android.util.AttributeSet; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
@HasNativeInterpolator |
| 30 |
public class AccelerateDecelerateInterpolator extends BaseInterpolator |
| 31 |
implements NativeInterpolator { |
| 32 |
public AccelerateDecelerateInterpolator() { |
| 33 |
} |
| 34 |
|
| 35 |
@SuppressWarnings({"UnusedDeclaration"}) |
| 36 |
public AccelerateDecelerateInterpolator(Context context, AttributeSet attrs) { |
| 37 |
} |
| 38 |
|
| 39 |
public float getInterpolation(float input) { |
| 40 |
return (float)(Math.cos((input + 1) * Math.PI) / 2.0f) + 0.5f; |
| 41 |
} |
| 42 |
|
| 43 |
|
| 44 |
@Override |
| 45 |
public long createNativeInterpolator() { |
| 46 |
return NativeInterpolatorFactory.createAccelerateDecelerateInterpolator(); |
| 47 |
} |
| 48 |
} |