diff options
author | Winson Chung <winsonc@google.com> | 2011-07-29 14:49:10 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-08-02 14:06:55 -0700 |
commit | 1c4cf4a11f3f7f24bbf65f958fdd22295d0bbd55 (patch) | |
tree | 9805fe46eedfe4c1ee7bee5148b60b9ebea98987 /src/com/android/launcher2/Workspace.java | |
parent | ed51cc9a12c50d12e7d30ed209a49f1a40858043 (diff) | |
download | android_packages_apps_Trebuchet-1c4cf4a11f3f7f24bbf65f958fdd22295d0bbd55.tar.gz android_packages_apps_Trebuchet-1c4cf4a11f3f7f24bbf65f958fdd22295d0bbd55.tar.bz2 android_packages_apps_Trebuchet-1c4cf4a11f3f7f24bbf65f958fdd22295d0bbd55.zip |
Minor bug fixes
- Making the spring loaded side page hovers slightly faster
- Fixing issue where you can't drag over another item on another page to create a portal
- Ignoring side pages while hovering over hotseat
- Fixing issue where hotseat may be stuck in shrunken state (and removing the scale on the hotseat)
Change-Id: I87d50a1bdc451704285482c79caed0982a5a7f5a
Diffstat (limited to 'src/com/android/launcher2/Workspace.java')
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index c10bd1aea..11528e4b7 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -1539,14 +1539,6 @@ public class Workspace extends SmoothPagedView cl.setFastAlpha(a * mOldAlphas[i] + b * mNewAlphas[i]); cl.setFastRotationY(a * mOldRotationYs[i] + b * mNewRotationYs[i]); } - - // Shrink the hotset the same amount we are shrinking the screens - if (shrinkState == State.SPRING_LOADED && mLauncher.getHotseat() != null) { - View hotseat = mLauncher.getHotseat().getLayout(); - hotseat.fastInvalidate(); - hotseat.setFastScaleX(a * mOldScaleXs[0] + b * mNewScaleXs[0]); - hotseat.setFastScaleY(a * mOldScaleXs[0] + b * mNewScaleXs[0]); - } } }); mAnimator.playTogether(animWithInterpolator); @@ -1820,6 +1812,14 @@ public class Workspace extends SmoothPagedView mUnshrinkAnimationListener.onAnimationEnd(null); } } + + // Unshrink the hotset the same amount we are unshrinking the screens + if (mLauncher.getHotseat() != null) { + View hotseat = mLauncher.getHotseat().getLayout(); + hotseat.setScaleX(finalScaleFactor); + hotseat.setScaleY(finalScaleFactor); + } + Display display = mLauncher.getWindowManager().getDefaultDisplay(); boolean isLandscape = display.getWidth() > display.getHeight(); // on phones, don't scroll the wallpaper horizontally or vertically when switching @@ -1888,14 +1888,6 @@ public class Workspace extends SmoothPagedView b * mNewBackgroundAlphaMultipliers[i]); cl.setFastAlpha(a * mOldAlphas[i] + b * mNewAlphas[i]); } - - // Unshrink the hotset the same amount we are unshrinking the screens - if (mLauncher.getHotseat() != null) { - View hotseat = mLauncher.getHotseat().getLayout(); - hotseat.fastInvalidate(); - hotseat.setFastScaleX(a * mOldScaleXs[0] + b * mNewScaleXs[0]); - hotseat.setFastScaleY(a * mOldScaleXs[0] + b * mNewScaleXs[0]); - } } }); @@ -2333,8 +2325,7 @@ public class Workspace extends SmoothPagedView mDragViewVisualCenter[1], spanX, spanY, dropTargetLayout, mTargetCell); // If the item being dropped is a shortcut and the nearest drop // cell also contains a shortcut, then create a folder with the two shortcuts. - boolean dropInscrollArea = hasMovedLayouts && !hasMovedIntoHotseat; - if (!dropInscrollArea && createUserFolderIfNecessary(cell, container, + if (!mInScrollArea && createUserFolderIfNecessary(cell, container, dropTargetLayout, mTargetCell, false, d.dragView, null)) { return; } @@ -2349,7 +2340,7 @@ public class Workspace extends SmoothPagedView (int) mDragViewVisualCenter[1], mDragInfo.spanX, mDragInfo.spanY, cell, dropTargetLayout, mTargetCell); - if (dropInscrollArea && mState != State.SPRING_LOADED) { + if (mInScrollArea && !hasMovedIntoHotseat && mState != State.SPRING_LOADED) { snapScreen = screen; snapToPage(screen); } @@ -3304,7 +3295,16 @@ public class Workspace extends SmoothPagedView } @Override - public void onEnterScrollArea(int direction) { + public void 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; + } + } + if (!isSmall() && !mIsSwitchingState) { mInScrollArea = true; |