Loading packages/SystemUI/res/layout/status_bar_expanded.xml +7 −3 Original line number Diff line number Diff line Loading @@ -86,10 +86,14 @@ <!-- A view to reserve space for the collapsed stack --> <!-- Layout height: notification_min_height + bottom_stack_peek_amount --> <View android:layout_height="76dp" 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_marginBottom="@dimen/notification_side_padding"/> android:layout_marginTop="@dimen/notifications_top_padding" /> <View android:layout_height="@dimen/notification_side_padding" android:layout_width="match_parent" /> </LinearLayout> </com.android.systemui.statusbar.phone.ObservableScrollView> Loading packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,9 @@ <!-- Space reserved for the cards behind the top card in the bottom stack --> <dimen name="bottom_stack_peek_amount">12dp</dimen> <!-- bottom_stack_peek_amount + notification_min_height --> <dimen name="min_stack_height">76dp</dimen> <!-- The height of the area before the bottom stack in which the notifications slow down --> <dimen name="bottom_stack_slow_down_length">12dp</dimen> Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +41 −9 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ public class NotificationPanelView extends PanelView implements private View mKeyguardStatusView; private ObservableScrollView mScrollView; private TextView mClockView; private View mReserveNotificationSpace; private MirrorView mSystemIconsCopy; private NotificationStackScrollLayout mNotificationStackScroller; Loading Loading @@ -154,6 +154,7 @@ public class NotificationPanelView extends PanelView implements mClockView = (TextView) findViewById(R.id.clock_view); mScrollView = (ObservableScrollView) findViewById(R.id.scroll_view); mScrollView.setListener(this); mReserveNotificationSpace = findViewById(R.id.reserve_notification_space); mNotificationStackScroller = (NotificationStackScrollLayout) findViewById(R.id.notification_stack_scroller); mNotificationStackScroller.setOnHeightChangedListener(this); Loading Loading @@ -357,6 +358,13 @@ public class NotificationPanelView extends PanelView implements if (shouldQuickSettingsIntercept(mInitialTouchX, mInitialTouchY, 0)) { getParent().requestDisallowInterceptTouchEvent(true); } if (mQsExpansionAnimator != null) { onQsExpansionStarted(); mInitialHeightOnTouch = mQsExpansionHeight; mQsTracking = true; mIntercepting = false; mNotificationStackScroller.removeLongPressCallback(); } break; case MotionEvent.ACTION_POINTER_UP: final int upPointer = event.getPointerId(event.getActionIndex()); Loading Loading @@ -434,8 +442,9 @@ public class NotificationPanelView extends PanelView implements private float getQsExpansionFraction() { return (mQsExpansionHeight - mQsMinExpansionHeight) / (mQsMaxExpansionHeight - mQsMinExpansionHeight); / (getTempQsMaxExpansion() - mQsMinExpansionHeight); } @Override public boolean onTouchEvent(MotionEvent event) { if (mBlockTouches) { Loading Loading @@ -541,6 +550,8 @@ public class NotificationPanelView extends PanelView implements if ((fraction != 0f || y >= mInitialTouchY) && (fraction != 1f || y <= mInitialTouchY)) { flingQsWithCurrentVelocity(); } else { mScrollYOverride = -1; } if (mVelocityTracker != null) { mVelocityTracker.recycle(); Loading Loading @@ -593,6 +604,9 @@ public class NotificationPanelView extends PanelView implements // Reset scroll position and apply that position to the expanded height. float height = mQsExpansionHeight - mScrollView.getScrollY() - overscrollAmount; if (mScrollView.getScrollY() != 0) { mScrollYOverride = mScrollView.getScrollY(); } mScrollView.scrollTo(0, 0); setQsExpansion(height); } Loading Loading @@ -639,7 +653,7 @@ public class NotificationPanelView extends PanelView implements setQsExpanded(false); } mQsExpansionHeight = height; mHeader.setExpansion(height - mQsPeekHeight); mHeader.setExpansion(getQsExpansionFraction()); setQsTranslation(height); requestScrollerTopPaddingUpdate(false /* animate */); updateNotificationScrim(height); Loading Loading @@ -698,6 +712,7 @@ public class NotificationPanelView extends PanelView implements private void flingSettings(float vel, boolean expand, final Runnable onFinishRunnable) { float target = expand ? mQsMaxExpansionHeight : mQsMinExpansionHeight; if (target == mQsExpansionHeight) { mScrollYOverride = -1; if (onFinishRunnable != null) { onFinishRunnable.run(); } Loading @@ -714,6 +729,7 @@ public class NotificationPanelView extends PanelView implements animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mScrollYOverride = -1; mQsExpansionAnimator = null; if (onFinishRunnable != null) { onFinishRunnable.run(); Loading Loading @@ -827,12 +843,9 @@ public class NotificationPanelView extends PanelView implements float panelHeightQsExpanded = calculatePanelHeightQsExpanded(); float t = (expandedHeight - panelHeightQsCollapsed) / (panelHeightQsExpanded - panelHeightQsCollapsed); int qsTempMaxExpansion = mQsMaxExpansionHeight; if (mScrollYOverride != -1) { qsTempMaxExpansion -= mScrollYOverride; } setQsExpansion(mQsMinExpansionHeight + t * (qsTempMaxExpansion - mQsMinExpansionHeight)); + t * (getTempQsMaxExpansion() - mQsMinExpansionHeight)); } mNotificationStackScroller.setStackHeight(expandedHeight); updateHeader(); Loading @@ -840,6 +853,18 @@ public class NotificationPanelView extends PanelView implements updateNotificationTranslucency(); } /** * @return a temporary override of {@link #mQsMaxExpansionHeight}, which is needed when * collapsing QS / the panel when QS was scrolled */ private int getTempQsMaxExpansion() { int qsTempMaxExpansion = mQsMaxExpansionHeight; if (mScrollYOverride != -1) { qsTempMaxExpansion -= mScrollYOverride; } return qsTempMaxExpansion; } private float calculatePanelHeightQsExpanded() { float notificationHeight = mNotificationStackScroller.getHeight() - mNotificationStackScroller.getEmptyBottomMargin() Loading Loading @@ -974,7 +999,6 @@ public class NotificationPanelView extends PanelView implements mIsExpanding = true; mQsExpandedWhenExpandingStarted = mQsExpanded; if (mQsExpanded) { mScrollYOverride = mScrollView.getScrollY(); onQsExpansionStarted(); } } Loading Loading @@ -1196,4 +1220,12 @@ public class NotificationPanelView extends PanelView implements protected boolean isTrackingBlocked() { return mConflictingQsExpansionGesture && mQsExpanded; } public void notifyVisibleChildrenChanged() { if (mNotificationStackScroller.getNotGoneChildCount() != 0) { mReserveNotificationSpace.setVisibility(View.VISIBLE); } else { mReserveNotificationSpace.setVisibility(View.GONE); } } } packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +6 −0 Original line number Diff line number Diff line Loading @@ -1304,6 +1304,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } @Override protected void updateRowStates() { super.updateRowStates(); mNotificationPanel.notifyVisibleChildrenChanged(); } protected void updateCarrierLabelVisibility(boolean force) { // TODO: Handle this for the notification stack scroller as well if (!mShowCarrierInPanel) return; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java +2 −2 Original line number Diff line number Diff line Loading @@ -308,8 +308,8 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL } } public void setExpansion(float height) { height = (height - mCollapsedHeight) * EXPANSION_RUBBERBAND_FACTOR + mCollapsedHeight; public void setExpansion(float t) { float height = mCollapsedHeight + t * (mExpandedHeight - mCollapsedHeight); if (height < mCollapsedHeight) { height = mCollapsedHeight; } Loading Loading
packages/SystemUI/res/layout/status_bar_expanded.xml +7 −3 Original line number Diff line number Diff line Loading @@ -86,10 +86,14 @@ <!-- A view to reserve space for the collapsed stack --> <!-- Layout height: notification_min_height + bottom_stack_peek_amount --> <View android:layout_height="76dp" 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_marginBottom="@dimen/notification_side_padding"/> android:layout_marginTop="@dimen/notifications_top_padding" /> <View android:layout_height="@dimen/notification_side_padding" android:layout_width="match_parent" /> </LinearLayout> </com.android.systemui.statusbar.phone.ObservableScrollView> Loading
packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,9 @@ <!-- Space reserved for the cards behind the top card in the bottom stack --> <dimen name="bottom_stack_peek_amount">12dp</dimen> <!-- bottom_stack_peek_amount + notification_min_height --> <dimen name="min_stack_height">76dp</dimen> <!-- The height of the area before the bottom stack in which the notifications slow down --> <dimen name="bottom_stack_slow_down_length">12dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +41 −9 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ public class NotificationPanelView extends PanelView implements private View mKeyguardStatusView; private ObservableScrollView mScrollView; private TextView mClockView; private View mReserveNotificationSpace; private MirrorView mSystemIconsCopy; private NotificationStackScrollLayout mNotificationStackScroller; Loading Loading @@ -154,6 +154,7 @@ public class NotificationPanelView extends PanelView implements mClockView = (TextView) findViewById(R.id.clock_view); mScrollView = (ObservableScrollView) findViewById(R.id.scroll_view); mScrollView.setListener(this); mReserveNotificationSpace = findViewById(R.id.reserve_notification_space); mNotificationStackScroller = (NotificationStackScrollLayout) findViewById(R.id.notification_stack_scroller); mNotificationStackScroller.setOnHeightChangedListener(this); Loading Loading @@ -357,6 +358,13 @@ public class NotificationPanelView extends PanelView implements if (shouldQuickSettingsIntercept(mInitialTouchX, mInitialTouchY, 0)) { getParent().requestDisallowInterceptTouchEvent(true); } if (mQsExpansionAnimator != null) { onQsExpansionStarted(); mInitialHeightOnTouch = mQsExpansionHeight; mQsTracking = true; mIntercepting = false; mNotificationStackScroller.removeLongPressCallback(); } break; case MotionEvent.ACTION_POINTER_UP: final int upPointer = event.getPointerId(event.getActionIndex()); Loading Loading @@ -434,8 +442,9 @@ public class NotificationPanelView extends PanelView implements private float getQsExpansionFraction() { return (mQsExpansionHeight - mQsMinExpansionHeight) / (mQsMaxExpansionHeight - mQsMinExpansionHeight); / (getTempQsMaxExpansion() - mQsMinExpansionHeight); } @Override public boolean onTouchEvent(MotionEvent event) { if (mBlockTouches) { Loading Loading @@ -541,6 +550,8 @@ public class NotificationPanelView extends PanelView implements if ((fraction != 0f || y >= mInitialTouchY) && (fraction != 1f || y <= mInitialTouchY)) { flingQsWithCurrentVelocity(); } else { mScrollYOverride = -1; } if (mVelocityTracker != null) { mVelocityTracker.recycle(); Loading Loading @@ -593,6 +604,9 @@ public class NotificationPanelView extends PanelView implements // Reset scroll position and apply that position to the expanded height. float height = mQsExpansionHeight - mScrollView.getScrollY() - overscrollAmount; if (mScrollView.getScrollY() != 0) { mScrollYOverride = mScrollView.getScrollY(); } mScrollView.scrollTo(0, 0); setQsExpansion(height); } Loading Loading @@ -639,7 +653,7 @@ public class NotificationPanelView extends PanelView implements setQsExpanded(false); } mQsExpansionHeight = height; mHeader.setExpansion(height - mQsPeekHeight); mHeader.setExpansion(getQsExpansionFraction()); setQsTranslation(height); requestScrollerTopPaddingUpdate(false /* animate */); updateNotificationScrim(height); Loading Loading @@ -698,6 +712,7 @@ public class NotificationPanelView extends PanelView implements private void flingSettings(float vel, boolean expand, final Runnable onFinishRunnable) { float target = expand ? mQsMaxExpansionHeight : mQsMinExpansionHeight; if (target == mQsExpansionHeight) { mScrollYOverride = -1; if (onFinishRunnable != null) { onFinishRunnable.run(); } Loading @@ -714,6 +729,7 @@ public class NotificationPanelView extends PanelView implements animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mScrollYOverride = -1; mQsExpansionAnimator = null; if (onFinishRunnable != null) { onFinishRunnable.run(); Loading Loading @@ -827,12 +843,9 @@ public class NotificationPanelView extends PanelView implements float panelHeightQsExpanded = calculatePanelHeightQsExpanded(); float t = (expandedHeight - panelHeightQsCollapsed) / (panelHeightQsExpanded - panelHeightQsCollapsed); int qsTempMaxExpansion = mQsMaxExpansionHeight; if (mScrollYOverride != -1) { qsTempMaxExpansion -= mScrollYOverride; } setQsExpansion(mQsMinExpansionHeight + t * (qsTempMaxExpansion - mQsMinExpansionHeight)); + t * (getTempQsMaxExpansion() - mQsMinExpansionHeight)); } mNotificationStackScroller.setStackHeight(expandedHeight); updateHeader(); Loading @@ -840,6 +853,18 @@ public class NotificationPanelView extends PanelView implements updateNotificationTranslucency(); } /** * @return a temporary override of {@link #mQsMaxExpansionHeight}, which is needed when * collapsing QS / the panel when QS was scrolled */ private int getTempQsMaxExpansion() { int qsTempMaxExpansion = mQsMaxExpansionHeight; if (mScrollYOverride != -1) { qsTempMaxExpansion -= mScrollYOverride; } return qsTempMaxExpansion; } private float calculatePanelHeightQsExpanded() { float notificationHeight = mNotificationStackScroller.getHeight() - mNotificationStackScroller.getEmptyBottomMargin() Loading Loading @@ -974,7 +999,6 @@ public class NotificationPanelView extends PanelView implements mIsExpanding = true; mQsExpandedWhenExpandingStarted = mQsExpanded; if (mQsExpanded) { mScrollYOverride = mScrollView.getScrollY(); onQsExpansionStarted(); } } Loading Loading @@ -1196,4 +1220,12 @@ public class NotificationPanelView extends PanelView implements protected boolean isTrackingBlocked() { return mConflictingQsExpansionGesture && mQsExpanded; } public void notifyVisibleChildrenChanged() { if (mNotificationStackScroller.getNotGoneChildCount() != 0) { mReserveNotificationSpace.setVisibility(View.VISIBLE); } else { mReserveNotificationSpace.setVisibility(View.GONE); } } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +6 −0 Original line number Diff line number Diff line Loading @@ -1304,6 +1304,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } @Override protected void updateRowStates() { super.updateRowStates(); mNotificationPanel.notifyVisibleChildrenChanged(); } protected void updateCarrierLabelVisibility(boolean force) { // TODO: Handle this for the notification stack scroller as well if (!mShowCarrierInPanel) return; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java +2 −2 Original line number Diff line number Diff line Loading @@ -308,8 +308,8 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL } } public void setExpansion(float height) { height = (height - mCollapsedHeight) * EXPANSION_RUBBERBAND_FACTOR + mCollapsedHeight; public void setExpansion(float t) { float height = mCollapsedHeight + t * (mExpandedHeight - mCollapsedHeight); if (height < mCollapsedHeight) { height = mCollapsedHeight; } Loading