summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Workspace.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-04-21 16:19:16 -0700
committerAdam Cohen <adamcohen@google.com>2011-04-21 17:14:26 -0700
commit7f4eabe3709a72b416569136e4a095431c493c8b (patch)
treecf39d81a9a28c85ee3118727c3f679db9c8d00b1 /src/com/android/launcher2/Workspace.java
parentf579b5041afe8272c79f9f13001120d37eeeee7b (diff)
downloadandroid_packages_apps_Trebuchet-7f4eabe3709a72b416569136e4a095431c493c8b.tar.gz
android_packages_apps_Trebuchet-7f4eabe3709a72b416569136e4a095431c493c8b.tar.bz2
android_packages_apps_Trebuchet-7f4eabe3709a72b416569136e4a095431c493c8b.zip
Adding initial folder animation
-Changed CellLayout/CellLayoutChildren to use padding in the more standard way Change-Id: I728f1b699232422be76eb29b4cf710cd5723a0aa
Diffstat (limited to 'src/com/android/launcher2/Workspace.java')
-rw-r--r--src/com/android/launcher2/Workspace.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index b1aa41084..bf89c0611 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -471,6 +471,10 @@ public class Workspace extends SmoothPagedView
lp.cellVSpan = spanY;
}
+ if (spanX < 0 && spanY < 0) {
+ lp.isLockedToGrid = false;
+ }
+
// Get the canonical child id to uniquely represent this view in this screen
int childId = LauncherModel.getCellLayoutChildId(-1, screen, x, y, spanX, spanY);
boolean markCellsAsOccupied = !(child instanceof Folder);
@@ -2189,10 +2193,12 @@ public class Workspace extends SmoothPagedView
int viewX = dragViewX + (dragView.getWidth() - child.getMeasuredWidth()) / 2;
int viewY = dragViewY + (dragView.getHeight() - child.getMeasuredHeight()) / 2;
+ CellLayout layout = (CellLayout) parent;
+
// Set its old pos (in the new parent's coordinates); it will be animated
// in animateViewIntoPosition after the next layout pass
- lp.oldX = viewX - (parent.getLeft() - mScrollX);
- lp.oldY = viewY - (parent.getTop() - mScrollY);
+ lp.oldX = viewX - (layout.getLeft() + layout.getLeftPadding() - mScrollX);
+ lp.oldY = viewY - (layout.getTop() + layout.getTopPadding() - mScrollY);
}
/*
@@ -2204,8 +2210,8 @@ public class Workspace extends SmoothPagedView
final CellLayout.LayoutParams lp = (CellLayout.LayoutParams) view.getLayoutParams();
// Convert the animation params to be relative to the Workspace, not the CellLayout
- final int fromX = lp.oldX + parent.getLeft();
- final int fromY = lp.oldY + parent.getTop();
+ final int fromX = lp.oldX + parent.getLeft() + parent.getLeftPadding();
+ final int fromY = lp.oldY + parent.getTop() + parent.getTopPadding();
final int dx = lp.x - lp.oldX;
final int dy = lp.y - lp.oldY;