summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index 28aae7781412..df8ec9115361 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -2227,13 +2227,16 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
int top = 0;
if (section != null) {
ActivatableNotificationView firstView = section.getFirstVisibleChild();
- // Round Y up to avoid seeing the background during animation
- int finalTranslationY = (int) Math.ceil(ViewState.getFinalTranslationY(firstView));
- if (alreadyAnimating || section.isTargetTop(finalTranslationY)) {
- // we're ending up at the same location as we are now, let's just skip the animation
- top = finalTranslationY;
- } else {
- top = (int) Math.ceil(firstView.getTranslationY());
+ if (firstView != null) {
+ // Round Y up to avoid seeing the background during animation
+ int finalTranslationY = (int) Math.ceil(ViewState.getFinalTranslationY(firstView));
+ if (alreadyAnimating || section.isTargetTop(finalTranslationY)) {
+ // we're ending up at the same location as we are now, let's just skip the
+ // animation
+ top = finalTranslationY;
+ } else {
+ top = (int) Math.ceil(firstView.getTranslationY());
+ }
}
}
return top;