Loading packages/SystemUI/animation/src/com/android/systemui/animation/Interpolators.java +13 −0 Original line number Diff line number Diff line Loading @@ -70,4 +70,17 @@ public class Interpolators { */ public static final Interpolator TOUCH_RESPONSE_REVERSE = new PathInterpolator(0.9f, 0f, 0.7f, 1f); /** * Interpolate alpha for notifications background scrim during shade expansion. * @param fraction Shade expansion fraction */ public static float getNotificationScrimAlpha(float fraction) { fraction = fraction * 1.2f - 0.2f; if (fraction <= 0) { return 0; } else { return (float) (1f - 0.5f * (1f - Math.cos(3.14159f * Math.pow(1f - fraction, 2f)))); } } } packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +8 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.view.WindowInsets; import android.view.accessibility.AccessibilityNodeInfo; import com.android.internal.annotations.VisibleForTesting; import com.android.systemui.animation.Interpolators; import com.android.systemui.R; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; import com.android.systemui.statusbar.notification.NotificationUtils; Loading Loading @@ -176,7 +177,13 @@ public class NotificationShelf extends ActivatableNotificationView implements viewState.height = getIntrinsicHeight(); viewState.zTranslation = ambientState.getBaseZHeight(); viewState.clipTopAmount = 0; if (ambientState.isExpansionChanging() && !ambientState.isOnKeyguard()) { viewState.alpha = Interpolators.getNotificationScrimAlpha( ambientState.getExpansionFraction()); } else { viewState.alpha = 1f - ambientState.getHideAmount(); } viewState.belowSpeedBump = mHostLayoutController.getSpeedBumpIndex() == 0; viewState.hideSensitive = false; viewState.xTranslation = getTranslationX(); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +8 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.util.MathUtils; import android.view.View; import android.view.ViewGroup; import com.android.systemui.animation.Interpolators; import com.android.systemui.R; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.notification.dagger.SilentHeader; Loading Loading @@ -374,7 +375,13 @@ public class StackScrollAlgorithm { ExpandableView view = algorithmState.visibleChildren.get(i); ExpandableViewState viewState = view.getViewState(); viewState.location = ExpandableViewState.LOCATION_UNKNOWN; if (ambientState.isExpansionChanging() && !ambientState.isOnKeyguard()) { viewState.alpha = Interpolators.getNotificationScrimAlpha( ambientState.getExpansionFraction()); } else { viewState.alpha = 1f - ambientState.getHideAmount(); } if (view.mustStayOnScreen() && viewState.yTranslation >= 0) { // Even if we're not scrolled away we're in view and we're also not in the Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +2 −9 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.internal.util.function.TriConsumer; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.settingslib.Utils; import com.android.systemui.animation.Interpolators; import com.android.systemui.DejankUtils; import com.android.systemui.Dumpable; import com.android.systemui.R; Loading Loading @@ -810,15 +811,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump } private float getInterpolatedFraction() { float frac = mPanelExpansion; // let's start this 20% of the way down the screen frac = frac * 1.2f - 0.2f; if (frac <= 0) { return 0; } else { // woo, special effects return (float) (1f - 0.5f * (1f - Math.cos(3.14159f * Math.pow(1f - frac, 2f)))); } return Interpolators.getNotificationScrimAlpha(mPanelExpansion); } private void setScrimAlpha(ScrimView scrim, float alpha) { Loading Loading
packages/SystemUI/animation/src/com/android/systemui/animation/Interpolators.java +13 −0 Original line number Diff line number Diff line Loading @@ -70,4 +70,17 @@ public class Interpolators { */ public static final Interpolator TOUCH_RESPONSE_REVERSE = new PathInterpolator(0.9f, 0f, 0.7f, 1f); /** * Interpolate alpha for notifications background scrim during shade expansion. * @param fraction Shade expansion fraction */ public static float getNotificationScrimAlpha(float fraction) { fraction = fraction * 1.2f - 0.2f; if (fraction <= 0) { return 0; } else { return (float) (1f - 0.5f * (1f - Math.cos(3.14159f * Math.pow(1f - fraction, 2f)))); } } }
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +8 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.view.WindowInsets; import android.view.accessibility.AccessibilityNodeInfo; import com.android.internal.annotations.VisibleForTesting; import com.android.systemui.animation.Interpolators; import com.android.systemui.R; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; import com.android.systemui.statusbar.notification.NotificationUtils; Loading Loading @@ -176,7 +177,13 @@ public class NotificationShelf extends ActivatableNotificationView implements viewState.height = getIntrinsicHeight(); viewState.zTranslation = ambientState.getBaseZHeight(); viewState.clipTopAmount = 0; if (ambientState.isExpansionChanging() && !ambientState.isOnKeyguard()) { viewState.alpha = Interpolators.getNotificationScrimAlpha( ambientState.getExpansionFraction()); } else { viewState.alpha = 1f - ambientState.getHideAmount(); } viewState.belowSpeedBump = mHostLayoutController.getSpeedBumpIndex() == 0; viewState.hideSensitive = false; viewState.xTranslation = getTranslationX(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +8 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.util.MathUtils; import android.view.View; import android.view.ViewGroup; import com.android.systemui.animation.Interpolators; import com.android.systemui.R; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.notification.dagger.SilentHeader; Loading Loading @@ -374,7 +375,13 @@ public class StackScrollAlgorithm { ExpandableView view = algorithmState.visibleChildren.get(i); ExpandableViewState viewState = view.getViewState(); viewState.location = ExpandableViewState.LOCATION_UNKNOWN; if (ambientState.isExpansionChanging() && !ambientState.isOnKeyguard()) { viewState.alpha = Interpolators.getNotificationScrimAlpha( ambientState.getExpansionFraction()); } else { viewState.alpha = 1f - ambientState.getHideAmount(); } if (view.mustStayOnScreen() && viewState.yTranslation >= 0) { // Even if we're not scrolled away we're in view and we're also not in the Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +2 −9 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.internal.util.function.TriConsumer; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.settingslib.Utils; import com.android.systemui.animation.Interpolators; import com.android.systemui.DejankUtils; import com.android.systemui.Dumpable; import com.android.systemui.R; Loading Loading @@ -810,15 +811,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump } private float getInterpolatedFraction() { float frac = mPanelExpansion; // let's start this 20% of the way down the screen frac = frac * 1.2f - 0.2f; if (frac <= 0) { return 0; } else { // woo, special effects return (float) (1f - 0.5f * (1f - Math.cos(3.14159f * Math.pow(1f - frac, 2f)))); } return Interpolators.getNotificationScrimAlpha(mPanelExpansion); } private void setScrimAlpha(ScrimView scrim, float alpha) { Loading