Fixing issue where dragging in the hotseat could trigger scrolling to side pages. (Bug: 5151006)

Change-Id: I1b1b98ecc87180fa5994f46194f1b5668e618b91
This commit is contained in:
Winson Chung
2011-10-03 15:15:18 -07:00
parent e4a647f879
commit 3e0839e5f8
3 changed files with 19 additions and 11 deletions
+9 -3
View File
@@ -3091,16 +3091,17 @@ public class Workspace extends SmoothPagedView
}
@Override
public void onEnterScrollArea(int x, int y, int direction) {
public boolean onEnterScrollArea(int x, int y, int direction) {
// Ignore the scroll area if we are dragging over the hot seat
if (mLauncher.getHotseat() != null) {
Rect r = new Rect();
mLauncher.getHotseat().getHitRect(r);
if (r.contains(x, y)) {
return;
return false;
}
}
boolean result = false;
if (!isSmall() && !mIsSwitchingState) {
mInScrollArea = true;
@@ -3120,12 +3121,15 @@ public class Workspace extends SmoothPagedView
// Workspace is responsible for drawing the edge glow on adjacent pages,
// so we need to redraw the workspace when this may have changed.
invalidate();
result = true;
}
}
return result;
}
@Override
public void onExitScrollArea() {
public boolean onExitScrollArea() {
boolean result = false;
if (mInScrollArea) {
if (mDragTargetLayout != null) {
// Unmark the overlapping layout and re-enter the current layout
@@ -3136,9 +3140,11 @@ public class Workspace extends SmoothPagedView
// Workspace is responsible for drawing the edge glow on adjacent pages,
// so we need to redraw the workspace when this may have changed.
invalidate();
result = true;
}
mInScrollArea = false;
}
return result;
}
private void onResetScrollArea() {