Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +9 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ public class AmbientState { private ExpandableNotificationRow mTrackedHeadsUpRow; private float mAppearFraction; private boolean mIsShadeOpening; private float mSectionPadding; /** Tracks the state from AlertingNotificationManager#hasNotifications() */ private boolean mHasAlertEntries; Loading Loading @@ -105,6 +106,14 @@ public class AmbientState { return mIsShadeOpening; } void setSectionPadding(float padding) { mSectionPadding = padding; } float getSectionPadding() { return mSectionPadding; } private static int getZDistanceBetweenElements(Context context) { return Math.max(1, context.getResources() .getDimensionPixelSize(R.dimen.z_distance_between_notifications)); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +5 −0 Original line number Diff line number Diff line Loading @@ -554,6 +554,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mAmbientState.setIsShadeOpening(isOpening); } void setSectionPadding(float margin) { mAmbientState.setSectionPadding(margin); requestChildrenUpdate(); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) protected void onFinishInflate() { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +4 −0 Original line number Diff line number Diff line Loading @@ -275,6 +275,10 @@ public class NotificationStackScrollLayoutController { mView.setIsShadeOpening(isOpening); } public void setSectionPadding(float padding) { mView.setSectionPadding(padding); } private final OnMenuEventListener mMenuEventListener = new OnMenuEventListener() { @Override public void onMenuClicked( Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +6 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,8 @@ public class StackScrollAlgorithm { boolean isEmptyShadeView = child instanceof EmptyShadeView; childViewState.location = ExpandableViewState.LOCATION_MAIN_AREA; float inset = ambientState.getTopPadding() + ambientState.getStackTranslation(); float inset = ambientState.getTopPadding() + ambientState.getStackTranslation() + ambientState.getSectionPadding(); if (i <= algorithmState.getIndexOfExpandingNotification()) { inset += ambientState.getExpandAnimationTopChange(); } Loading Loading @@ -563,6 +564,10 @@ public class StackScrollAlgorithm { childViewState.yTranslation = Math.max(childViewState.yTranslation, shelfStart); } childViewState.yTranslation = Math.min(childViewState.yTranslation, shelfStart); if (child instanceof SectionHeaderView) { // Add padding before sections for overscroll effect. childViewState.yTranslation += ambientState.getSectionPadding(); } if (childViewState.yTranslation >= shelfStart) { childViewState.hidden = !child.isExpandAnimationRunning() && !child.hasExpandingChild(); childViewState.inShelf = true; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +11 −18 Original line number Diff line number Diff line Loading @@ -477,6 +477,7 @@ public class NotificationPanelViewController extends PanelViewController { private boolean mShowingKeyguardHeadsUp; private boolean mAllowExpandForSmallExpansion; private Runnable mExpandAfterLayoutRunnable; private float mSectionPadding; /** * Is this a collapse that started on the panel where we should allow the panel to intercept Loading Loading @@ -2415,6 +2416,16 @@ public class NotificationPanelViewController extends PanelViewController { mNotificationStackScrollLayoutController.setIsShadeOpening(isOpening); } @Override public void setSectionPadding(float padding) { if (padding == mSectionPadding) { return; } mSectionPadding = padding; mQsFrame.setTranslationY(padding); mNotificationStackScrollLayoutController.setSectionPadding(padding); } @Override protected void setOverExpansion(float overExpansion, boolean isPixels) { if (mConflictingQsExpansionGesture || mQsExpandImmediate) { Loading Loading @@ -2501,19 +2512,6 @@ public class NotificationPanelViewController extends PanelViewController { } } @Override protected boolean shouldExpandToTopOfClearAll(float targetHeight) { boolean perform = super.shouldExpandToTopOfClearAll(targetHeight); if (!perform) { return false; } // Let's make sure we're not appearing but the animation will end below the appear. // Otherwise quick settings would jump at the end of the animation. float fraction = mNotificationStackScrollLayoutController .calculateAppearFraction(targetHeight); return fraction >= 1.0f; } @Override protected boolean shouldUseDismissingAnimation() { return mBarState != StatusBarState.SHADE && (mKeyguardStateController.canDismissLockScreen() Loading @@ -2532,11 +2530,6 @@ public class NotificationPanelViewController extends PanelViewController { return mNotificationStackScrollLayoutController.isFooterViewContentVisible(); } @Override protected int getClearAllHeightWithPadding() { return mNotificationStackScrollLayoutController.getFooterViewHeightWithPadding(); } @Override protected boolean isTrackingBlocked() { return mConflictingQsExpansionGesture && mQsExpanded || mBlockingExpansionForCurrentTouch; Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +9 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ public class AmbientState { private ExpandableNotificationRow mTrackedHeadsUpRow; private float mAppearFraction; private boolean mIsShadeOpening; private float mSectionPadding; /** Tracks the state from AlertingNotificationManager#hasNotifications() */ private boolean mHasAlertEntries; Loading Loading @@ -105,6 +106,14 @@ public class AmbientState { return mIsShadeOpening; } void setSectionPadding(float padding) { mSectionPadding = padding; } float getSectionPadding() { return mSectionPadding; } private static int getZDistanceBetweenElements(Context context) { return Math.max(1, context.getResources() .getDimensionPixelSize(R.dimen.z_distance_between_notifications)); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +5 −0 Original line number Diff line number Diff line Loading @@ -554,6 +554,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mAmbientState.setIsShadeOpening(isOpening); } void setSectionPadding(float margin) { mAmbientState.setSectionPadding(margin); requestChildrenUpdate(); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) protected void onFinishInflate() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +4 −0 Original line number Diff line number Diff line Loading @@ -275,6 +275,10 @@ public class NotificationStackScrollLayoutController { mView.setIsShadeOpening(isOpening); } public void setSectionPadding(float padding) { mView.setSectionPadding(padding); } private final OnMenuEventListener mMenuEventListener = new OnMenuEventListener() { @Override public void onMenuClicked( Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +6 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,8 @@ public class StackScrollAlgorithm { boolean isEmptyShadeView = child instanceof EmptyShadeView; childViewState.location = ExpandableViewState.LOCATION_MAIN_AREA; float inset = ambientState.getTopPadding() + ambientState.getStackTranslation(); float inset = ambientState.getTopPadding() + ambientState.getStackTranslation() + ambientState.getSectionPadding(); if (i <= algorithmState.getIndexOfExpandingNotification()) { inset += ambientState.getExpandAnimationTopChange(); } Loading Loading @@ -563,6 +564,10 @@ public class StackScrollAlgorithm { childViewState.yTranslation = Math.max(childViewState.yTranslation, shelfStart); } childViewState.yTranslation = Math.min(childViewState.yTranslation, shelfStart); if (child instanceof SectionHeaderView) { // Add padding before sections for overscroll effect. childViewState.yTranslation += ambientState.getSectionPadding(); } if (childViewState.yTranslation >= shelfStart) { childViewState.hidden = !child.isExpandAnimationRunning() && !child.hasExpandingChild(); childViewState.inShelf = true; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +11 −18 Original line number Diff line number Diff line Loading @@ -477,6 +477,7 @@ public class NotificationPanelViewController extends PanelViewController { private boolean mShowingKeyguardHeadsUp; private boolean mAllowExpandForSmallExpansion; private Runnable mExpandAfterLayoutRunnable; private float mSectionPadding; /** * Is this a collapse that started on the panel where we should allow the panel to intercept Loading Loading @@ -2415,6 +2416,16 @@ public class NotificationPanelViewController extends PanelViewController { mNotificationStackScrollLayoutController.setIsShadeOpening(isOpening); } @Override public void setSectionPadding(float padding) { if (padding == mSectionPadding) { return; } mSectionPadding = padding; mQsFrame.setTranslationY(padding); mNotificationStackScrollLayoutController.setSectionPadding(padding); } @Override protected void setOverExpansion(float overExpansion, boolean isPixels) { if (mConflictingQsExpansionGesture || mQsExpandImmediate) { Loading Loading @@ -2501,19 +2512,6 @@ public class NotificationPanelViewController extends PanelViewController { } } @Override protected boolean shouldExpandToTopOfClearAll(float targetHeight) { boolean perform = super.shouldExpandToTopOfClearAll(targetHeight); if (!perform) { return false; } // Let's make sure we're not appearing but the animation will end below the appear. // Otherwise quick settings would jump at the end of the animation. float fraction = mNotificationStackScrollLayoutController .calculateAppearFraction(targetHeight); return fraction >= 1.0f; } @Override protected boolean shouldUseDismissingAnimation() { return mBarState != StatusBarState.SHADE && (mKeyguardStateController.canDismissLockScreen() Loading @@ -2532,11 +2530,6 @@ public class NotificationPanelViewController extends PanelViewController { return mNotificationStackScrollLayoutController.isFooterViewContentVisible(); } @Override protected int getClearAllHeightWithPadding() { return mNotificationStackScrollLayoutController.getFooterViewHeightWithPadding(); } @Override protected boolean isTrackingBlocked() { return mConflictingQsExpansionGesture && mQsExpanded || mBlockingExpansionForCurrentTouch; Loading