summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherStateTransitionAnimation.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/LauncherStateTransitionAnimation.java')
-rw-r--r--src/com/android/launcher3/LauncherStateTransitionAnimation.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
index a0fa61d08..4c97727c1 100644
--- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java
+++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
@@ -24,6 +24,7 @@ import android.animation.PropertyValuesHolder;
import android.animation.TimeInterpolator;
import android.annotation.SuppressLint;
import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
@@ -287,6 +288,14 @@ public class LauncherStateTransitionAnimation {
// Setup the animation for the content view
contentView.setVisibility(View.VISIBLE);
+ /*
+ * Because the contentView and revealView overlap, if their backgrounds have alpha,
+ * it will blend and cause a flicker. So get the current alpha of the contentView (for
+ * later) and set to 0. When the animation is done, reset the alpha.
+ */
+ final Drawable contentBackground = contentView.getBackground();
+ final int alpha = contentBackground.getAlpha();
+ contentBackground.setAlpha(0);
contentView.setAlpha(0f);
contentView.setTranslationY(revealViewToYDrift);
layerViews.put(contentView, BUILD_AND_SET_LAYER);
@@ -327,6 +336,7 @@ public class LauncherStateTransitionAnimation {
// Hide the reveal view
revealView.setVisibility(View.INVISIBLE);
+ contentBackground.setAlpha(alpha);
// Disable all necessary layers
for (View v : layerViews.keySet()) {
@@ -521,6 +531,9 @@ public class LauncherStateTransitionAnimation {
animation.play(workspaceAnim);
}
+ final Drawable contentBackground = contentView.getBackground();
+ final int alpha = contentBackground.getAlpha();
+
// hideAppsCustomizeHelper is called in some cases when it is already hidden
// don't perform all these no-op animations. In particularly, this was causing
// the all-apps button to pop in and out.
@@ -528,6 +541,7 @@ public class LauncherStateTransitionAnimation {
int width = revealView.getMeasuredWidth();
int height = revealView.getMeasuredHeight();
float revealRadius = (float) Math.hypot(width / 2, height / 2);
+ contentBackground.setAlpha(0);
revealView.setVisibility(View.VISIBLE);
revealView.setAlpha(1f);
revealView.setTranslationY(0);
@@ -650,6 +664,7 @@ public class LauncherStateTransitionAnimation {
contentView.setTranslationX(0);
contentView.setTranslationY(0);
contentView.setAlpha(1);
+ contentBackground.setAlpha(alpha);
}
if (overlaySearchBarView != null) {
overlaySearchBarView.setAlpha(1f);