Fixed a bug where the headsup would be stuck disappearing

Change-Id: I56d6be69f6e59c1bec647e7e70e50a36b793f895
Fixes: 30120962
This commit is contained in:
Selim Cinek
2016-07-13 14:34:56 -07:00
parent c2b9d55818
commit a4155bb7c0

View File

@@ -2347,6 +2347,7 @@ public class NotificationStackScrollLayout extends ViewGroup
if (hasAddEvent) { if (hasAddEvent) {
// This child was just added lets remove all events. // This child was just added lets remove all events.
mHeadsUpChangeAnimations.removeAll(mTmpList); mHeadsUpChangeAnimations.removeAll(mTmpList);
((ExpandableNotificationRow ) child).setHeadsupDisappearRunning(false);
} }
mTmpList.clear(); mTmpList.clear();
return hasAddEvent; return hasAddEvent;
@@ -2604,6 +2605,10 @@ public class NotificationStackScrollLayout extends ViewGroup
type = row.wasJustClicked() type = row.wasJustClicked()
? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK
: AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR; : AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR;
if (row.isChildInGroup()) {
// We can otherwise get stuck in there if it was just isolated
row.setHeadsupDisappearRunning(false);
}
} else { } else {
StackViewState viewState = mCurrentStackScrollState.getViewStateForView(row); StackViewState viewState = mCurrentStackScrollState.getViewStateForView(row);
if (viewState == null) { if (viewState == null) {
@@ -3093,6 +3098,22 @@ public class NotificationStackScrollLayout extends ViewGroup
requestChildrenUpdate(); requestChildrenUpdate();
runAnimationFinishedRunnables(); runAnimationFinishedRunnables();
clearViewOverlays(); clearViewOverlays();
clearHeadsUpDisappearRunning();
}
private void clearHeadsUpDisappearRunning() {
for (int i = 0; i < getChildCount(); i++) {
View view = getChildAt(i);
if (view instanceof ExpandableNotificationRow) {
ExpandableNotificationRow row = (ExpandableNotificationRow) view;
row.setHeadsupDisappearRunning(false);
if (row.isSummaryWithChildren()) {
for (ExpandableNotificationRow child : row.getNotificationChildren()) {
child.setHeadsupDisappearRunning(false);
}
}
}
}
} }
private void clearViewOverlays() { private void clearViewOverlays() {