Merge "Forcing no animations to be played if swiping fast" into oc-dev
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index b134fc5..f41670e 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 @@
}
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 @@
&& !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 14c1606..930191e 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 boolean useLinearTransitionAmount;
public boolean translateContent;
public int iconColor = StatusBarIconView.NO_COLOR;
+ public boolean noAnimations;
@Override
public void applyToView(View view) {
@@ -473,7 +474,8 @@
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);