From 47374630bf1cd09274928232259d6cecd33ecb53 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 17 Mar 2017 16:07:17 -0700 Subject: Fixed that the icon could dissappear A bug could lead to the icon being hidden even if it should not have been possible Test: runtest systemui Fixes: 34660898 Change-Id: Ia585c396462a371dd213f4de59217013fcc482e4 --- .../src/com/android/systemui/statusbar/NotificationShelf.java | 3 ++- .../SystemUI/src/com/android/systemui/statusbar/stack/ViewState.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java index 8da17fa76bd7..d4fbb8ebe6be 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java @@ -439,7 +439,8 @@ public class NotificationShelf extends ActivatableNotificationView implements iconState.scaleY = 1.0f; iconState.hidden = false; } - if (row.isAboveShelf() || (!row.isInShelf() && isLastChild && row.areGutsExposed())) { + if (row.isAboveShelf() || (!row.isInShelf() && (isLastChild && row.areGutsExposed() + || row.getTranslationZ() > mAmbientState.getBaseZHeight()))) { iconState.hidden = true; } int shelfColor = icon.getStaticDrawableColor(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/ViewState.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/ViewState.java index c8659fb62051..5b594be507d2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/ViewState.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/ViewState.java @@ -190,7 +190,9 @@ public class ViewState { view.setScaleY(scaleY); } - boolean becomesInvisible = this.alpha == 0.0f || (this.hidden && !isAnimating(view)); + int oldVisibility = view.getVisibility(); + boolean becomesInvisible = this.alpha == 0.0f + || (this.hidden && (!isAnimating(view) || oldVisibility != View.VISIBLE)); boolean animatingAlpha = isAnimating(view, TAG_ANIMATOR_ALPHA); if (animatingAlpha) { updateAlphaAnimation(view); @@ -212,7 +214,6 @@ public class ViewState { } // apply visibility - int oldVisibility = view.getVisibility(); int newVisibility = becomesInvisible ? View.INVISIBLE : View.VISIBLE; if (newVisibility != oldVisibility) { if (!(view instanceof ExpandableView) || !((ExpandableView) view).willBeGone()) { -- cgit v1.2.3-59-g8ed1b