summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/DragLayer.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-08-01 20:28:08 -0700
committerAdam Cohen <adamcohen@google.com>2011-08-01 20:30:29 -0700
commited51cc9a12c50d12e7d30ed209a49f1a40858043 (patch)
tree6c16f3f03335067366c1c2584326bc5d3fc007c9 /src/com/android/launcher2/DragLayer.java
parent8182e5bc3c2d1a0140df345599b89369d457bb4a (diff)
downloadandroid_packages_apps_Trebuchet-ed51cc9a12c50d12e7d30ed209a49f1a40858043.tar.gz
android_packages_apps_Trebuchet-ed51cc9a12c50d12e7d30ed209a49f1a40858043.tar.bz2
android_packages_apps_Trebuchet-ed51cc9a12c50d12e7d30ed209a49f1a40858043.zip
Fixing animation when dropping to adjacent screen, issue 4990545
Change-Id: I575e9257a211ed72a6aefb119bccf1154d2a0c9f
Diffstat (limited to 'src/com/android/launcher2/DragLayer.java')
-rw-r--r--src/com/android/launcher2/DragLayer.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/android/launcher2/DragLayer.java
index 809a65138..7fbde5471 100644
--- a/src/com/android/launcher2/DragLayer.java
+++ b/src/com/android/launcher2/DragLayer.java
@@ -342,11 +342,16 @@ public class DragLayer extends FrameLayout {
final int fromY = r.top;
animateViewIntoPosition(dragView, fromX, fromY, pos[0], pos[1], scale,
- onFinishRunnable, true);
+ onFinishRunnable, true, -1);
}
public void animateViewIntoPosition(DragView dragView, final View child,
final Runnable onFinishAnimationRunnable) {
+ animateViewIntoPosition(dragView, child, -1, onFinishAnimationRunnable);
+ }
+
+ public void animateViewIntoPosition(DragView dragView, final View child, int duration,
+ final Runnable onFinishAnimationRunnable) {
((CellLayoutChildren) child.getParent()).measureChild(child);
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
@@ -396,16 +401,17 @@ public class DragLayer extends FrameLayout {
oa.start();
}
};
- animateViewIntoPosition(dragView, fromX, fromY, toX, toY, scale, onCompleteRunnable, true);
+ animateViewIntoPosition(dragView, fromX, fromY, toX, toY, scale,
+ onCompleteRunnable, true, duration);
}
private void animateViewIntoPosition(final View view, final int fromX, final int fromY,
final int toX, final int toY, float finalScale, Runnable onCompleteRunnable,
- boolean fadeOut) {
+ boolean fadeOut, int duration) {
Rect from = new Rect(fromX, fromY, fromX +
view.getMeasuredWidth(), fromY + view.getMeasuredHeight());
Rect to = new Rect(toX, toY, toX + view.getMeasuredWidth(), toY + view.getMeasuredHeight());
- animateView(view, from, to, 1f, finalScale, -1, null, null, onCompleteRunnable, true);
+ animateView(view, from, to, 1f, finalScale, duration, null, null, onCompleteRunnable, true);
}
/**