Merge "Add slow fade-in to notification shelf icon to prevent overlapping icons in the shelf." into sc-dev am: afa8c993cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14882394 Change-Id: Ia9b936e0fc5999b7ef5ae2a25055a0a296cc67dd
This commit is contained in:
@@ -26,6 +26,8 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.view.accessibility.AccessibilityNodeInfo;
|
import android.view.accessibility.AccessibilityNodeInfo;
|
||||||
|
import android.view.animation.Interpolator;
|
||||||
|
import android.view.animation.PathInterpolator;
|
||||||
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.systemui.R;
|
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 int TAG_CONTINUOUS_CLIPPING = R.id.continuous_clipping_tag;
|
||||||
private static final String TAG = "NotificationShelf";
|
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 NotificationIconContainer mShelfIcons;
|
||||||
private int[] mTmp = new int[2];
|
private int[] mTmp = new int[2];
|
||||||
private boolean mHideBackground;
|
private boolean mHideBackground;
|
||||||
@@ -659,7 +666,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
|
|||||||
if (iconState == null) {
|
if (iconState == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
iconState.alpha = transitionAmount;
|
iconState.alpha = ICON_ALPHA_INTERPOLATOR.getInterpolation(transitionAmount);
|
||||||
boolean isAppearing = row.isDrawingAppearAnimation() && !row.isInShelf();
|
boolean isAppearing = row.isDrawingAppearAnimation() && !row.isInShelf();
|
||||||
iconState.hidden = isAppearing
|
iconState.hidden = isAppearing
|
||||||
|| (view instanceof ExpandableNotificationRow
|
|| (view instanceof ExpandableNotificationRow
|
||||||
|
|||||||
Reference in New Issue
Block a user