added spring loaded mode for adding items to workspace
Change-Id: Ie92294fe2b1d6697d84756a2fcea91a09f72825b
This commit is contained in:
1 parent
120980bd00
commit
d3ef3065ab
8 files changed
+409
-76
No files matched your search
@@ -801,7 +801,10 @@ public class CellLayout extends ViewGroup implements Dimmable {
|
||||
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 @@ public class CellLayout extends ViewGroup implements Dimmable {
|
||||
*
|
||||
* @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 @@ out: for (int i = x; i < x + spanX - 1 && x < xCount; i++) {
|
||||
|
||||
boolean dropped;
|
||||
|
||||
boolean animateDrop;
|
||||
|
||||
public LayoutParams(Context c, AttributeSet attrs) {
|
||||
super(c, attrs);
|
||||
cellHSpan = 1;
|
||||
|
||||
Reference in new issue
Block a user