summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-12-13 21:28:43 -0800
committerAdam Cohen <adamcohen@google.com>2011-12-13 21:28:43 -0800
commit7cc1bc4b657630250515ee8b1f65b77417e4c9b3 (patch)
treeddfb8949d25ef5d836f51600c95b6d22a895924b /src/com/android
parent662b598c86a1772d95303ef9c921d4bbe342387b (diff)
downloadandroid_packages_apps_Trebuchet-7cc1bc4b657630250515ee8b1f65b77417e4c9b3.tar.gz
android_packages_apps_Trebuchet-7cc1bc4b657630250515ee8b1f65b77417e4c9b3.tar.bz2
android_packages_apps_Trebuchet-7cc1bc4b657630250515ee8b1f65b77417e4c9b3.zip
Fix issue where folder can open offscreen (issue 5291408)
Change-Id: I359dc2188c50ab1c4e42c448ecce04530ba45734
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher2/Folder.java10
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),