Removed notification top padding
Moving more to fullbleed Change-Id: I28e52963315bbec37819a355dc3f198431e9daee
This commit is contained in:
@@ -62,8 +62,7 @@
|
||||
<View
|
||||
android:id="@+id/reserve_notification_space"
|
||||
android:layout_height="@dimen/min_stack_height"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="@dimen/notifications_top_padding" />
|
||||
android:layout_width="match_parent" />
|
||||
</LinearLayout>
|
||||
</com.android.systemui.statusbar.phone.ObservableScrollView>
|
||||
|
||||
|
||||
@@ -325,8 +325,6 @@
|
||||
<!-- Falsing threshold used when dismissing notifications from the lockscreen. -->
|
||||
<dimen name="swipe_helper_falsing_threshold">70dp</dimen>
|
||||
|
||||
<dimen name="notifications_top_padding">4dp</dimen>
|
||||
|
||||
<!-- Minimum distance the user has to drag down to go to the full shade. -->
|
||||
<dimen name="keyguard_drag_down_min_distance">100dp</dimen>
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user