Unifying overscroll btw phone and tablet

-> Using separate assets for removing and uninstalling

Change-Id: I183967c3ca482531ae28f71cd9053b673c6a8d03
This commit is contained in:
Adam Cohen
2011-11-09 17:20:41 -08:00
parent 31234d811d
commit ebea84d1c9
21 changed files with 124 additions and 48 deletions
+18 -1
View File
@@ -36,7 +36,6 @@ import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.NinePatchDrawable;
import android.util.AttributeSet;
@@ -72,6 +71,7 @@ public class CellLayout extends ViewGroup {
private int mWidthGap;
private int mHeightGap;
private int mMaxGap;
private boolean mScrollingTransformsDirty = false;
private final Rect mRect = new Rect();
private final CellInfo mCellInfo = new CellInfo();
@@ -345,6 +345,23 @@ 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