Consolidating various interpolators

Change-Id: I9588eee3552001b162a1e8d5ccefcfb44d221880
This commit is contained in:
Sunny Goyal committed 2017-10-26 16:38:55 -07:00
1 parent d4ece005e4
commit 5bc6b6f14c
23 files changed
+153 -190

No files matched your search

+2 -11
View File
@@ -46,6 +46,7 @@ import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.Interpolator;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.anim.PropertyListBuilder;
import com.android.launcher3.pageindicators.PageIndicator;
import com.android.launcher3.touch.OverScroll;
@@ -214,7 +215,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
*/
protected void init() {
mScroller = new LauncherScroller(getContext());
setDefaultInterpolator(new ScrollInterpolator());
setDefaultInterpolator(Interpolators.SCROLL);
mCurrentPage = 0;
final ViewConfiguration configuration = ViewConfiguration.get(getContext());
@@ -1766,16 +1767,6 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
return PAGE_SNAP_ANIMATION_DURATION;
}
public static class ScrollInterpolator implements Interpolator {
public ScrollInterpolator() {
}
public float getInterpolation(float t) {
t -= 1.0f;
return t*t*t*t*t + 1;
}
}
// We want the duration of the page snap animation to be influenced by the distance that
// the screen has to travel, however, we don't want this duration to be effected in a
// purely linear fashion. Instead, we use this method to moderate the effect that the distance