change package name to uiuios

This commit is contained in:
2020-11-02 15:31:36 +08:00
parent 164c1fc8a0
commit c5bda0953d
645 changed files with 3881 additions and 3881 deletions

View File

@@ -0,0 +1,27 @@
package com.android.uiuios;
import android.animation.TimeInterpolator;
public class LogAccelerateInterpolator implements TimeInterpolator {
int mBase;
int mDrift;
final float mLogScale;
public LogAccelerateInterpolator(int base, int drift) {
mBase = base;
mDrift = drift;
mLogScale = 1f / computeLog(1, mBase, mDrift);
}
static float computeLog(float t, int base, int drift) {
return (float) -Math.pow(base, -t) + 1 + (drift * t);
}
@Override
public float getInterpolation(float t) {
// Due to rounding issues, the interpolation doesn't quite reach 1 even though it should.
// To account for this, we short-circuit to return 1 if the input is 1.
return Float.compare(t, 1f) == 0 ? 1f : 1 - computeLog(1 - t, mBase, mDrift) * mLogScale;
}
}