diff options
author | Adam Cohen <adamcohen@google.com> | 2012-02-28 14:24:59 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-02-28 14:24:59 -0800 |
commit | 483e01b0ae587c891d7ead0bea5a860833f5a1fd (patch) | |
tree | 489134486d8bf8c12220da97df7903c09e5990f0 | |
parent | a595770463c83a0504cc528b5657d4bf04a4b9e4 (diff) | |
parent | f0777b9d7a8f4befa22a36f227a052616152108f (diff) | |
download | android_packages_apps_Trebuchet-483e01b0ae587c891d7ead0bea5a860833f5a1fd.tar.gz android_packages_apps_Trebuchet-483e01b0ae587c891d7ead0bea5a860833f5a1fd.tar.bz2 android_packages_apps_Trebuchet-483e01b0ae587c891d7ead0bea5a860833f5a1fd.zip |
Merge "Fixing drag and drop framerate regression in workspace"
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index e461a85bc..089301730 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -369,10 +369,14 @@ public class Workspace extends SmoothPagedView mLauncher.lockScreenOrientationOnLargeUI(); // Fade out the workspace slightly to highlight the currently dragging item - animate().alpha(mDragFadeOutAlpha) - .setInterpolator(new AccelerateInterpolator(1.5f)) - .setDuration(mDragFadeOutDuration) - .start(); + int count = getChildCount(); + for (int i = 0; i < count; i++) { + CellLayout cl = (CellLayout) getPageAt(i); + cl.getChildrenLayout().animate().alpha(mDragFadeOutAlpha) + .setInterpolator(new AccelerateInterpolator(1.5f)) + .setDuration(mDragFadeOutDuration) + .start(); + } } public void onDragEnd() { @@ -381,10 +385,14 @@ public class Workspace extends SmoothPagedView mLauncher.unlockScreenOrientationOnLargeUI(); // Fade the workspace back in after we have completed dragging - animate().alpha(1f) - .setInterpolator(new DecelerateInterpolator(1.5f)) - .setDuration(mDragFadeOutDuration) - .start(); + int count = getChildCount(); + for (int i = 0; i < count; i++) { + CellLayout cl = (CellLayout) getPageAt(i); + cl.getChildrenLayout().animate().alpha(1f) + .setInterpolator(new DecelerateInterpolator(1.5f)) + .setDuration(mDragFadeOutDuration) + .start(); + } } /** @@ -2026,7 +2034,8 @@ public class Workspace extends SmoothPagedView minSpanY = ((PendingAddWidgetInfo) d.dragInfo).minSpanY; } mTargetCell = findNearestArea((int) mDragViewVisualCenter[0], - (int) mDragViewVisualCenter[1], minSpanX, minSpanY, mDragTargetLayout, mTargetCell); + (int) mDragViewVisualCenter[1], minSpanX, minSpanY, mDragTargetLayout, + mTargetCell); if (willCreateUserFolder((ItemInfo) d.dragInfo, mDragTargetLayout, mTargetCell, true)) { return true; } @@ -2507,7 +2516,8 @@ public class Workspace extends SmoothPagedView final PendingAddWidgetInfo createInfo = new PendingAddWidgetInfo(widgetInfo, mimeType, data); mLauncher.addAppWidgetFromDrop(createInfo, - LauncherSettings.Favorites.CONTAINER_DESKTOP, mCurrentPage, null, null, pos); + LauncherSettings.Favorites.CONTAINER_DESKTOP, mCurrentPage, + null, null, pos); } else { // Show the widget picker dialog if there is more than one widget // that can handle this data type |