Animating the drag view scale up and down when dragging items.

Change-Id: Ic97d74a14964c6bdc23305b2d378b13a1f2e3664
This commit is contained in:
Winson Chung
2012-02-13 18:29:29 -08:00
parent d83f5f4db3
commit 7bd1bbb509
13 changed files with 111 additions and 132 deletions
+4 -9
View File
@@ -170,7 +170,6 @@ public class Workspace extends SmoothPagedView
private Bitmap mDragOutline = null;
private final Rect mTempRect = new Rect();
private final int[] mTempXY = new int[2];
private int mDragViewMultiplyColor;
private float mOverscrollFade = 0;
// Paint used to draw external drop outline
@@ -297,7 +296,6 @@ public class Workspace extends SmoothPagedView
mSpringLoadedShrinkFactor =
res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100.0f;
mDragViewMultiplyColor = res.getColor(R.color.drag_view_multiply_color);
// if the value is manually specified, use that instead
cellCountX = a.getInt(R.styleable.Workspace_cellCountX, cellCountX);
@@ -1793,7 +1791,6 @@ public class Workspace extends SmoothPagedView
canvas.setBitmap(b);
drawDragView(v, canvas, padding, true);
mOutlineHelper.applyOuterBlur(b, canvas, outlineColor);
canvas.drawColor(mDragViewMultiplyColor, PorterDuff.Mode.MULTIPLY);
canvas.setBitmap(null);
return b;
@@ -2246,6 +2243,7 @@ public class Workspace extends SmoothPagedView
mLauncher.getDragLayer().animateViewIntoPosition(d.dragView, cell, duration,
disableHardwareLayersRunnable, this);
} else {
d.deferDragViewCleanupPostAnimation = false;
cell.setVisibility(VISIBLE);
}
parent.onDropChild(cell);
@@ -3070,14 +3068,11 @@ public class Workspace extends SmoothPagedView
scaleX = scaleY = Math.min(scaleX, scaleY);
}
if (animationType == COMPLETE_TWO_STAGE_WIDGET_DROP_ANIMATION) {
mLauncher.getDragLayer().scaleViewIntoPosition(dragView, loc, 1, scaleX, scaleY,
animationEnd, onCompleteRunnable, duration);
} else if (animationType == CANCEL_TWO_STAGE_WIDGET_DROP_ANIMATION) {
mLauncher.getDragLayer().scaleViewIntoPosition(dragView, loc, 0, 0.1f, 0.1f,
if (animationType == CANCEL_TWO_STAGE_WIDGET_DROP_ANIMATION) {
mLauncher.getDragLayer().animateViewIntoPosition(dragView, loc, 0f, 0.1f, 0.1f,
DragLayer.ANIMATION_END_DISAPPEAR, onCompleteRunnable, duration);
} else {
mLauncher.getDragLayer().animateViewIntoPosition(dragView, loc, scaleX, scaleY,
mLauncher.getDragLayer().animateViewIntoPosition(dragView, loc, 1f, scaleX, scaleY,
animationEnd, onCompleteRunnable, duration);
}
}