Adding fade when dragging items outside of the customization tray.

Change-Id: Ie8dad00bc0278053707f81d948528929e6bb6f5c
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java
index d91daf9..e4049eb 100644
--- a/src/com/android/launcher2/PagedViewIcon.java
+++ b/src/com/android/launcher2/PagedViewIcon.java
@@ -20,6 +20,7 @@
 import android.content.Context;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
@@ -57,9 +58,9 @@
 
     private boolean mIsChecked;
     private ObjectAnimator mCheckedAlphaAnimator;
-    private final static float sCheckedAlpha = 0.4f;
-    private final static int sCheckedFadeInDuration = 150;
-    private final static int sCheckedFadeOutDuration = 200;
+    private float mCheckedAlpha = 1.0f;
+    private int mCheckedFadeInDuration;
+    private int mCheckedFadeOutDuration;
 
     // Highlight colors
     private int mHoloBlurColor;
@@ -116,6 +117,15 @@
             sHolographicOutlineHelper = new HolographicOutlineHelper();
         }
 
+        // Set up fade in/out constants
+        final Resources r = context.getResources();
+        final int alpha = r.getInteger(R.integer.icon_allAppsCustomizeFadeAlpha);
+        if (alpha > 0) {
+            mCheckedAlpha = r.getInteger(R.integer.icon_allAppsCustomizeFadeAlpha) / 256.0f;
+            mCheckedFadeInDuration = r.getInteger(R.integer.icon_allAppsCustomizeFadeInTime);
+            mCheckedFadeOutDuration = r.getInteger(R.integer.icon_allAppsCustomizeFadeOutTime);
+        }
+
         setFocusable(true);
         setBackgroundDrawable(null);
     }
@@ -230,11 +240,11 @@
             float alpha;
             int duration;
             if (mIsChecked) {
-                alpha = sCheckedAlpha;
-                duration = sCheckedFadeInDuration;
+                alpha = mCheckedAlpha;
+                duration = mCheckedFadeInDuration;
             } else {
                 alpha = 1.0f;
-                duration = sCheckedFadeOutDuration;
+                duration = mCheckedFadeOutDuration;
             }
 
             // Initialize the animator