added spring loaded mode for adding items to workspace
Change-Id: Ie92294fe2b1d6697d84756a2fcea91a09f72825b
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 8fe489d..a104c55 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -801,7 +801,10 @@
cellXY[0] + childLeft + lp.width / 2,
cellXY[1] + childTop + lp.height / 2, 0, null);
- ((Workspace) mParent).animateViewIntoPosition(child);
+ if (lp.animateDrop) {
+ lp.animateDrop = false;
+ ((Workspace) mParent).animateViewIntoPosition(child);
+ }
}
}
}
@@ -1224,11 +1227,12 @@
*
* @param child The child that is being dropped
*/
- void onDropChild(View child) {
+ void onDropChild(View child, boolean animate) {
if (child != null) {
LayoutParams lp = (LayoutParams) child.getLayoutParams();
lp.isDragging = false;
lp.dropped = true;
+ lp.animateDrop = animate;
child.setVisibility(View.VISIBLE);
child.requestLayout();
}
@@ -1466,6 +1470,8 @@
boolean dropped;
+ boolean animateDrop;
+
public LayoutParams(Context c, AttributeSet attrs) {
super(c, attrs);
cellHSpan = 1;