summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2016-09-30 19:57:16 (GMT)
committerHyunyoung Song <hyunyoungs@google.com>2016-09-30 19:57:16 (GMT)
commit81a56f9acc8a6db1b78088e6aca8e343a49f8952 (patch)
tree438f037998b5bf6b89151371f4aa8cbac0df7615
parentffad962092e2b42e336918c2f1e8f5ec48cc08a9 (diff)
downloadandroid_packages_apps_Trebuchet-81a56f9acc8a6db1b78088e6aca8e343a49f8952.zip
android_packages_apps_Trebuchet-81a56f9acc8a6db1b78088e6aca8e343a49f8952.tar.gz
android_packages_apps_Trebuchet-81a56f9acc8a6db1b78088e6aca8e343a49f8952.tar.bz2
Agressively change the color of the the all apps background during pull up
b/30502942 Change-Id: Iea072d95ed4f62907b164b2c4ee75ad737eccb7a
-rw-r--r--src/com/android/launcher3/allapps/AllAppsTransitionController.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index 1719b05..9f1e9e8 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -6,12 +6,15 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
+import android.graphics.Color;
import android.support.v4.content.ContextCompat;
+import android.support.v4.graphics.ColorUtils;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
+import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import com.android.launcher3.DeviceProfile;
@@ -41,6 +44,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
private static final boolean DBG = false;
private final Interpolator mAccelInterpolator = new AccelerateInterpolator(2f);
+ private final Interpolator mDecelInterpolator = new DecelerateInterpolator(3f);
private final Interpolator mFastOutSlowInInterpolator = new FastOutSlowInInterpolator();
private final ScrollInterpolator mScrollInterpolator = new ScrollInterpolator();
@@ -305,12 +309,14 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
float workspaceHotseatAlpha = Utilities.boundToRange(progress, 0f, 1f);
float alpha = 1 - workspaceHotseatAlpha;
-
float interpolation = mAccelInterpolator.getInterpolation(workspaceHotseatAlpha);
- int color = (Integer) mEvaluator.evaluate(alpha,
+ int color = (Integer) mEvaluator.evaluate(mDecelInterpolator.getInterpolation(alpha),
mHotseatBackgroundColor, mAllAppsBackgroundColor);
- mAppsView.setRevealDrawableColor(color);
+ int bgAlpha = Color.alpha((int) mEvaluator.evaluate(alpha,
+ mHotseatBackgroundColor, mAllAppsBackgroundColor));
+
+ mAppsView.setRevealDrawableColor(ColorUtils.setAlphaComponent(color, bgAlpha));
mAppsView.getContentView().setAlpha(alpha);
mAppsView.setTranslationY(shiftCurrent);