Loading packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -254,6 +254,9 @@ <!-- The minimum amount of top overscroll to go to the quick settings. --> <dimen name="min_top_overscroll_to_qs">36dp</dimen> <!-- The padding to the second card when the notifications collapse. --> <dimen name="notification_collapse_second_card_padding">8dp</dimen> <!-- The height of the speed bump view. --> <dimen name="speed_bump_height">16dp</dimen> Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +7 −5 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ public class NotificationStackScrollLayout extends ViewGroup private int mPaddingBetweenElementsDimmed; private int mPaddingBetweenElementsNormal; private int mTopPadding; private int mCollapseSecondCardPadding; /** * The algorithm which calculates the properties for our children Loading Loading @@ -263,6 +264,8 @@ public class NotificationStackScrollLayout extends ViewGroup R.dimen.min_top_overscroll_to_qs); mNotificationTopPadding = getResources().getDimensionPixelSize( R.dimen.notifications_top_padding); mCollapseSecondCardPadding = getResources().getDimensionPixelSize( R.dimen.notification_collapse_second_card_padding); } private void updatePadding(boolean dimmed) { Loading Loading @@ -420,9 +423,7 @@ public class NotificationStackScrollLayout extends ViewGroup public void setStackHeight(float height) { setIsExpanded(height > 0.0f); int newStackHeight = (int) height; int itemHeight = getItemHeight(); int bottomStackPeekSize = mBottomStackPeekSize; int minStackHeight = itemHeight + bottomStackPeekSize; int minStackHeight = getMinStackHeight(); int stackHeight; if (newStackHeight - mTopPadding >= minStackHeight || getNotGoneChildCount() == 0) { setTranslationY(mTopPaddingOverflow); Loading @@ -436,7 +437,8 @@ public class NotificationStackScrollLayout extends ViewGroup // the top card. float partiallyThere = (float) (newStackHeight - mTopPadding) / minStackHeight; partiallyThere = Math.max(0, partiallyThere); translationY += (1 - partiallyThere) * bottomStackPeekSize; translationY += (1 - partiallyThere) * (mBottomStackPeekSize + mCollapseSecondCardPadding); setTranslationY(translationY - mTopPadding); stackHeight = (int) (height - (translationY - mTopPadding)); } Loading Loading @@ -1306,7 +1308,7 @@ public class NotificationStackScrollLayout extends ViewGroup } public int getMinStackHeight() { return mCollapsedSize + mBottomStackPeekSize; return mCollapsedSize + mBottomStackPeekSize + mCollapseSecondCardPadding; } public float getTopPaddingOverflow() { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +10 −4 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class StackScrollAlgorithm { private int mPaddingBetweenElementsNormal; private int mBottomStackSlowDownLength; private int mTopStackSlowDownLength; private int mCollapseSecondCardPadding; public StackScrollAlgorithm(Context context) { initConstants(context); Loading Loading @@ -118,6 +119,8 @@ public class StackScrollAlgorithm { .getDimensionPixelSize(R.dimen.top_stack_slow_down_length); mRoundedRectCornerRadius = context.getResources().getDimensionPixelSize( R.dimen.notification_material_rounded_rect_radius); mCollapseSecondCardPadding = context.getResources().getDimensionPixelSize( R.dimen.notification_collapse_second_card_padding); } Loading Loading @@ -403,9 +406,11 @@ public class StackScrollAlgorithm { if (i == 0) { childViewState.alpha = 1.0f; childViewState.yTranslation = Math.max(mCollapsedSize - algorithmState.scrollY, 0); if (childViewState.yTranslation + childViewState.height > bottomPeekStart) { if (childViewState.yTranslation + childViewState.height > bottomPeekStart - mCollapseSecondCardPadding) { childViewState.height = (int) Math.max( bottomPeekStart - childViewState.yTranslation, mCollapsedSize); bottomPeekStart - mCollapseSecondCardPadding - childViewState.yTranslation, mCollapsedSize); } childViewState.location = StackScrollState.ViewState.LOCATION_FIRST_CARD; } Loading Loading @@ -440,7 +445,7 @@ public class StackScrollAlgorithm { private void clampPositionToBottomStackStart(StackScrollState.ViewState childViewState, int childHeight) { childViewState.yTranslation = Math.min(childViewState.yTranslation, mInnerHeight - mBottomStackPeekSize - childHeight); mInnerHeight - mBottomStackPeekSize - mCollapseSecondCardPadding - childHeight); } /** Loading Loading @@ -588,7 +593,8 @@ public class StackScrollAlgorithm { if (i == 0 && algorithmState.scrollY <= mCollapsedSize) { // The starting position of the bottom stack peek int bottomPeekStart = mInnerHeight - mBottomStackPeekSize; int bottomPeekStart = mInnerHeight - mBottomStackPeekSize - mCollapseSecondCardPadding; // Collapse and expand the first child while the shade is being expanded float maxHeight = mIsExpansionChanging && child == mFirstChildWhileExpanding ? mFirstChildMaxHeight Loading Loading
packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -254,6 +254,9 @@ <!-- The minimum amount of top overscroll to go to the quick settings. --> <dimen name="min_top_overscroll_to_qs">36dp</dimen> <!-- The padding to the second card when the notifications collapse. --> <dimen name="notification_collapse_second_card_padding">8dp</dimen> <!-- The height of the speed bump view. --> <dimen name="speed_bump_height">16dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +7 −5 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ public class NotificationStackScrollLayout extends ViewGroup private int mPaddingBetweenElementsDimmed; private int mPaddingBetweenElementsNormal; private int mTopPadding; private int mCollapseSecondCardPadding; /** * The algorithm which calculates the properties for our children Loading Loading @@ -263,6 +264,8 @@ public class NotificationStackScrollLayout extends ViewGroup R.dimen.min_top_overscroll_to_qs); mNotificationTopPadding = getResources().getDimensionPixelSize( R.dimen.notifications_top_padding); mCollapseSecondCardPadding = getResources().getDimensionPixelSize( R.dimen.notification_collapse_second_card_padding); } private void updatePadding(boolean dimmed) { Loading Loading @@ -420,9 +423,7 @@ public class NotificationStackScrollLayout extends ViewGroup public void setStackHeight(float height) { setIsExpanded(height > 0.0f); int newStackHeight = (int) height; int itemHeight = getItemHeight(); int bottomStackPeekSize = mBottomStackPeekSize; int minStackHeight = itemHeight + bottomStackPeekSize; int minStackHeight = getMinStackHeight(); int stackHeight; if (newStackHeight - mTopPadding >= minStackHeight || getNotGoneChildCount() == 0) { setTranslationY(mTopPaddingOverflow); Loading @@ -436,7 +437,8 @@ public class NotificationStackScrollLayout extends ViewGroup // the top card. float partiallyThere = (float) (newStackHeight - mTopPadding) / minStackHeight; partiallyThere = Math.max(0, partiallyThere); translationY += (1 - partiallyThere) * bottomStackPeekSize; translationY += (1 - partiallyThere) * (mBottomStackPeekSize + mCollapseSecondCardPadding); setTranslationY(translationY - mTopPadding); stackHeight = (int) (height - (translationY - mTopPadding)); } Loading Loading @@ -1306,7 +1308,7 @@ public class NotificationStackScrollLayout extends ViewGroup } public int getMinStackHeight() { return mCollapsedSize + mBottomStackPeekSize; return mCollapsedSize + mBottomStackPeekSize + mCollapseSecondCardPadding; } public float getTopPaddingOverflow() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +10 −4 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class StackScrollAlgorithm { private int mPaddingBetweenElementsNormal; private int mBottomStackSlowDownLength; private int mTopStackSlowDownLength; private int mCollapseSecondCardPadding; public StackScrollAlgorithm(Context context) { initConstants(context); Loading Loading @@ -118,6 +119,8 @@ public class StackScrollAlgorithm { .getDimensionPixelSize(R.dimen.top_stack_slow_down_length); mRoundedRectCornerRadius = context.getResources().getDimensionPixelSize( R.dimen.notification_material_rounded_rect_radius); mCollapseSecondCardPadding = context.getResources().getDimensionPixelSize( R.dimen.notification_collapse_second_card_padding); } Loading Loading @@ -403,9 +406,11 @@ public class StackScrollAlgorithm { if (i == 0) { childViewState.alpha = 1.0f; childViewState.yTranslation = Math.max(mCollapsedSize - algorithmState.scrollY, 0); if (childViewState.yTranslation + childViewState.height > bottomPeekStart) { if (childViewState.yTranslation + childViewState.height > bottomPeekStart - mCollapseSecondCardPadding) { childViewState.height = (int) Math.max( bottomPeekStart - childViewState.yTranslation, mCollapsedSize); bottomPeekStart - mCollapseSecondCardPadding - childViewState.yTranslation, mCollapsedSize); } childViewState.location = StackScrollState.ViewState.LOCATION_FIRST_CARD; } Loading Loading @@ -440,7 +445,7 @@ public class StackScrollAlgorithm { private void clampPositionToBottomStackStart(StackScrollState.ViewState childViewState, int childHeight) { childViewState.yTranslation = Math.min(childViewState.yTranslation, mInnerHeight - mBottomStackPeekSize - childHeight); mInnerHeight - mBottomStackPeekSize - mCollapseSecondCardPadding - childHeight); } /** Loading Loading @@ -588,7 +593,8 @@ public class StackScrollAlgorithm { if (i == 0 && algorithmState.scrollY <= mCollapsedSize) { // The starting position of the bottom stack peek int bottomPeekStart = mInnerHeight - mBottomStackPeekSize; int bottomPeekStart = mInnerHeight - mBottomStackPeekSize - mCollapseSecondCardPadding; // Collapse and expand the first child while the shade is being expanded float maxHeight = mIsExpansionChanging && child == mFirstChildWhileExpanding ? mFirstChildMaxHeight Loading