diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/Folder.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java index 6f09ab544..695604454 100644 --- a/src/com/android/launcher2/Folder.java +++ b/src/com/android/launcher2/Folder.java @@ -728,11 +728,17 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList int centeredLeft = centerX - width / 2; int centeredTop = centerY - height / 2; + int currentPage = mLauncher.getWorkspace().getCurrentPage(); + // In case the workspace is scrolling, we need to use the final scroll to compute + // the folders bounds. + mLauncher.getWorkspace().setFinalScrollForPageChange(currentPage); // We first fetch the currently visible CellLayoutChildren - CellLayout currentPage = mLauncher.getWorkspace().getCurrentDropLayout(); - CellLayoutChildren boundingLayout = currentPage.getChildrenLayout(); + CellLayout currentLayout = (CellLayout) mLauncher.getWorkspace().getChildAt(currentPage); + CellLayoutChildren boundingLayout = currentLayout.getChildrenLayout(); Rect bounds = new Rect(); parent.getDescendantRectRelativeToSelf(boundingLayout, bounds); + // We reset the workspaces scroll + mLauncher.getWorkspace().resetFinalScrollForPageChange(currentPage); // We need to bound the folder to the currently visible CellLayoutChildren int left = Math.min(Math.max(bounds.left, centeredLeft), |