summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Folder.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2012-08-16 17:55:58 -0700
committerAdam Cohen <adamcohen@google.com>2012-08-20 21:49:43 -0700
commit307fe23f125cbbd5512ad8d4660025f2ab68f30b (patch)
tree0bb74d508939237e628e96fade69d3b5ccf3c07b /src/com/android/launcher2/Folder.java
parent5c768e2fac95f8b8b2d6b5c523d7e1cdc968e395 (diff)
downloadandroid_packages_apps_Trebuchet-307fe23f125cbbd5512ad8d4660025f2ab68f30b.tar.gz
android_packages_apps_Trebuchet-307fe23f125cbbd5512ad8d4660025f2ab68f30b.tar.bz2
android_packages_apps_Trebuchet-307fe23f125cbbd5512ad8d4660025f2ab68f30b.zip
Adding the ability to scale the hotseat or items in the hotseat
--> A bunch of stuff breaks when scaling the hotseat. More specifically, drag and drop animations between hotseat and workspace, scaling on pick up, folder animations, determination of item placement. This CL fixes these issues so that the hotseat or hotseat items are ready to be scaled. --> For now, using 90% scale factor for 7-inch+ UIs Change-Id: Iac098409347e76139e4d726a071397b56ac684d2
Diffstat (limited to 'src/com/android/launcher2/Folder.java')
-rw-r--r--src/com/android/launcher2/Folder.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 8aa6e2f62..5feac2f4b 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -805,10 +805,10 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
+ mFolderNameHeight;
DragLayer parent = (DragLayer) mLauncher.findViewById(R.id.drag_layer);
- parent.getDescendantRectRelativeToSelf(mFolderIcon, mTempRect);
+ float scale = parent.getDescendantRectRelativeToSelf(mFolderIcon, mTempRect);
- int centerX = mTempRect.centerX();
- int centerY = mTempRect.centerY();
+ int centerX = (int) (mTempRect.left + mTempRect.width() * scale / 2);
+ int centerY = (int) (mTempRect.top + mTempRect.height() * scale / 2);
int centeredLeft = centerX - width / 2;
int centeredTop = centerY - height / 2;