summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/allapps/AllAppsTransitionController.java
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2016-07-18 16:35:10 -0700
committerHyunyoung Song <hyunyoungs@google.com>2016-07-18 16:35:10 -0700
commite4be3b3fdb29c6adb51ee05730c1693ba8d04587 (patch)
tree3155f8158cbe64aceb0be761b7ee9a6c46f22c4e /src/com/android/launcher3/allapps/AllAppsTransitionController.java
parent77ba6b9cad542a78910b6d7c638a1254b31d79ab (diff)
downloadandroid_packages_apps_Trebuchet-e4be3b3fdb29c6adb51ee05730c1693ba8d04587.tar.gz
android_packages_apps_Trebuchet-e4be3b3fdb29c6adb51ee05730c1693ba8d04587.tar.bz2
android_packages_apps_Trebuchet-e4be3b3fdb29c6adb51ee05730c1693ba8d04587.zip
Support gray hotseat background in all apps transition
b/30201515 Change-Id: Ie4b8442ac804b4df94e9673608129e6ffc0c3360
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsTransitionController.java')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsTransitionController.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index f6e028b59..85af60eb8 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -3,7 +3,9 @@ package com.android.launcher3.allapps;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
+import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
+import android.graphics.Color;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
@@ -43,14 +45,14 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
private final Interpolator mDecelInterpolator = new DecelerateInterpolator(1f);
private static final float ANIMATION_DURATION = 1200;
- public static final float ALL_APPS_FINAL_ALPHA = .9f;
private static final float PARALLAX_COEFFICIENT = .125f;
private AllAppsContainerView mAppsView;
+ private int mAllAppsBackgroundColor;
private Workspace mWorkspace;
private Hotseat mHotseat;
- private float mHotseatBackgroundAlpha;
+ private int mHotseatBackgroundColor;
private ObjectAnimator mCaretAnimator;
private final long mCaretAnimationDuration;
@@ -60,6 +62,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
private final Launcher mLauncher;
private final VerticalPullDetector mDetector;
+ private final ArgbEvaluator mEvaluator;
// Animation in this class is controlled by a single variable {@link mShiftCurrent}.
// Visually, it represents top y coordinate of the all apps container. Using the
@@ -95,6 +98,8 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
R.integer.config_caretAnimationDuration);
mCaretInterpolator = AnimationUtils.loadInterpolator(launcher,
R.interpolator.caret_animation_interpolator);
+ mEvaluator = new ArgbEvaluator();
+ mAllAppsBackgroundColor = launcher.getColor(R.color.all_apps_container_color);
}
@Override
@@ -248,17 +253,15 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
mStatusBarHeight = mLauncher.getDragLayer().getInsets().top;
mHotseat.setVisibility(View.VISIBLE);
mHotseat.bringToFront();
-
if (!mLauncher.isAllAppsVisible()) {
mLauncher.tryAndUpdatePredictedApps();
-
- mHotseatBackgroundAlpha = mHotseat.getBackgroundDrawableAlpha() / 255f;
+ mHotseatBackgroundColor = mHotseat.getBackgroundDrawableColor();
mHotseat.setBackgroundTransparent(true /* transparent */);
mAppsView.setVisibility(View.VISIBLE);
mAppsView.getContentView().setVisibility(View.VISIBLE);
mAppsView.getContentView().setBackground(null);
mAppsView.getRevealView().setVisibility(View.VISIBLE);
- mAppsView.getRevealView().setAlpha(mHotseatBackgroundAlpha);
+ mAppsView.setRevealDrawableColor(mHotseatBackgroundColor);
}
} else {
setProgress(mShiftCurrent);
@@ -297,8 +300,9 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
float alpha = calcAlphaAllApps(progress);
float workspaceHotseatAlpha = 1 - alpha;
- mAppsView.getRevealView().setAlpha(Math.min(ALL_APPS_FINAL_ALPHA, Math.max(mHotseatBackgroundAlpha,
- mDecelInterpolator.getInterpolation(alpha))));
+ int color = (Integer) mEvaluator.evaluate(mDecelInterpolator.getInterpolation(alpha),
+ mHotseatBackgroundColor, mAllAppsBackgroundColor);
+ mAppsView.setRevealDrawableColor(color);
mAppsView.getContentView().setAlpha(alpha);
mAppsView.setTranslationY(progress);
mWorkspace.setWorkspaceYTranslationAndAlpha(