Adding dampened snap back overscroll to Workspace and AppsCustomizePagedView

issue 15475254

Change-Id: I5eb9fc480167faf4be16bd17bf18e2d103f40f47
This commit is contained in:
Adam Cohen
2014-08-18 13:45:36 -07:00
parent ac11d41686
commit 1e4359c54e
4 changed files with 43 additions and 132 deletions
-18
View File
@@ -71,7 +71,6 @@ public class CellLayout extends ViewGroup {
private int mWidthGap;
private int mHeightGap;
private int mMaxGap;
private boolean mScrollingTransformsDirty = false;
private boolean mDropPending = false;
// These are temporary variables to prevent having to allocate a new object just to
@@ -388,23 +387,6 @@ public class CellLayout extends ViewGroup {
return mIsDragOverlapping;
}
protected void setOverscrollTransformsDirty(boolean dirty) {
mScrollingTransformsDirty = dirty;
}
protected void resetOverscrollTransforms() {
if (mScrollingTransformsDirty) {
setOverscrollTransformsDirty(false);
setTranslationX(0);
setRotationY(0);
// It doesn't matter if we pass true or false here, the important thing is that we
// pass 0, which results in the overscroll drawable not being drawn any more.
setOverScrollAmount(0, false);
setPivotX(getMeasuredWidth() / 2);
setPivotY(getMeasuredHeight() / 2);
}
}
@Override
protected void onDraw(Canvas canvas) {
// When we're large, we are either drawn in a "hover" state (ie when dragging an item to