add missing APIs related to scrolling

This commit is contained in:
Julian Winkler
2023-11-11 11:45:01 +01:00
parent 4bf4887244
commit 1a039e5e51
4 changed files with 35 additions and 3 deletions

View File

@@ -2,12 +2,21 @@ package android.view.animation;
public class DecelerateInterpolator implements Interpolator{
public DecelerateInterpolator(float value) {}
private float factor = 1.0f;
public DecelerateInterpolator(float value) {
factor = value;
}
@Override
public float getInterpolation(float input) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'getInterpolation'");
float result;
if (factor == 1.0f) {
result = 1.0f - (1.0f - input) * (1.0f - input);
} else {
result = 1.0f - (float)Math.pow((1.0f - input), 2 * factor);
}
return result;
}
}