summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-05-29 12:28:06 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-29 12:28:06 -0700
commitce191808511599fc55f95b8a75a10cbba4b1b2ae (patch)
tree3871c88cc60b43151d15ae794c3c6e560d164263
parent9c1b180338a5961ece11744e5808a17dd82ef605 (diff)
parent4c69ebb10833b1f84d80e1ba83f3ffa7fdc4e7ab (diff)
downloadandroid_packages_apps_Trebuchet-ce191808511599fc55f95b8a75a10cbba4b1b2ae.tar.gz
android_packages_apps_Trebuchet-ce191808511599fc55f95b8a75a10cbba4b1b2ae.tar.bz2
android_packages_apps_Trebuchet-ce191808511599fc55f95b8a75a10cbba4b1b2ae.zip
am 4c69ebb1: Merge "Don\'t scale shortcut icons during install animation" into jb-dev
* commit '4c69ebb10833b1f84d80e1ba83f3ffa7fdc4e7ab': Don't scale shortcut icons during install animation
-rw-r--r--src/com/android/launcher2/Workspace.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 2dd027cd6..e90673398 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -3139,7 +3139,7 @@ public class Workspace extends SmoothPagedView
private void getFinalPositionForDropAnimation(int[] loc, float[] scaleXY,
DragView dragView, CellLayout layout, ItemInfo info, int[] targetCell,
- boolean external) {
+ boolean external, boolean scale) {
// Now we animate the dragView, (ie. the widget or shortcut preview) into its final
// location and size on the home screen.
int spanX = info.spanX;
@@ -3153,8 +3153,16 @@ public class Workspace extends SmoothPagedView
float cellLayoutScale =
mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(layout, loc);
resetTransitionTransform(layout);
- float dragViewScaleX = (1.0f * r.width()) / dragView.getMeasuredWidth();
- float dragViewScaleY = (1.0f * r.height()) / dragView.getMeasuredHeight();
+
+ float dragViewScaleX;
+ float dragViewScaleY;
+ if (scale) {
+ dragViewScaleX = (1.0f * r.width()) / dragView.getMeasuredWidth();
+ dragViewScaleY = (1.0f * r.height()) / dragView.getMeasuredHeight();
+ } else {
+ dragViewScaleX = 1f;
+ dragViewScaleY = 1f;
+ }
// The animation will scale the dragView about its center, so we need to center about
// the final location.
@@ -3173,8 +3181,9 @@ public class Workspace extends SmoothPagedView
int[] finalPos = new int[2];
float scaleXY[] = new float[2];
+ boolean scalePreview = !(info instanceof PendingAddShortcutInfo);
getFinalPositionForDropAnimation(finalPos, scaleXY, dragView, cellLayout, info, mTargetCell,
- external);
+ external, scalePreview);
Resources res = mLauncher.getResources();
int duration = res.getInteger(R.integer.config_dropAnimMaxDuration) - 200;