summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/CustomizePagedView.java
diff options
context:
space:
mode:
authorPatrick Dubroy <dubroy@google.com>2010-12-19 22:02:04 -0800
committerPatrick Dubroy <dubroy@google.com>2010-12-20 11:24:54 -0800
commit047379aa61b4719ab38ce595f23732e8f3b1b8e1 (patch)
treeccdef847b69a330ddfbb4c4fd776694ef5859e06 /src/com/android/launcher2/CustomizePagedView.java
parent6920c2ce340354286c152cefaf75445314194778 (diff)
downloadandroid_packages_apps_Trebuchet-047379aa61b4719ab38ce595f23732e8f3b1b8e1.tar.gz
android_packages_apps_Trebuchet-047379aa61b4719ab38ce595f23732e8f3b1b8e1.tar.bz2
android_packages_apps_Trebuchet-047379aa61b4719ab38ce595f23732e8f3b1b8e1.zip
Don't animate tapped item if the target screen is full
Diffstat (limited to 'src/com/android/launcher2/CustomizePagedView.java')
-rw-r--r--src/com/android/launcher2/CustomizePagedView.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java
index 567292172..4eb852c60 100644
--- a/src/com/android/launcher2/CustomizePagedView.java
+++ b/src/com/android/launcher2/CustomizePagedView.java
@@ -21,7 +21,7 @@ import com.android.launcher.R;
import org.xmlpull.v1.XmlPullParser;
import android.animation.Animator;
-import android.animation.Animator.AnimatorListener;
+import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.TimeInterpolator;
@@ -40,7 +40,6 @@ import android.content.res.XmlResourceParser;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
-import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
@@ -378,11 +377,7 @@ public class CustomizePagedView extends PagedViewWithDraggableItems
posAnim.setInterpolator(mQuintEaseOutInterpolator);
posAnim.setDuration(ANIMATION_DURATION);
- posAnim.addListener(new AnimatorListener() {
- public void onAnimationCancel(Animator animation) {}
- public void onAnimationRepeat(Animator animation) {}
- public void onAnimationStart(Animator animation) {}
-
+ posAnim.addListener(new AnimatorListenerAdapter() {
public void onAnimationEnd(Animator animation) {
dragLayer.removeView(dragCopy);
mLauncher.addExternalItemToScreen(info, layout);
@@ -443,7 +438,12 @@ public class CustomizePagedView extends PagedViewWithDraggableItems
animateClickFeedback(v, new Runnable() {
@Override
public void run() {
- animateItemOntoScreen(dragView, cl, itemInfo);
+ cl.calculateSpans(itemInfo);
+ if (cl.findCellForSpan(null, itemInfo.spanX, itemInfo.spanY)) {
+ animateItemOntoScreen(dragView, cl, itemInfo);
+ } else {
+ mLauncher.showOutOfSpaceMessage();
+ }
}
});
return;