Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +15 −9 Original line number Diff line number Diff line Loading @@ -328,7 +328,7 @@ public class NotificationPanelView extends PanelView implements } else if (!mQsExpanded) { setQsExpansion(mQsMinExpansionHeight + mLastOverscroll); } updateStackHeight(getExpandedHeight()); updateExpandedHeight(getExpandedHeight()); updateHeader(); // If we are running a size change animation, the animation takes care of the height of Loading Loading @@ -376,10 +376,7 @@ public class NotificationPanelView extends PanelView implements boolean animate = mNotificationStackScroller.isAddOrRemoveAnimationPending(); int stackScrollerPadding; if (mStatusBarState != StatusBarState.KEYGUARD) { int bottom = mQsContainer.getHeader().getHeight(); stackScrollerPadding = mStatusBarState == StatusBarState.SHADE ? bottom + mQsPeekHeight : mKeyguardStatusBar.getHeight(); stackScrollerPadding = mQsContainer.getHeader().getHeight() + mQsPeekHeight; mTopPaddingAdjustment = 0; } else { mClockPositionAlgorithm.setup( Loading Loading @@ -1166,6 +1163,7 @@ public class NotificationPanelView extends PanelView implements private void updateQsState() { mQsContainer.setExpanded(mQsExpanded); mNotificationStackScroller.setQsExpanded(mQsExpanded); mNotificationStackScroller.setScrollingEnabled( mStatusBarState != StatusBarState.KEYGUARD && (!mQsExpanded || mQsExpansionFromOverscroll)); Loading Loading @@ -1427,7 +1425,7 @@ public class NotificationPanelView extends PanelView implements setQsExpansion(mQsMinExpansionHeight + t * (getTempQsMaxExpansion() - mQsMinExpansionHeight)); } updateStackHeight(expandedHeight); updateExpandedHeight(expandedHeight); updateHeader(); updateUnlockIcon(); updateNotificationTranslucency(); Loading Loading @@ -1487,7 +1485,7 @@ public class NotificationPanelView extends PanelView implements maxQsHeight, mStatusBarState == StatusBarState.KEYGUARD ? mClockPositionResult.stackScrollerPadding - mTopPaddingAdjustment : 0) + notificationHeight; + notificationHeight + mNotificationStackScroller.getTopPaddingOverflow(); if (totalHeight > mNotificationStackScroller.getHeight()) { float fullyCollapsedHeight = maxQsHeight + mNotificationStackScroller.getLayoutMinHeight(); Loading Loading @@ -1730,6 +1728,14 @@ public class NotificationPanelView extends PanelView implements if (view == null && mQsExpanded) { return; } ExpandableView firstChildNotGone = mNotificationStackScroller.getFirstChildNotGone(); ExpandableNotificationRow firstRow = firstChildNotGone instanceof ExpandableNotificationRow ? (ExpandableNotificationRow) firstChildNotGone : null; if (firstRow != null && (view == firstRow || (firstRow.getNotificationParent() == firstRow))) { requestScrollerTopPaddingUpdate(false); } requestPanelHeightUpdate(); } Loading Loading @@ -2249,8 +2255,8 @@ public class NotificationPanelView extends PanelView implements mQsAutoReinflateContainer.setTranslationX(translation); } protected void updateStackHeight(float stackHeight) { mNotificationStackScroller.setStackHeight(stackHeight); protected void updateExpandedHeight(float expandedHeight) { mNotificationStackScroller.setExpandedHeight(expandedHeight); updateKeyguardBottomAreaAlpha(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +6 −5 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class AmbientState { private boolean mShadeExpanded; private float mMaxHeadsUpTranslation; private boolean mDismissAllInProgress; private int mLayoutMinHeight; public int getScrollY() { return mScrollY; Loading Loading @@ -137,10 +138,6 @@ public class AmbientState { mStackTranslation = stackTranslation; } public int getLayoutHeight() { return mLayoutHeight; } public void setLayoutHeight(int layoutHeight) { mLayoutHeight = layoutHeight; } Loading @@ -154,7 +151,7 @@ public class AmbientState { } public int getInnerHeight() { return mLayoutHeight - mTopPadding; return Math.max(mLayoutHeight - mTopPadding, mLayoutMinHeight); } public boolean isShadeExpanded() { Loading @@ -180,4 +177,8 @@ public class AmbientState { public boolean isDismissAllInProgress() { return mDismissAllInProgress; } public void setLayoutMinHeight(int layoutMinHeight) { mLayoutMinHeight = layoutMinHeight; } } packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +45 −29 Original line number Diff line number Diff line Loading @@ -111,11 +111,7 @@ public class NotificationStackScrollLayout extends ViewGroup private int mCurrentStackHeight = Integer.MAX_VALUE; private final Paint mBackgroundPaint = new Paint(); /** * mCurrentStackHeight is the actual stack height, mLastSetStackHeight is the stack height set * externally from {@link #setStackHeight} */ private float mLastSetStackHeight; private float mExpandedHeight; private int mOwnScrollY; private int mMaxLayoutHeight; Loading Loading @@ -354,6 +350,7 @@ public class NotificationStackScrollLayout extends ViewGroup return object.getBackgroundFadeAmount(); } }; private boolean mQsExpanded; public NotificationStackScrollLayout(Context context) { this(context, null); Loading Loading @@ -519,6 +516,7 @@ public class NotificationStackScrollLayout extends ViewGroup clampScrollPosition(); requestChildrenUpdate(); updateFirstAndLastBackgroundViews(); updateAlgorithmLayoutMinHeight(); } private void requestAnimationOnViewResize(ExpandableNotificationRow row) { Loading Loading @@ -560,9 +558,14 @@ public class NotificationStackScrollLayout extends ViewGroup private void updateAlgorithmHeightAndPadding() { mAmbientState.setLayoutHeight(getLayoutHeight()); updateAlgorithmLayoutMinHeight(); mAmbientState.setTopPadding(mTopPadding); } private void updateAlgorithmLayoutMinHeight() { mAmbientState.setLayoutMinHeight(mQsExpanded && !onKeyguard() ? getLayoutMinHeight() : 0); } /** * Updates the children views according to the stack scroll algorithm. Call this whenever * modifications to {@link #mOwnScrollY} are performed to reflect it in the view layout. Loading Loading @@ -659,19 +662,19 @@ public class NotificationStackScrollLayout extends ViewGroup } /** * Update the height of the stack to a new height. * Update the height of the panel. * * @param height the new height of the stack * @param height the expanded height of the panel */ public void setStackHeight(float height) { mLastSetStackHeight = height; public void setExpandedHeight(float height) { mExpandedHeight = height; setIsExpanded(height > 0.0f); int stackHeight; float translationY; float appearEndPosition = getAppearEndPosition(); float appearStartPosition = getAppearStartPosition(); if (height >= appearEndPosition) { translationY = mTopPaddingOverflow; translationY = 0; stackHeight = (int) height; } else { float appearFraction = getAppearFraction(height); Loading @@ -698,8 +701,12 @@ public class NotificationStackScrollLayout extends ViewGroup * Measured relative to the resting position. */ private float getExpandTranslationStart() { int startPosition = mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp() ? 0 : -getFirstChildIntrinsicHeight(); int startPosition = 0; if (!mTrackingHeadsUp && !mHeadsUpManager.hasPinnedHeadsUp()) { startPosition = - Math.min(getFirstChildIntrinsicHeight(), mMaxLayoutHeight - mIntrinsicPadding - mBottomStackSlowDownHeight - mBottomStackPeekSize); } return startPosition - mTopPadding; } Loading @@ -722,7 +729,7 @@ public class NotificationStackScrollLayout extends ViewGroup ? mHeadsUpManager.getTopHeadsUpPinnedHeight() + mBottomStackPeekSize + mBottomStackSlowDownHeight : getLayoutMinHeight(); return firstItemHeight + mTopPadding + mTopPaddingOverflow; return firstItemHeight + (onKeyguard() ? mTopPadding : mIntrinsicPadding); } /** Loading Loading @@ -1152,6 +1159,10 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public boolean isAntiFalsingNeeded() { return onKeyguard(); } private boolean onKeyguard() { return mPhoneStatusBar.getBarState() == StatusBarState.KEYGUARD; } Loading Loading @@ -1228,7 +1239,7 @@ public class NotificationStackScrollLayout extends ViewGroup if (!isScrollingEnabled()) { return false; } if (ev.getY() < mQsContainer.getBottom()) { if (ev.getY() < mQsContainer.getBottom() && !mIsBeingDragged) { return false; } mForcedScroll = null; Loading Loading @@ -2122,26 +2133,22 @@ public class NotificationStackScrollLayout extends ViewGroup */ public void updateTopPadding(float qsHeight, boolean animate, boolean ignoreIntrinsicPadding) { float start = qsHeight; float stackHeight = getHeight() - start; int topPadding = (int) qsHeight; int minStackHeight = getLayoutMinHeight(); if (stackHeight <= minStackHeight) { float overflow = minStackHeight - stackHeight; stackHeight = minStackHeight; start = getHeight() - stackHeight; mTopPaddingOverflow = overflow; if (topPadding + minStackHeight > getHeight()) { mTopPaddingOverflow = topPadding + minStackHeight - getHeight(); } else { mTopPaddingOverflow = 0; } setTopPadding(ignoreIntrinsicPadding ? (int) start : clampPadding((int) start), setTopPadding(ignoreIntrinsicPadding ? topPadding : clampPadding(topPadding), animate); setStackHeight(mLastSetStackHeight); setExpandedHeight(mExpandedHeight); } public int getLayoutMinHeight() { int firstChildMinHeight = getFirstChildIntrinsicHeight(); return Math.min(firstChildMinHeight + mBottomStackPeekSize + mBottomStackSlowDownHeight, mMaxLayoutHeight - mTopPadding); mMaxLayoutHeight - mIntrinsicPadding); } public int getFirstChildIntrinsicHeight() { Loading Loading @@ -3088,10 +3095,14 @@ public class NotificationStackScrollLayout extends ViewGroup updateScrollPositionOnExpandInBottom(view); clampScrollPosition(); notifyHeightChangeListener(view); if (needsAnimation) { ExpandableNotificationRow row = view instanceof ExpandableNotificationRow ? (ExpandableNotificationRow) view : null; if (row != null && (row == mFirstVisibleBackgroundChild || row.getNotificationParent() == mFirstVisibleBackgroundChild)) { updateAlgorithmLayoutMinHeight(); } if (needsAnimation) { requestAnimationOnViewResize(row); } requestChildrenUpdate(); Loading Loading @@ -3374,7 +3385,7 @@ public class NotificationStackScrollLayout extends ViewGroup } private int findDarkAnimationOriginIndex(@Nullable PointF screenLocation) { if (screenLocation == null || screenLocation.y < mTopPadding + mTopPaddingOverflow) { if (screenLocation == null || screenLocation.y < mTopPadding) { return AnimationEvent.DARK_ANIMATION_ORIGIN_INDEX_ABOVE; } if (screenLocation.y > getBottomMostNotificationBottom()) { Loading Loading @@ -3858,6 +3869,11 @@ public class NotificationStackScrollLayout extends ViewGroup mCurrentStackScrollState.removeViewStateForView(view); } public void setQsExpanded(boolean qsExpanded) { mQsExpanded = qsExpanded; updateAlgorithmLayoutMinHeight(); } /** * A listener that is notified when some child locations might have changed. */ Loading Loading @@ -4081,7 +4097,7 @@ public class NotificationStackScrollLayout extends ViewGroup onDragCancelled(animView); // If we're on the lockscreen we want to false this. if (mPhoneStatusBar.getBarState() == StatusBarState.KEYGUARD) { if (isAntiFalsingNeeded()) { mHandler.removeCallbacks(mFalsingCheck); mHandler.postDelayed(mFalsingCheck, COVER_GEAR_DELAY); } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +15 −9 Original line number Diff line number Diff line Loading @@ -328,7 +328,7 @@ public class NotificationPanelView extends PanelView implements } else if (!mQsExpanded) { setQsExpansion(mQsMinExpansionHeight + mLastOverscroll); } updateStackHeight(getExpandedHeight()); updateExpandedHeight(getExpandedHeight()); updateHeader(); // If we are running a size change animation, the animation takes care of the height of Loading Loading @@ -376,10 +376,7 @@ public class NotificationPanelView extends PanelView implements boolean animate = mNotificationStackScroller.isAddOrRemoveAnimationPending(); int stackScrollerPadding; if (mStatusBarState != StatusBarState.KEYGUARD) { int bottom = mQsContainer.getHeader().getHeight(); stackScrollerPadding = mStatusBarState == StatusBarState.SHADE ? bottom + mQsPeekHeight : mKeyguardStatusBar.getHeight(); stackScrollerPadding = mQsContainer.getHeader().getHeight() + mQsPeekHeight; mTopPaddingAdjustment = 0; } else { mClockPositionAlgorithm.setup( Loading Loading @@ -1166,6 +1163,7 @@ public class NotificationPanelView extends PanelView implements private void updateQsState() { mQsContainer.setExpanded(mQsExpanded); mNotificationStackScroller.setQsExpanded(mQsExpanded); mNotificationStackScroller.setScrollingEnabled( mStatusBarState != StatusBarState.KEYGUARD && (!mQsExpanded || mQsExpansionFromOverscroll)); Loading Loading @@ -1427,7 +1425,7 @@ public class NotificationPanelView extends PanelView implements setQsExpansion(mQsMinExpansionHeight + t * (getTempQsMaxExpansion() - mQsMinExpansionHeight)); } updateStackHeight(expandedHeight); updateExpandedHeight(expandedHeight); updateHeader(); updateUnlockIcon(); updateNotificationTranslucency(); Loading Loading @@ -1487,7 +1485,7 @@ public class NotificationPanelView extends PanelView implements maxQsHeight, mStatusBarState == StatusBarState.KEYGUARD ? mClockPositionResult.stackScrollerPadding - mTopPaddingAdjustment : 0) + notificationHeight; + notificationHeight + mNotificationStackScroller.getTopPaddingOverflow(); if (totalHeight > mNotificationStackScroller.getHeight()) { float fullyCollapsedHeight = maxQsHeight + mNotificationStackScroller.getLayoutMinHeight(); Loading Loading @@ -1730,6 +1728,14 @@ public class NotificationPanelView extends PanelView implements if (view == null && mQsExpanded) { return; } ExpandableView firstChildNotGone = mNotificationStackScroller.getFirstChildNotGone(); ExpandableNotificationRow firstRow = firstChildNotGone instanceof ExpandableNotificationRow ? (ExpandableNotificationRow) firstChildNotGone : null; if (firstRow != null && (view == firstRow || (firstRow.getNotificationParent() == firstRow))) { requestScrollerTopPaddingUpdate(false); } requestPanelHeightUpdate(); } Loading Loading @@ -2249,8 +2255,8 @@ public class NotificationPanelView extends PanelView implements mQsAutoReinflateContainer.setTranslationX(translation); } protected void updateStackHeight(float stackHeight) { mNotificationStackScroller.setStackHeight(stackHeight); protected void updateExpandedHeight(float expandedHeight) { mNotificationStackScroller.setExpandedHeight(expandedHeight); updateKeyguardBottomAreaAlpha(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +6 −5 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class AmbientState { private boolean mShadeExpanded; private float mMaxHeadsUpTranslation; private boolean mDismissAllInProgress; private int mLayoutMinHeight; public int getScrollY() { return mScrollY; Loading Loading @@ -137,10 +138,6 @@ public class AmbientState { mStackTranslation = stackTranslation; } public int getLayoutHeight() { return mLayoutHeight; } public void setLayoutHeight(int layoutHeight) { mLayoutHeight = layoutHeight; } Loading @@ -154,7 +151,7 @@ public class AmbientState { } public int getInnerHeight() { return mLayoutHeight - mTopPadding; return Math.max(mLayoutHeight - mTopPadding, mLayoutMinHeight); } public boolean isShadeExpanded() { Loading @@ -180,4 +177,8 @@ public class AmbientState { public boolean isDismissAllInProgress() { return mDismissAllInProgress; } public void setLayoutMinHeight(int layoutMinHeight) { mLayoutMinHeight = layoutMinHeight; } }
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +45 −29 Original line number Diff line number Diff line Loading @@ -111,11 +111,7 @@ public class NotificationStackScrollLayout extends ViewGroup private int mCurrentStackHeight = Integer.MAX_VALUE; private final Paint mBackgroundPaint = new Paint(); /** * mCurrentStackHeight is the actual stack height, mLastSetStackHeight is the stack height set * externally from {@link #setStackHeight} */ private float mLastSetStackHeight; private float mExpandedHeight; private int mOwnScrollY; private int mMaxLayoutHeight; Loading Loading @@ -354,6 +350,7 @@ public class NotificationStackScrollLayout extends ViewGroup return object.getBackgroundFadeAmount(); } }; private boolean mQsExpanded; public NotificationStackScrollLayout(Context context) { this(context, null); Loading Loading @@ -519,6 +516,7 @@ public class NotificationStackScrollLayout extends ViewGroup clampScrollPosition(); requestChildrenUpdate(); updateFirstAndLastBackgroundViews(); updateAlgorithmLayoutMinHeight(); } private void requestAnimationOnViewResize(ExpandableNotificationRow row) { Loading Loading @@ -560,9 +558,14 @@ public class NotificationStackScrollLayout extends ViewGroup private void updateAlgorithmHeightAndPadding() { mAmbientState.setLayoutHeight(getLayoutHeight()); updateAlgorithmLayoutMinHeight(); mAmbientState.setTopPadding(mTopPadding); } private void updateAlgorithmLayoutMinHeight() { mAmbientState.setLayoutMinHeight(mQsExpanded && !onKeyguard() ? getLayoutMinHeight() : 0); } /** * Updates the children views according to the stack scroll algorithm. Call this whenever * modifications to {@link #mOwnScrollY} are performed to reflect it in the view layout. Loading Loading @@ -659,19 +662,19 @@ public class NotificationStackScrollLayout extends ViewGroup } /** * Update the height of the stack to a new height. * Update the height of the panel. * * @param height the new height of the stack * @param height the expanded height of the panel */ public void setStackHeight(float height) { mLastSetStackHeight = height; public void setExpandedHeight(float height) { mExpandedHeight = height; setIsExpanded(height > 0.0f); int stackHeight; float translationY; float appearEndPosition = getAppearEndPosition(); float appearStartPosition = getAppearStartPosition(); if (height >= appearEndPosition) { translationY = mTopPaddingOverflow; translationY = 0; stackHeight = (int) height; } else { float appearFraction = getAppearFraction(height); Loading @@ -698,8 +701,12 @@ public class NotificationStackScrollLayout extends ViewGroup * Measured relative to the resting position. */ private float getExpandTranslationStart() { int startPosition = mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp() ? 0 : -getFirstChildIntrinsicHeight(); int startPosition = 0; if (!mTrackingHeadsUp && !mHeadsUpManager.hasPinnedHeadsUp()) { startPosition = - Math.min(getFirstChildIntrinsicHeight(), mMaxLayoutHeight - mIntrinsicPadding - mBottomStackSlowDownHeight - mBottomStackPeekSize); } return startPosition - mTopPadding; } Loading @@ -722,7 +729,7 @@ public class NotificationStackScrollLayout extends ViewGroup ? mHeadsUpManager.getTopHeadsUpPinnedHeight() + mBottomStackPeekSize + mBottomStackSlowDownHeight : getLayoutMinHeight(); return firstItemHeight + mTopPadding + mTopPaddingOverflow; return firstItemHeight + (onKeyguard() ? mTopPadding : mIntrinsicPadding); } /** Loading Loading @@ -1152,6 +1159,10 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public boolean isAntiFalsingNeeded() { return onKeyguard(); } private boolean onKeyguard() { return mPhoneStatusBar.getBarState() == StatusBarState.KEYGUARD; } Loading Loading @@ -1228,7 +1239,7 @@ public class NotificationStackScrollLayout extends ViewGroup if (!isScrollingEnabled()) { return false; } if (ev.getY() < mQsContainer.getBottom()) { if (ev.getY() < mQsContainer.getBottom() && !mIsBeingDragged) { return false; } mForcedScroll = null; Loading Loading @@ -2122,26 +2133,22 @@ public class NotificationStackScrollLayout extends ViewGroup */ public void updateTopPadding(float qsHeight, boolean animate, boolean ignoreIntrinsicPadding) { float start = qsHeight; float stackHeight = getHeight() - start; int topPadding = (int) qsHeight; int minStackHeight = getLayoutMinHeight(); if (stackHeight <= minStackHeight) { float overflow = minStackHeight - stackHeight; stackHeight = minStackHeight; start = getHeight() - stackHeight; mTopPaddingOverflow = overflow; if (topPadding + minStackHeight > getHeight()) { mTopPaddingOverflow = topPadding + minStackHeight - getHeight(); } else { mTopPaddingOverflow = 0; } setTopPadding(ignoreIntrinsicPadding ? (int) start : clampPadding((int) start), setTopPadding(ignoreIntrinsicPadding ? topPadding : clampPadding(topPadding), animate); setStackHeight(mLastSetStackHeight); setExpandedHeight(mExpandedHeight); } public int getLayoutMinHeight() { int firstChildMinHeight = getFirstChildIntrinsicHeight(); return Math.min(firstChildMinHeight + mBottomStackPeekSize + mBottomStackSlowDownHeight, mMaxLayoutHeight - mTopPadding); mMaxLayoutHeight - mIntrinsicPadding); } public int getFirstChildIntrinsicHeight() { Loading Loading @@ -3088,10 +3095,14 @@ public class NotificationStackScrollLayout extends ViewGroup updateScrollPositionOnExpandInBottom(view); clampScrollPosition(); notifyHeightChangeListener(view); if (needsAnimation) { ExpandableNotificationRow row = view instanceof ExpandableNotificationRow ? (ExpandableNotificationRow) view : null; if (row != null && (row == mFirstVisibleBackgroundChild || row.getNotificationParent() == mFirstVisibleBackgroundChild)) { updateAlgorithmLayoutMinHeight(); } if (needsAnimation) { requestAnimationOnViewResize(row); } requestChildrenUpdate(); Loading Loading @@ -3374,7 +3385,7 @@ public class NotificationStackScrollLayout extends ViewGroup } private int findDarkAnimationOriginIndex(@Nullable PointF screenLocation) { if (screenLocation == null || screenLocation.y < mTopPadding + mTopPaddingOverflow) { if (screenLocation == null || screenLocation.y < mTopPadding) { return AnimationEvent.DARK_ANIMATION_ORIGIN_INDEX_ABOVE; } if (screenLocation.y > getBottomMostNotificationBottom()) { Loading Loading @@ -3858,6 +3869,11 @@ public class NotificationStackScrollLayout extends ViewGroup mCurrentStackScrollState.removeViewStateForView(view); } public void setQsExpanded(boolean qsExpanded) { mQsExpanded = qsExpanded; updateAlgorithmLayoutMinHeight(); } /** * A listener that is notified when some child locations might have changed. */ Loading Loading @@ -4081,7 +4097,7 @@ public class NotificationStackScrollLayout extends ViewGroup onDragCancelled(animView); // If we're on the lockscreen we want to false this. if (mPhoneStatusBar.getBarState() == StatusBarState.KEYGUARD) { if (isAntiFalsingNeeded()) { mHandler.removeCallbacks(mFalsingCheck); mHandler.postDelayed(mFalsingCheck, COVER_GEAR_DELAY); } Loading