You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
add AccelerateInterpolator based on AOSP version
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package android.view.animation;
|
||||
|
||||
/**
|
||||
* An interpolator where the rate of change starts out slowly and
|
||||
* and then accelerates.
|
||||
*
|
||||
*/
|
||||
public class AccelerateInterpolator implements Interpolator {
|
||||
private final float mFactor;
|
||||
private final double mDoubleFactor;
|
||||
|
||||
public AccelerateInterpolator() {
|
||||
mFactor = 1.0f;
|
||||
mDoubleFactor = 2.0;
|
||||
}
|
||||
|
||||
public float getInterpolation(float input) {
|
||||
if (mFactor == 1.0f) {
|
||||
return input * input;
|
||||
} else {
|
||||
return (float)Math.pow(input, mDoubleFactor);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
5
src/api-impl/android/view/animation/Interpolator.java
Normal file
5
src/api-impl/android/view/animation/Interpolator.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package android.view.animation;
|
||||
|
||||
public interface Interpolator {
|
||||
|
||||
}
|
||||
@@ -191,6 +191,8 @@ hax_jar = jar('hax', [
|
||||
'android/util/TypedValue.java',
|
||||
'android/util/Xml.java',
|
||||
'android/util/XmlPullAttributes.java',
|
||||
'android/view/animation/AccelerateInterpolator.java',
|
||||
'android/view/animation/Interpolator.java',
|
||||
'android/view/Choreographer.java',
|
||||
'android/view/Display.java',
|
||||
'android/view/Gravity.java',
|
||||
|
||||
Reference in New Issue
Block a user