Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +4 −3 Original line number Diff line number Diff line Loading @@ -298,7 +298,8 @@ public class NotificationShelf extends ActivatableNotificationView implements private void updateNotificationClipHeight(ExpandableNotificationRow row, float notificationClipEnd) { float viewEnd = row.getTranslationY() + row.getActualHeight(); boolean isPinned = row.isPinned() || row.isHeadsUpAnimatingAway(); boolean isPinned = (row.isPinned() || row.isHeadsUpAnimatingAway()) && !mAmbientState.isDozingAndNotPulsing(row); if (viewEnd > notificationClipEnd && (mAmbientState.isShadeExpanded() || !isPinned)) { int clipBottomAmount = (int) (viewEnd - notificationClipEnd); Loading Loading @@ -450,7 +451,7 @@ public class NotificationShelf extends ActivatableNotificationView implements ? fullTransitionAmount : transitionAmount; iconState.clampedAppearAmount = clampedAmount; float contentTransformationAmount = !row.isAboveShelf() float contentTransformationAmount = !mAmbientState.isAboveShelf(row) && (isLastChild || iconState.translateContent) ? iconTransitionAmount : 0.0f; Loading Loading @@ -519,7 +520,7 @@ public class NotificationShelf extends ActivatableNotificationView implements iconState.scaleY = 1.0f; iconState.hidden = false; } if (row.isAboveShelf() || (!row.isInShelf() && (isLastChild && row.areGutsExposed() if (mAmbientState.isAboveShelf(row) || (!row.isInShelf() && (isLastChild && row.areGutsExposed() || row.getTranslationZ() > mAmbientState.getBaseZHeight()))) { iconState.hidden = true; } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +3 −0 Original line number Diff line number Diff line Loading @@ -7240,6 +7240,9 @@ public class StatusBar extends SystemUI implements DemoMode, if (mAccessibilityManager.isTouchExplorationEnabled()) { if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey()); return false; } else if (mDozing) { // We never want heads up when we are dozing. return false; } else { // we only allow head-up on the lockscreen if it doesn't have a fullscreen intent return !mStatusBarKeyguardViewManager.isShowing() Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +50 −4 Original line number Diff line number Diff line Loading @@ -21,11 +21,15 @@ import android.view.View; import com.android.systemui.R; import com.android.systemui.statusbar.ActivatableNotificationView; import com.android.systemui.statusbar.ExpandableNotificationRow; import com.android.systemui.statusbar.ExpandableView; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.policy.HeadsUpManager; import java.util.ArrayList; import java.util.Collection; /** * A global state to track all input states for the algorithm. Loading Loading @@ -59,7 +63,7 @@ public class AmbientState { private boolean mPanelTracking; private boolean mExpansionChanging; private boolean mPanelFullWidth; private boolean mHasPulsingNotifications; private Collection<HeadsUpManager.HeadsUpEntry> mPulsing; private boolean mUnlockHintRunning; private boolean mQsCustomizerShowing; private int mIntrinsicPadding; Loading Loading @@ -290,11 +294,23 @@ public class AmbientState { } public boolean hasPulsingNotifications() { return mHasPulsingNotifications; return mPulsing != null; } public void setHasPulsingNotifications(boolean hasPulsing) { mHasPulsingNotifications = hasPulsing; public void setPulsing(Collection<HeadsUpManager.HeadsUpEntry> hasPulsing) { mPulsing = hasPulsing; } public boolean isPulsing(NotificationData.Entry entry) { if (mPulsing == null) { return false; } for (HeadsUpManager.HeadsUpEntry e : mPulsing) { if (e.entry == entry) { return true; } } return false; } public boolean isPanelTracking() { Loading Loading @@ -332,4 +348,34 @@ public class AmbientState { public int getIntrinsicPadding() { return mIntrinsicPadding; } /** * Similar to the normal is above shelf logic but doesn't allow it to be above in AOD1. * * @param expandableView the view to check */ public boolean isAboveShelf(ExpandableView expandableView) { if (!(expandableView instanceof ExpandableNotificationRow)) { return expandableView.isAboveShelf(); } ExpandableNotificationRow row = (ExpandableNotificationRow) expandableView; return row.isAboveShelf() && !isDozingAndNotPulsing(row); } /** * @return whether a view is dozing and not pulsing right now */ public boolean isDozingAndNotPulsing(ExpandableView view) { if (view instanceof ExpandableNotificationRow) { return isDozingAndNotPulsing((ExpandableNotificationRow) view); } return false; } /** * @return whether a row is dozing and not pulsing right now */ public boolean isDozingAndNotPulsing(ExpandableNotificationRow row) { return isDark() && !isPulsing(row.getEntry()); } } packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +5 −9 Original line number Diff line number Diff line Loading @@ -805,7 +805,7 @@ public class NotificationStackScrollLayout extends ViewGroup */ private float getAppearStartPosition() { if (mTrackingHeadsUp && mFirstVisibleBackgroundChild != null) { if (mFirstVisibleBackgroundChild.isAboveShelf()) { if (mAmbientState.isAboveShelf(mFirstVisibleBackgroundChild)) { // If we ever expanded beyond the first notification, it's allowed to merge into // the shelf return mFirstVisibleBackgroundChild.getPinnedHeadsUpHeight(); Loading @@ -823,7 +823,8 @@ public class NotificationStackScrollLayout extends ViewGroup int notGoneChildCount = getNotGoneChildCount(); if (mEmptyShadeView.getVisibility() == GONE && notGoneChildCount != 0) { int minNotificationsForShelf = 1; if (mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp()) { if (mTrackingHeadsUp || (mHeadsUpManager.hasPinnedHeadsUp() && !mAmbientState.isDark())) { appearPosition = mHeadsUpManager.getTopHeadsUpPinnedHeight(); minNotificationsForShelf = 2; } else { Loading Loading @@ -2008,12 +2009,7 @@ public class NotificationStackScrollLayout extends ViewGroup } private boolean isPulsing(NotificationData.Entry entry) { for (HeadsUpManager.HeadsUpEntry e : mPulsing) { if (e.entry == entry) { return true; } } return false; return mAmbientState.isPulsing(entry); } public boolean hasPulsingNotifications() { Loading Loading @@ -4148,7 +4144,7 @@ public class NotificationStackScrollLayout extends ViewGroup return; } mPulsing = pulsing; mAmbientState.setHasPulsingNotifications(hasPulsingNotifications()); mAmbientState.setPulsing(pulsing); updateNotificationAnimationStates(); updateContentHeight(); notifyHeightChangeListener(mShelf); Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +3 −3 Original line number Diff line number Diff line Loading @@ -413,7 +413,7 @@ public class StackScrollAlgorithm { if (mIsExpanded) { // Ensure that the heads up is always visible even when scrolled off clampHunToTop(ambientState, row, childState); if (i == 0 && row.isAboveShelf()) { if (i == 0 && ambientState.isAboveShelf(row)) { // the first hun can't get off screen. clampHunToMaxTranslation(ambientState, row, childState); childState.hidden = false; Loading Loading @@ -515,7 +515,7 @@ public class StackScrollAlgorithm { ExpandableViewState childViewState = resultState.getViewStateForView(child); int zDistanceBetweenElements = ambientState.getZDistanceBetweenElements(); float baseZ = ambientState.getBaseZHeight(); if (child.mustStayOnScreen() if (child.mustStayOnScreen() && !ambientState.isDozingAndNotPulsing(child) && childViewState.yTranslation < ambientState.getTopPadding() + ambientState.getStackTranslation()) { if (childrenOnTop != 0.0f) { Loading @@ -527,7 +527,7 @@ public class StackScrollAlgorithm { } childViewState.zTranslation = baseZ + childrenOnTop * zDistanceBetweenElements; } else if (i == 0 && child.isAboveShelf()) { } else if (i == 0 && ambientState.isAboveShelf(child)) { // In case this is a new view that has never been measured before, we don't want to // elevate if we are currently expanded more then the notification int shelfHeight = ambientState.getShelf().getIntrinsicHeight(); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +4 −3 Original line number Diff line number Diff line Loading @@ -298,7 +298,8 @@ public class NotificationShelf extends ActivatableNotificationView implements private void updateNotificationClipHeight(ExpandableNotificationRow row, float notificationClipEnd) { float viewEnd = row.getTranslationY() + row.getActualHeight(); boolean isPinned = row.isPinned() || row.isHeadsUpAnimatingAway(); boolean isPinned = (row.isPinned() || row.isHeadsUpAnimatingAway()) && !mAmbientState.isDozingAndNotPulsing(row); if (viewEnd > notificationClipEnd && (mAmbientState.isShadeExpanded() || !isPinned)) { int clipBottomAmount = (int) (viewEnd - notificationClipEnd); Loading Loading @@ -450,7 +451,7 @@ public class NotificationShelf extends ActivatableNotificationView implements ? fullTransitionAmount : transitionAmount; iconState.clampedAppearAmount = clampedAmount; float contentTransformationAmount = !row.isAboveShelf() float contentTransformationAmount = !mAmbientState.isAboveShelf(row) && (isLastChild || iconState.translateContent) ? iconTransitionAmount : 0.0f; Loading Loading @@ -519,7 +520,7 @@ public class NotificationShelf extends ActivatableNotificationView implements iconState.scaleY = 1.0f; iconState.hidden = false; } if (row.isAboveShelf() || (!row.isInShelf() && (isLastChild && row.areGutsExposed() if (mAmbientState.isAboveShelf(row) || (!row.isInShelf() && (isLastChild && row.areGutsExposed() || row.getTranslationZ() > mAmbientState.getBaseZHeight()))) { iconState.hidden = true; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +3 −0 Original line number Diff line number Diff line Loading @@ -7240,6 +7240,9 @@ public class StatusBar extends SystemUI implements DemoMode, if (mAccessibilityManager.isTouchExplorationEnabled()) { if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey()); return false; } else if (mDozing) { // We never want heads up when we are dozing. return false; } else { // we only allow head-up on the lockscreen if it doesn't have a fullscreen intent return !mStatusBarKeyguardViewManager.isShowing() Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +50 −4 Original line number Diff line number Diff line Loading @@ -21,11 +21,15 @@ import android.view.View; import com.android.systemui.R; import com.android.systemui.statusbar.ActivatableNotificationView; import com.android.systemui.statusbar.ExpandableNotificationRow; import com.android.systemui.statusbar.ExpandableView; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.policy.HeadsUpManager; import java.util.ArrayList; import java.util.Collection; /** * A global state to track all input states for the algorithm. Loading Loading @@ -59,7 +63,7 @@ public class AmbientState { private boolean mPanelTracking; private boolean mExpansionChanging; private boolean mPanelFullWidth; private boolean mHasPulsingNotifications; private Collection<HeadsUpManager.HeadsUpEntry> mPulsing; private boolean mUnlockHintRunning; private boolean mQsCustomizerShowing; private int mIntrinsicPadding; Loading Loading @@ -290,11 +294,23 @@ public class AmbientState { } public boolean hasPulsingNotifications() { return mHasPulsingNotifications; return mPulsing != null; } public void setHasPulsingNotifications(boolean hasPulsing) { mHasPulsingNotifications = hasPulsing; public void setPulsing(Collection<HeadsUpManager.HeadsUpEntry> hasPulsing) { mPulsing = hasPulsing; } public boolean isPulsing(NotificationData.Entry entry) { if (mPulsing == null) { return false; } for (HeadsUpManager.HeadsUpEntry e : mPulsing) { if (e.entry == entry) { return true; } } return false; } public boolean isPanelTracking() { Loading Loading @@ -332,4 +348,34 @@ public class AmbientState { public int getIntrinsicPadding() { return mIntrinsicPadding; } /** * Similar to the normal is above shelf logic but doesn't allow it to be above in AOD1. * * @param expandableView the view to check */ public boolean isAboveShelf(ExpandableView expandableView) { if (!(expandableView instanceof ExpandableNotificationRow)) { return expandableView.isAboveShelf(); } ExpandableNotificationRow row = (ExpandableNotificationRow) expandableView; return row.isAboveShelf() && !isDozingAndNotPulsing(row); } /** * @return whether a view is dozing and not pulsing right now */ public boolean isDozingAndNotPulsing(ExpandableView view) { if (view instanceof ExpandableNotificationRow) { return isDozingAndNotPulsing((ExpandableNotificationRow) view); } return false; } /** * @return whether a row is dozing and not pulsing right now */ public boolean isDozingAndNotPulsing(ExpandableNotificationRow row) { return isDark() && !isPulsing(row.getEntry()); } }
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +5 −9 Original line number Diff line number Diff line Loading @@ -805,7 +805,7 @@ public class NotificationStackScrollLayout extends ViewGroup */ private float getAppearStartPosition() { if (mTrackingHeadsUp && mFirstVisibleBackgroundChild != null) { if (mFirstVisibleBackgroundChild.isAboveShelf()) { if (mAmbientState.isAboveShelf(mFirstVisibleBackgroundChild)) { // If we ever expanded beyond the first notification, it's allowed to merge into // the shelf return mFirstVisibleBackgroundChild.getPinnedHeadsUpHeight(); Loading @@ -823,7 +823,8 @@ public class NotificationStackScrollLayout extends ViewGroup int notGoneChildCount = getNotGoneChildCount(); if (mEmptyShadeView.getVisibility() == GONE && notGoneChildCount != 0) { int minNotificationsForShelf = 1; if (mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp()) { if (mTrackingHeadsUp || (mHeadsUpManager.hasPinnedHeadsUp() && !mAmbientState.isDark())) { appearPosition = mHeadsUpManager.getTopHeadsUpPinnedHeight(); minNotificationsForShelf = 2; } else { Loading Loading @@ -2008,12 +2009,7 @@ public class NotificationStackScrollLayout extends ViewGroup } private boolean isPulsing(NotificationData.Entry entry) { for (HeadsUpManager.HeadsUpEntry e : mPulsing) { if (e.entry == entry) { return true; } } return false; return mAmbientState.isPulsing(entry); } public boolean hasPulsingNotifications() { Loading Loading @@ -4148,7 +4144,7 @@ public class NotificationStackScrollLayout extends ViewGroup return; } mPulsing = pulsing; mAmbientState.setHasPulsingNotifications(hasPulsingNotifications()); mAmbientState.setPulsing(pulsing); updateNotificationAnimationStates(); updateContentHeight(); notifyHeightChangeListener(mShelf); Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +3 −3 Original line number Diff line number Diff line Loading @@ -413,7 +413,7 @@ public class StackScrollAlgorithm { if (mIsExpanded) { // Ensure that the heads up is always visible even when scrolled off clampHunToTop(ambientState, row, childState); if (i == 0 && row.isAboveShelf()) { if (i == 0 && ambientState.isAboveShelf(row)) { // the first hun can't get off screen. clampHunToMaxTranslation(ambientState, row, childState); childState.hidden = false; Loading Loading @@ -515,7 +515,7 @@ public class StackScrollAlgorithm { ExpandableViewState childViewState = resultState.getViewStateForView(child); int zDistanceBetweenElements = ambientState.getZDistanceBetweenElements(); float baseZ = ambientState.getBaseZHeight(); if (child.mustStayOnScreen() if (child.mustStayOnScreen() && !ambientState.isDozingAndNotPulsing(child) && childViewState.yTranslation < ambientState.getTopPadding() + ambientState.getStackTranslation()) { if (childrenOnTop != 0.0f) { Loading @@ -527,7 +527,7 @@ public class StackScrollAlgorithm { } childViewState.zTranslation = baseZ + childrenOnTop * zDistanceBetweenElements; } else if (i == 0 && child.isAboveShelf()) { } else if (i == 0 && ambientState.isAboveShelf(child)) { // In case this is a new view that has never been measured before, we don't want to // elevate if we are currently expanded more then the notification int shelfHeight = ambientState.getShelf().getIntrinsicHeight(); Loading