Small cleanup for notifications

- Add null check when collapsing footer, as container could be null
  if the app is opened
- Remove redundant method that always passed mNotificationItemView
- Set mNotificationItemView to null when it is removed

Change-Id: Ia329815224b213fc688733eaaf6f29ee6888caaf
This commit is contained in:
Tony Wickham committed 2017-03-15 14:46:02 -07:00
1 parent a431fbb850
commit 81ebe383f5
3 files changed
+17 -21

No files matched your search

@@ -198,15 +198,17 @@ public class NotificationFooterLayout extends FrameLayout {
// There are no more icons in the footer, so hide it.
PopupContainerWithArrow popup = PopupContainerWithArrow.getOpen(
Launcher.getLauncher(getContext()));
Animator collapseFooter = popup.reduceNotificationViewHeight(getHeight(),
getResources().getInteger(R.integer.config_removeNotificationViewDuration));
collapseFooter.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
((ViewGroup) getParent()).removeView(NotificationFooterLayout.this);
}
});
collapseFooter.start();
if (popup != null) {
Animator collapseFooter = popup.reduceNotificationViewHeight(getHeight(),
getResources().getInteger(R.integer.config_removeNotificationViewDuration));
collapseFooter.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
((ViewGroup) getParent()).removeView(NotificationFooterLayout.this);
}
});
collapseFooter.start();
}
}
}