diff options
3 files changed, 18 insertions, 28 deletions
diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml index 4eab9c73a42b..cc449c58cb42 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded.xml @@ -50,6 +50,10 @@ android:visibility="gone" /> + <include + layout="@layout/keyguard_bottom_area" + android:visibility="gone" /> + <com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer android:layout_width="match_parent" android:layout_height="match_parent" @@ -115,10 +119,6 @@ <include layout="@layout/status_bar_expanded_header" /> - <include - layout="@layout/keyguard_bottom_area" - android:visibility="gone" /> - <com.android.systemui.statusbar.AlphaOptimizedView android:id="@+id/qs_navbar_scrim" android:layout_height="96dp" diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index a09dfe154506..5415d196c171 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -323,7 +323,7 @@ <dimen name="volume_panel_z">3dp</dimen> <!-- Distance between notifications and header when they are considered to be colliding. --> - <dimen name="header_notifications_collide_distance">24dp</dimen> + <dimen name="header_notifications_collide_distance">48dp</dimen> <!-- Distance the user needs to drag vertically such that a swipe is accepted to unlock the device. --> 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 55b82fc34345..42ae0c94fb8d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -24,6 +24,7 @@ import android.animation.ValueAnimator; import android.content.Context; import android.content.res.Configuration; import android.util.AttributeSet; +import android.util.MathUtils; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; @@ -104,7 +105,6 @@ public class NotificationPanelView extends PanelView implements private boolean mQsFullyExpanded; private boolean mKeyguardShowing; private boolean mDozing; - private boolean mKeyguardStatusBarTransparent; private int mStatusBarState; private float mInitialHeightOnTouch; private float mInitialTouchX; @@ -277,6 +277,7 @@ public class NotificationPanelView extends PanelView implements setQsExpansion(mQsMinExpansionHeight + mLastOverscroll); positionClockAndNotifications(); mNotificationStackScroller.setStackHeight(getExpandedHeight()); + updateHeader(); } mNotificationStackScroller.updateIsSmallScreen( mHeader.getCollapsedHeight() + mQsPeekHeight); @@ -993,15 +994,7 @@ public class NotificationPanelView extends PanelView implements requestScrollerTopPaddingUpdate(false /* animate */); updateNotificationScrim(height); if (mKeyguardShowing) { - float alpha = getQsExpansionFraction(); - alpha *= 2; - alpha = Math.min(1, alpha); - alpha = 1 - alpha; - mKeyguardStatusBarTransparent = alpha == 0f; - updateKeyguardStatusBarVisibility(); - if (!mKeyguardStatusBarTransparent) { - mKeyguardStatusBar.setAlpha(alpha); - } + updateHeaderKeyguard(); } if (mStatusBarState == StatusBarState.SHADE && mQsExpanded && !mStackScrollerOverscrolling && mQsScrimEnabled) { @@ -1352,27 +1345,25 @@ public class NotificationPanelView extends PanelView implements } private void updateHeaderKeyguard() { - float alpha; + float alphaNotifications; if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) { // When on Keyguard, we hide the header as soon as the top card of the notification // stack scroller is close enough (collision distance) to the bottom of the header. - alpha = getNotificationsTopY() + alphaNotifications = getNotificationsTopY() / - (mQsMinExpansionHeight + mNotificationsHeaderCollideDistance); - + (mKeyguardStatusBar.getHeight() + mNotificationsHeaderCollideDistance); } else { // In SHADE_LOCKED, the top card is already really close to the header. Hide it as // soon as we start translating the stack. - alpha = getNotificationsTopY() / mQsMinExpansionHeight; - } - alpha = Math.max(0, Math.min(alpha, 1)); - alpha = (float) Math.pow(alpha, 0.75); - if (!mQsExpanded) { - mKeyguardStatusBar.setAlpha(alpha); + alphaNotifications = getNotificationsTopY() / mKeyguardStatusBar.getHeight(); } - mKeyguardBottomArea.setAlpha(alpha); + alphaNotifications = MathUtils.constrain(alphaNotifications, 0, 1); + alphaNotifications = (float) Math.pow(alphaNotifications, 0.75); + float alphaQsExpansion = 1 - Math.min(1, getQsExpansionFraction() * 2); + mKeyguardStatusBar.setAlpha(Math.min(alphaNotifications, alphaQsExpansion)); + mKeyguardBottomArea.setAlpha(Math.min(1 - getQsExpansionFraction(), alphaNotifications)); setQsTranslation(mQsExpansionHeight); } @@ -1716,8 +1707,7 @@ public class NotificationPanelView extends PanelView implements } private void updateKeyguardStatusBarVisibility() { - mKeyguardStatusBar.setVisibility(mKeyguardShowing && !mKeyguardStatusBarTransparent - && !mDozing ? VISIBLE : INVISIBLE); + mKeyguardStatusBar.setVisibility(mKeyguardShowing && !mDozing ? VISIBLE : INVISIBLE); } public void setDozing(boolean dozing) { |