summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/FolderIcon.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-07-08 15:34:52 -0700
committerWinson Chung <winsonc@google.com>2011-07-11 11:38:24 -0700
commit557d6ed50cc6560163440aa134870ef0bb11415b (patch)
tree9abf7ad514d60f696d902a97f937cc356dd47ee6 /src/com/android/launcher2/FolderIcon.java
parenta71cb1778dc0c7e76132d21296c58da777183e26 (diff)
downloadandroid_packages_apps_Trebuchet-557d6ed50cc6560163440aa134870ef0bb11415b.tar.gz
android_packages_apps_Trebuchet-557d6ed50cc6560163440aa134870ef0bb11415b.tar.bz2
android_packages_apps_Trebuchet-557d6ed50cc6560163440aa134870ef0bb11415b.zip
Fixing issues with spring loaded adding.
- Delaying until items are added - Showing bg when going into spring loaded mode - Fixing regression where dropping widgets on full page would not trigger a notification - Fixing regression on tablet where pages were no longer being rotated or shown Change-Id: Iadc0c406f0c065c5029addea1abfee395eed81b9
Diffstat (limited to 'src/com/android/launcher2/FolderIcon.java')
-rw-r--r--src/com/android/launcher2/FolderIcon.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java
index 4978e98e9..283c2954f 100644
--- a/src/com/android/launcher2/FolderIcon.java
+++ b/src/com/android/launcher2/FolderIcon.java
@@ -286,12 +286,13 @@ public class FolderIcon extends LinearLayout implements FolderListener {
}
public void performCreateAnimation(final ShortcutInfo destInfo, final View destView,
- final ShortcutInfo srcInfo, final View srcView, Rect dstRect) {
+ final ShortcutInfo srcInfo, final View srcView, Rect dstRect,
+ Runnable postAnimationRunnable) {
Drawable animateDrawable = ((TextView) destView).getCompoundDrawables()[1];
computePreviewDrawingParams(animateDrawable.getIntrinsicWidth(), destView.getMeasuredWidth());
// This will animate the dragView (srcView) into the new folder
- onDrop(srcInfo, srcView, dstRect, 1);
+ onDrop(srcInfo, srcView, dstRect, 1, postAnimationRunnable);
// This will animate the first item from it's position as an icon into its
// position as the first item in the preview
@@ -309,7 +310,8 @@ public class FolderIcon extends LinearLayout implements FolderListener {
mFolderRingAnimator.animateToNaturalState();
}
- private void onDrop(final ShortcutInfo item, View animateView, Rect finalRect, int index) {
+ private void onDrop(final ShortcutInfo item, View animateView, Rect finalRect, int index,
+ Runnable postAnimationRunnable) {
item.cellX = -1;
item.cellY = -1;
DragLayer dragLayer = mLauncher.getDragLayer();
@@ -332,7 +334,8 @@ public class FolderIcon extends LinearLayout implements FolderListener {
float finalAlpha = index < NUM_ITEMS_IN_PREVIEW ? 0.5f : 0f;
dragLayer.animateView(animateView, from, to, finalAlpha, scale, DROP_IN_ANIMATION_DURATION,
- new DecelerateInterpolator(2), new AccelerateInterpolator(2), null, false);
+ new DecelerateInterpolator(2), new AccelerateInterpolator(2), postAnimationRunnable,
+ false);
postDelayed(new Runnable() {
public void run() {
addItem(item);
@@ -348,7 +351,7 @@ public class FolderIcon extends LinearLayout implements FolderListener {
} else {
item = (ShortcutInfo) d.dragInfo;
}
- onDrop(item, d.dragView, null, mInfo.contents.size());
+ onDrop(item, d.dragView, null, mInfo.contents.size(), d.postAnimationRunnable);
}
public DropTarget getDropTargetDelegate(DragObject d) {