diff options
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsTransitionController.java')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsTransitionController.java | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index 1719b0594..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(); @@ -86,8 +90,6 @@ public class AllAppsTransitionController implements TouchController, VerticalPul private AnimatorSet mCurrentAnimation; private boolean mNoIntercept; - private boolean mLightStatusBar; - // Used in discovery bounce animation to provide the transition without workspace changing. private boolean mIsTranslateWithoutWorkspace = false; private AnimatorSet mDiscoBounceAnimation; @@ -273,26 +275,14 @@ public class AllAppsTransitionController implements TouchController, VerticalPul } private void updateLightStatusBar(float shift) { - boolean enable = shift <= mStatusBarHeight / 2; // Do not modify status bar on landscape as all apps is not full bleed. if (mLauncher.getDeviceProfile().isVerticalBarLayout()) { return; } - // Already set correctly - if (mLightStatusBar == enable) { - return; - } - int systemUiFlags = mLauncher.getWindow().getDecorView().getSystemUiVisibility(); - if (enable) { - mLauncher.getWindow().getDecorView().setSystemUiVisibility(systemUiFlags - | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - - } else { - mLauncher.getWindow().getDecorView().setSystemUiVisibility(systemUiFlags - & ~(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)); - - } - mLightStatusBar = enable; + // Use a light status bar (dark icons) if all apps is behind at least half of the status + // bar. If the status bar is already light due to wallpaper extraction, keep it that way. + boolean forceLight = shift <= mStatusBarHeight / 2; + mLauncher.activateLightStatusBar(forceLight); } /** @@ -305,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); |