summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff DeCew <jeffdq@google.com> 2021-06-09 02:38:51 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-06-09 02:38:51 +0000
commitafa8c993cdd338d948647cef7289690d5575ef1f (patch)
tree3352b2154c699383fc1c978b8c11be234d605826
parent628002c70cf3199b13a4fcecd87bc322fbde5847 (diff)
parent65e826dbc233dc60ee79368580eca3c5fcbfc5f8 (diff)
Merge "Add slow fade-in to notification shelf icon to prevent overlapping icons in the shelf." into sc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index f7b3a350ddf4..085a076c5c55 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -26,6 +26,8 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.animation.Interpolator;
+import android.view.animation.PathInterpolator;
import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.R;
@@ -53,6 +55,11 @@ public class NotificationShelf extends ActivatableNotificationView implements
private static final int TAG_CONTINUOUS_CLIPPING = R.id.continuous_clipping_tag;
private static final String TAG = "NotificationShelf";
+ // More extreme version of SLOW_OUT_LINEAR_IN which keeps the icon nearly invisible until after
+ // the next icon has translated out of the way, to avoid overlapping.
+ private static final Interpolator ICON_ALPHA_INTERPOLATOR =
+ new PathInterpolator(0.6f, 0f, 0.6f, 0f);
+
private NotificationIconContainer mShelfIcons;
private int[] mTmp = new int[2];
private boolean mHideBackground;
@@ -659,7 +666,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
if (iconState == null) {
return;
}
- iconState.alpha = transitionAmount;
+ iconState.alpha = ICON_ALPHA_INTERPOLATOR.getInterpolation(transitionAmount);
boolean isAppearing = row.isDrawingAppearAnimation() && !row.isInShelf();
iconState.hidden = isAppearing
|| (view instanceof ExpandableNotificationRow