diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2016-09-30 20:53:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-09-30 20:53:21 +0000 |
commit | 37ecabc88ec4be34744d312dbf0b4b1a2977e119 (patch) | |
tree | c84e97ef9fae8999cbf616d0204a4338b7a6e0b8 /src | |
parent | f7f41bd4fa149f1c876e2de05bfb532aa1b8c3f9 (diff) | |
parent | 81a56f9acc8a6db1b78088e6aca8e343a49f8952 (diff) | |
download | android_packages_apps_Trebuchet-37ecabc88ec4be34744d312dbf0b4b1a2977e119.tar.gz android_packages_apps_Trebuchet-37ecabc88ec4be34744d312dbf0b4b1a2977e119.tar.bz2 android_packages_apps_Trebuchet-37ecabc88ec4be34744d312dbf0b4b1a2977e119.zip |
Merge "Agressively change the color of the the all apps background during pull up b/30502942" into ub-launcher3-calgary-polish
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsTransitionController.java | 12 |
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 8bbb29b4b..b129bb09d 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(); @@ -291,12 +295,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); |