Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +8 −2 Original line number Diff line number Diff line Loading @@ -78,7 +78,8 @@ class NotificationShadeDepthController @Inject constructor( private var keyguardAnimator: Animator? = null private var notificationAnimator: Animator? = null private var updateScheduled: Boolean = false private var shadeExpansion = 0f @VisibleForTesting var shadeExpansion = 0f private var isClosed: Boolean = true private var isOpen: Boolean = false private var isBlurred: Boolean = false Loading @@ -92,6 +93,9 @@ class NotificationShadeDepthController @Inject constructor( // Only for dumpsys private var lastAppliedBlur = 0 // Shade expansion offset that happens when pulling down on a HUN. var panelPullDownMinFraction = 0f var shadeAnimation = DepthAnimation() @VisibleForTesting Loading Loading @@ -312,8 +316,10 @@ class NotificationShadeDepthController @Inject constructor( /** * Update blurs when pulling down the shade */ override fun onPanelExpansionChanged(expansion: Float, tracking: Boolean) { override fun onPanelExpansionChanged(rawExpansion: Float, tracking: Boolean) { val timestamp = SystemClock.elapsedRealtimeNanos() val expansion = MathUtils.saturate( (rawExpansion - panelPullDownMinFraction) / (1f - panelPullDownMinFraction)) if (shadeExpansion == expansion && prevTracking == tracking) { prevTimestamp = timestamp Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +17 −1 Original line number Diff line number Diff line Loading @@ -635,6 +635,7 @@ public class NotificationPanelViewController extends PanelViewController { private int mQsClipBottom; private boolean mQsVisible; private final ContentResolver mContentResolver; private float mMinFraction; private final Executor mUiExecutor; private final SecureSettings mSecureSettings; Loading Loading @@ -1795,6 +1796,15 @@ public class NotificationPanelViewController extends PanelViewController { return !mQsTouchAboveFalsingThreshold; } /** * Percentage of panel expansion offset, caused by pulling down on a heads-up. */ @Override public void setMinFraction(float minFraction) { mMinFraction = minFraction; mDepthController.setPanelPullDownMinFraction(mMinFraction); } private float computeQsExpansionFraction() { if (mQSAnimatingHiddenFromCollapsed) { // When hiding QS from collapsed state, the expansion can sometimes temporarily Loading Loading @@ -2309,6 +2319,12 @@ public class NotificationPanelViewController extends PanelViewController { } } top += mOverStretchAmount; // Correction for instant expansion caused by HUN pull down/ if (mMinFraction > 0f && mMinFraction < 1f) { float realFraction = (getExpandedFraction() - mMinFraction) / (1f - mMinFraction); top *= MathUtils.saturate(realFraction / mMinFraction); } bottom = getView().getBottom(); // notification bounds should take full screen width regardless of insets left = 0; Loading Loading @@ -3439,7 +3455,7 @@ public class NotificationPanelViewController extends PanelViewController { } public void setPanelScrimMinFraction(float minFraction) { mBar.panelScrimMinFractionChanged(minFraction); mBar.onPanelMinFractionChanged(minFraction); } public void clearNotificationEffects() { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +8 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.statusbar.phone; import static java.lang.Float.isNaN; import android.annotation.CallSuper; import android.content.Context; import android.os.Bundle; import android.os.Parcelable; Loading Loading @@ -162,7 +163,13 @@ public abstract class PanelBar extends FrameLayout { return mPanel == null || mPanel.getView().dispatchTouchEvent(event); } public abstract void panelScrimMinFractionChanged(float minFraction); /** * Percentage of panel expansion offset, caused by pulling down on a heads-up. */ @CallSuper public void onPanelMinFractionChanged(float minFraction) { mPanel.setMinFraction(minFraction); } /** * @param frac the fraction from the expansion in [0, 1] Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +7 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,13 @@ public abstract class PanelViewController { protected abstract float getOpeningHeight(); /** * Minimum fraction from where expansion should start. This is set when pulling down on a * heads-up notification. * @param minFraction Fraction from 0 to 1. */ public abstract void setMinFraction(float minFraction); /** * @return whether the swiping direction is upwards and above a 45 degree angle compared to the * horizontal direction Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +2 −1 Original line number Diff line number Diff line Loading @@ -269,10 +269,11 @@ public class PhoneStatusBarView extends PanelBar { } @Override public void panelScrimMinFractionChanged(float minFraction) { public void onPanelMinFractionChanged(float minFraction) { if (isNaN(minFraction)) { throw new IllegalArgumentException("minFraction cannot be NaN"); } super.onPanelMinFractionChanged(minFraction); if (mMinFraction != minFraction) { mMinFraction = minFraction; updateScrimFraction(); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +8 −2 Original line number Diff line number Diff line Loading @@ -78,7 +78,8 @@ class NotificationShadeDepthController @Inject constructor( private var keyguardAnimator: Animator? = null private var notificationAnimator: Animator? = null private var updateScheduled: Boolean = false private var shadeExpansion = 0f @VisibleForTesting var shadeExpansion = 0f private var isClosed: Boolean = true private var isOpen: Boolean = false private var isBlurred: Boolean = false Loading @@ -92,6 +93,9 @@ class NotificationShadeDepthController @Inject constructor( // Only for dumpsys private var lastAppliedBlur = 0 // Shade expansion offset that happens when pulling down on a HUN. var panelPullDownMinFraction = 0f var shadeAnimation = DepthAnimation() @VisibleForTesting Loading Loading @@ -312,8 +316,10 @@ class NotificationShadeDepthController @Inject constructor( /** * Update blurs when pulling down the shade */ override fun onPanelExpansionChanged(expansion: Float, tracking: Boolean) { override fun onPanelExpansionChanged(rawExpansion: Float, tracking: Boolean) { val timestamp = SystemClock.elapsedRealtimeNanos() val expansion = MathUtils.saturate( (rawExpansion - panelPullDownMinFraction) / (1f - panelPullDownMinFraction)) if (shadeExpansion == expansion && prevTracking == tracking) { prevTimestamp = timestamp Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +17 −1 Original line number Diff line number Diff line Loading @@ -635,6 +635,7 @@ public class NotificationPanelViewController extends PanelViewController { private int mQsClipBottom; private boolean mQsVisible; private final ContentResolver mContentResolver; private float mMinFraction; private final Executor mUiExecutor; private final SecureSettings mSecureSettings; Loading Loading @@ -1795,6 +1796,15 @@ public class NotificationPanelViewController extends PanelViewController { return !mQsTouchAboveFalsingThreshold; } /** * Percentage of panel expansion offset, caused by pulling down on a heads-up. */ @Override public void setMinFraction(float minFraction) { mMinFraction = minFraction; mDepthController.setPanelPullDownMinFraction(mMinFraction); } private float computeQsExpansionFraction() { if (mQSAnimatingHiddenFromCollapsed) { // When hiding QS from collapsed state, the expansion can sometimes temporarily Loading Loading @@ -2309,6 +2319,12 @@ public class NotificationPanelViewController extends PanelViewController { } } top += mOverStretchAmount; // Correction for instant expansion caused by HUN pull down/ if (mMinFraction > 0f && mMinFraction < 1f) { float realFraction = (getExpandedFraction() - mMinFraction) / (1f - mMinFraction); top *= MathUtils.saturate(realFraction / mMinFraction); } bottom = getView().getBottom(); // notification bounds should take full screen width regardless of insets left = 0; Loading Loading @@ -3439,7 +3455,7 @@ public class NotificationPanelViewController extends PanelViewController { } public void setPanelScrimMinFraction(float minFraction) { mBar.panelScrimMinFractionChanged(minFraction); mBar.onPanelMinFractionChanged(minFraction); } public void clearNotificationEffects() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +8 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.statusbar.phone; import static java.lang.Float.isNaN; import android.annotation.CallSuper; import android.content.Context; import android.os.Bundle; import android.os.Parcelable; Loading Loading @@ -162,7 +163,13 @@ public abstract class PanelBar extends FrameLayout { return mPanel == null || mPanel.getView().dispatchTouchEvent(event); } public abstract void panelScrimMinFractionChanged(float minFraction); /** * Percentage of panel expansion offset, caused by pulling down on a heads-up. */ @CallSuper public void onPanelMinFractionChanged(float minFraction) { mPanel.setMinFraction(minFraction); } /** * @param frac the fraction from the expansion in [0, 1] Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +7 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,13 @@ public abstract class PanelViewController { protected abstract float getOpeningHeight(); /** * Minimum fraction from where expansion should start. This is set when pulling down on a * heads-up notification. * @param minFraction Fraction from 0 to 1. */ public abstract void setMinFraction(float minFraction); /** * @return whether the swiping direction is upwards and above a 45 degree angle compared to the * horizontal direction Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +2 −1 Original line number Diff line number Diff line Loading @@ -269,10 +269,11 @@ public class PhoneStatusBarView extends PanelBar { } @Override public void panelScrimMinFractionChanged(float minFraction) { public void onPanelMinFractionChanged(float minFraction) { if (isNaN(minFraction)) { throw new IllegalArgumentException("minFraction cannot be NaN"); } super.onPanelMinFractionChanged(minFraction); if (mMinFraction != minFraction) { mMinFraction = minFraction; updateScrimFraction(); Loading