Fix notification being slided over with the gear not showing
If a notification is updated to be non-dismissable it gets "snapped back"
into place, if the notification was slid over to show the gear when this
happens it'll snap back to the gear. If the screen is turned off during
this time, the notification tries to reset itself back over the gear.
The translation animator was not cancelled in the reset method, so the gear
visibility would get reset, but the translation animation to snap back
into position would continue. This results in the notification being slid
over but the gear being invisible.
The fix is to simply cancel the animator when the translation is reset.
Bug: 31437688
Change-Id: Icb9d777e30ee3a5578c49475b89f6d46c1096053
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
index 02fdd3f..d40ee93 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
@@ -907,6 +907,9 @@
}
public void resetTranslation() {
+ if (mTranslateAnim != null) {
+ mTranslateAnim.cancel();
+ }
if (mTranslateableViews != null) {
for (int i = 0; i < mTranslateableViews.size(); i++) {
mTranslateableViews.get(i).setTranslationX(0);