From 33d4614dfe2b9f89f653210b8609fca4f27c7fe9 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 15 Jan 2016 18:58:39 -0800 Subject: [PATCH] Removed notification top padding Moving more to fullbleed Change-Id: I28e52963315bbec37819a355dc3f198431e9daee --- .../res/layout/status_bar_expanded.xml | 3 +-- packages/SystemUI/res/values/dimens.xml | 2 -- .../statusbar/phone/HeadsUpTouchHelper.java | 10 +--------- .../statusbar/phone/NotificationPanelView.java | 18 ++++++------------ .../statusbar/policy/HeadsUpManager.java | 5 +---- .../stack/NotificationStackScrollLayout.java | 9 +-------- .../statusbar/stack/StackScrollAlgorithm.java | 6 +----- 7 files changed, 11 insertions(+), 42 deletions(-) diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml index c665a95b0de81..89abe2dc2c4c3 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded.xml @@ -62,8 +62,7 @@ + android:layout_width="match_parent" /> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 9a932915ff2de..36aba423bea9c 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -325,8 +325,6 @@ 70dp - 4dp - 100dp diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java index 26abc488db2f0..e7064e5298482 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java @@ -43,7 +43,6 @@ public class HeadsUpTouchHelper implements Gefingerpoken { private boolean mCollapseSnoozes; private NotificationPanelView mPanel; private ExpandableNotificationRow mPickedChild; - private final int mNotificationsTopPadding; public HeadsUpTouchHelper(HeadsUpManager headsUpManager, NotificationStackScrollLayout stackScroller, @@ -54,8 +53,6 @@ public class HeadsUpTouchHelper implements Gefingerpoken { Context context = stackScroller.getContext(); final ViewConfiguration configuration = ViewConfiguration.get(context); mTouchSlop = configuration.getScaledTouchSlop(); - mNotificationsTopPadding = context.getResources() - .getDimensionPixelSize(R.dimen.notifications_top_padding); } public boolean isTrackingHeadsUp() { @@ -80,10 +77,6 @@ public class HeadsUpTouchHelper implements Gefingerpoken { mInitialTouchX = x; setTrackingHeadsUp(false); ExpandableView child = mStackScroller.getChildAtRawPosition(x, y); - if (child == null && y < mNotificationsTopPadding) { - // We should also allow drags from the margin above the heads up - child = mStackScroller.getChildAtRawPosition(x, y + mNotificationsTopPadding); - } mTouchingHeadsUpView = false; if (child instanceof ExpandableNotificationRow) { mPickedChild = (ExpandableNotificationRow) child; @@ -113,8 +106,7 @@ public class HeadsUpTouchHelper implements Gefingerpoken { mHeadsUpManager.unpinAll(); mPanel.setPanelScrimMinFraction((float) expandedHeight / mPanel.getMaxPanelHeight()); - mPanel.startExpandMotion(x, y, true /* startTracking */, expandedHeight - + mNotificationsTopPadding); + mPanel.startExpandMotion(x, y, true /* startTracking */, expandedHeight); mPanel.clearNotificattonEffects(); return true; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index ba20679980d61..c7767bb0a7493 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -104,7 +104,6 @@ public class NotificationPanelView extends PanelView implements private View mQsNavbarScrim; private NotificationsQuickSettingsContainer mNotificationContainerParent; private NotificationStackScrollLayout mNotificationStackScroller; - private int mNotificationTopPadding; private boolean mAnimateNextTopPaddingChange; private int mTrackingPointer; @@ -281,8 +280,6 @@ public class NotificationPanelView extends PanelView implements @Override protected void loadDimens() { super.loadDimens(); - mNotificationTopPadding = getResources().getDimensionPixelSize( - R.dimen.notifications_top_padding); mFlingAnimationUtils = new FlingAnimationUtils(getContext(), 0.4f); mStatusBarMinHeight = getResources().getDimensionPixelSize( com.android.internal.R.dimen.status_bar_height); @@ -400,8 +397,8 @@ public class NotificationPanelView extends PanelView implements if (mStatusBarState != StatusBarState.KEYGUARD) { int bottom = mHeader.getCollapsedHeight(); stackScrollerPadding = mStatusBarState == StatusBarState.SHADE - ? bottom + mQsPeekHeight + mNotificationTopPadding - : mKeyguardStatusBar.getHeight() + mNotificationTopPadding; + ? bottom + mQsPeekHeight + : mKeyguardStatusBar.getHeight(); mTopPaddingAdjustment = 0; } else { mClockPositionAlgorithm.setup( @@ -1380,8 +1377,7 @@ public class NotificationPanelView extends PanelView implements // on Keyguard, maxQs denotes the top padding from the quick settings panel. We need to // take the maximum and linearly interpolate with the panel expansion for a nice motion. int maxNotifications = mClockPositionResult.stackScrollerPadding - - mClockPositionResult.stackScrollerPaddingAdjustment - - mNotificationTopPadding; + - mClockPositionResult.stackScrollerPaddingAdjustment; int maxQs = getTempQsMaxExpansion(); int max = mStatusBarState == StatusBarState.KEYGUARD ? Math.max(maxNotifications, maxQs) @@ -1395,7 +1391,7 @@ public class NotificationPanelView extends PanelView implements // We can only do the smoother transition on Keyguard when we also are not collapsing // from a scrolled quick settings. return interpolate(getQsExpansionFraction(), - mNotificationStackScroller.getIntrinsicPadding() - mNotificationTopPadding, + mNotificationStackScroller.getIntrinsicPadding(), mQsMaxExpansionHeight); } else { return mQsExpansionHeight; @@ -1625,15 +1621,13 @@ public class NotificationPanelView extends PanelView implements maxQsHeight = (int) mQsSizeChangeAnimator.getAnimatedValue(); } float totalHeight = Math.max( - maxQsHeight + mNotificationStackScroller.getNotificationTopPadding(), - mStatusBarState == StatusBarState.KEYGUARD + maxQsHeight, mStatusBarState == StatusBarState.KEYGUARD ? mClockPositionResult.stackScrollerPadding - mTopPaddingAdjustment : 0) + notificationHeight; if (totalHeight > mNotificationStackScroller.getHeight()) { float fullyCollapsedHeight = maxQsHeight + mNotificationStackScroller.getMinStackHeight() - + mNotificationStackScroller.getNotificationTopPadding() - getScrollViewScrollY(); totalHeight = Math.max(fullyCollapsedHeight, mNotificationStackScroller.getHeight()); } @@ -1727,7 +1721,7 @@ public class NotificationPanelView extends PanelView implements float translation = stackTranslation / HEADER_RUBBERBAND_FACTOR; if (mHeadsUpManager.hasPinnedHeadsUp() || mIsExpansionFromHeadsUp) { translation = mNotificationStackScroller.getTopPadding() + stackTranslation - - mNotificationTopPadding - mQsMinExpansionHeight; + - mQsMinExpansionHeight; } return Math.min(0, translation); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java index dd7bd5656db20..f06552283219f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java @@ -84,7 +84,6 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL private final View mStatusBarWindowView; private final int mStatusBarHeight; - private final int mNotificationsTopPadding; private final Context mContext; private final NotificationGroupManager mGroupManager; private PhoneStatusBar mBar; @@ -138,8 +137,6 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL mGroupManager = groupManager; mStatusBarHeight = resources.getDimensionPixelSize( com.android.internal.R.dimen.status_bar_height); - mNotificationsTopPadding = context.getResources() - .getDimensionPixelSize(R.dimen.notifications_top_padding); } private void updateTouchableRegionListener() { @@ -399,7 +396,7 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL } info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION); - info.touchableRegion.set(minX, 0, maxX, maxY + mNotificationsTopPadding); + info.touchableRegion.set(minX, 0, maxX, maxY); } else if (mHeadsUpGoingAway || mWaitingOnCollapseWhenGoingAway) { info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION); info.touchableRegion.set(0, 0, mStatusBarWindowView.getWidth(), mStatusBarHeight); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index 656365e714c11..6dd5ec930ec9b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -182,7 +182,6 @@ public class NotificationStackScrollLayout extends ViewGroup */ private float mMinTopOverScrollToEscape; private int mIntrinsicPadding; - private int mNotificationTopPadding; private float mStackTranslation; private float mTopPaddingOverflow; private boolean mDontReportNextOverScroll; @@ -309,8 +308,6 @@ public class NotificationStackScrollLayout extends ViewGroup updatePadding(mAmbientState.isDimmed()); mMinTopOverScrollToEscape = getResources().getDimensionPixelSize( 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); } @@ -1482,7 +1479,7 @@ public class NotificationStackScrollLayout extends ViewGroup */ public void updateTopPadding(float qsHeight, int scrollY, boolean animate, boolean ignoreIntrinsicPadding) { - float start = qsHeight - scrollY + mNotificationTopPadding; + float start = qsHeight - scrollY; float stackHeight = getHeight() - start; int minStackHeight = getMinStackHeight(); if (stackHeight <= minStackHeight) { @@ -1498,10 +1495,6 @@ public class NotificationStackScrollLayout extends ViewGroup setStackHeight(mLastSetStackHeight); } - public int getNotificationTopPadding() { - return mNotificationTopPadding; - } - public int getMinStackHeight() { final ExpandableView firstChild = getFirstChildNotGone(); final int firstChildMinHeight = firstChild != null ? firstChild.getMinHeight() diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java index d3fbb7f31eeef..ccc0f5504b02e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java @@ -62,7 +62,6 @@ public class StackScrollAlgorithm { private int mTopStackTotalSize; private int mPaddingBetweenElementsDimmed; private int mPaddingBetweenElementsNormal; - private int mNotificationsTopPadding; private int mBottomStackSlowDownLength; private int mTopStackSlowDownLength; private int mCollapseSecondCardPadding; @@ -107,8 +106,6 @@ public class StackScrollAlgorithm { .getDimensionPixelSize(R.dimen.notification_padding_dimmed); mPaddingBetweenElementsNormal = context.getResources() .getDimensionPixelSize(R.dimen.notification_padding); - mNotificationsTopPadding = context.getResources() - .getDimensionPixelSize(R.dimen.notifications_top_padding); mCollapsedSize = context.getResources() .getDimensionPixelSize(R.dimen.notification_min_height); mTopStackPeekSize = context.getResources() @@ -517,8 +514,7 @@ public class StackScrollAlgorithm { bottomPosition); } if (row.isPinned()) { - childState.yTranslation = Math.max(childState.yTranslation, - mNotificationsTopPadding); + childState.yTranslation = Math.max(childState.yTranslation, 0); childState.height = Math.max(row.getIntrinsicHeight(), childState.height); if (!isTopEntry) { // Ensure that a headsUp doesn't vertically extend further than the heads-up at