From: Selim Cinek Date: Tue, 9 May 2017 02:45:40 +0000 (-0700) Subject: Forcing no animations to be played if swiping fast X-Git-Tag: android-x86-9.0-r1~1044^2~904^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=44d81a671a1e2f96e32a3c2e8840145b7a17d8c3;p=android-x86%2Fframeworks-base.git Forcing no animations to be played if swiping fast To avoid animations when expanding, we're now also forcing no icon animations to play at all. Test: add min prio notifications, expand quickly, observe no animations Change-Id: I49888c351b1ed0a61ad54a548943afdac1bae6d2 Fixes: 37293033 --- diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java index b134fc542776..f41670e0bdce 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java @@ -346,7 +346,8 @@ public class NotificationShelf extends ActivatableNotificationView implements } float clampedAmount = iconTransitionAmount > 0.5f ? 1.0f : 0.0f; if (clampedAmount == fullTransitionAmount) { - iconState.useFullTransitionAmount = scrollingFast || expandingAnimated + iconState.noAnimations = scrollingFast || expandingAnimated; + iconState.useFullTransitionAmount = iconState.noAnimations || (!ICON_ANMATIONS_WHILE_SCROLLING && fullTransitionAmount == 0.0f && scrolling); iconState.useLinearTransitionAmount = !ICON_ANMATIONS_WHILE_SCROLLING && fullTransitionAmount == 0.0f && !mAmbientState.isExpansionChanging(); @@ -357,6 +358,7 @@ public class NotificationShelf extends ActivatableNotificationView implements && !ViewState.isAnimatingY(icon))) { iconState.cancelAnimations(icon); iconState.useFullTransitionAmount = true; + iconState.noAnimations = true; } float transitionAmount; if (isLastChild || !USE_ANIMATIONS_WHEN_OPENING || iconState.useFullTransitionAmount diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java index 14c1606762af..930191e6d51d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java @@ -466,6 +466,7 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { public boolean useLinearTransitionAmount; public boolean translateContent; public int iconColor = StatusBarIconView.NO_COLOR; + public boolean noAnimations; @Override public void applyToView(View view) { @@ -473,7 +474,8 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { StatusBarIconView icon = (StatusBarIconView) view; boolean animate = false; AnimationProperties animationProperties = null; - boolean animationsAllowed = mAnimationsEnabled && !mDisallowNextAnimation; + boolean animationsAllowed = mAnimationsEnabled && !mDisallowNextAnimation + && !noAnimations; if (animationsAllowed) { if (justAdded) { super.applyToView(icon);