Unifying overscroll btw phone and tablet
-> Using separate assets for removing and uninstalling Change-Id: I183967c3ca482531ae28f71cd9053b673c6a8d03
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user