Loading libs/WindowManager/Shell/src/com/android/wm/shell/animation/FlingAnimationUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -311,6 +311,13 @@ public class FlingAnimationUtils { return mMinVelocityPxPerSecond; } /** * @return a velocity considered fast */ public float getHighVelocityPxPerSecond() { return mHighVelocityPxPerSecond; } /** * An interpolator which interpolates two interpolators with an interpolator. */ Loading packages/SystemUI/animation/src/com/android/systemui/animation/Interpolators.java +10 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,16 @@ public class Interpolators { (float) (1.0f - Math.exp(-b * progress)) * (overshootAmount + 1.0f)); } /** * Similar to {@link #getOvershootInterpolation(float, float, float)} but the overshoot * starts immediately here, instead of first having a section of non-overshooting * * @param progress a progress value going from 0 to 1 */ public static float getOvershootInterpolation(float progress) { return MathUtils.max(0.0f, (float) (1.0f - Math.exp(-4 * progress))); } /** * Interpolate alpha for notifications background scrim during shade expansion. * @param fraction Shade expansion fraction Loading packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,9 @@ <!-- Move distance for the unlock hint animation on the lockscreen --> <dimen name="hint_move_distance">75dp</dimen> <!-- The overshoot amount when the panel flings open --> <dimen name="panel_overshoot_amount">16dp</dimen> <!-- The width of the region on the left/right edge of the screen for performing the camera/ phone hints. --> <dimen name="edge_tap_area_width">48dp</dimen> Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +5 −5 Original line number Diff line number Diff line Loading @@ -83,7 +83,7 @@ public class AmbientState { private ExpandableNotificationRow mTrackedHeadsUpRow; private float mAppearFraction; private boolean mIsShadeOpening; private float mSectionPadding; private float mOverExpansion; /** Distance of top of notifications panel from top of screen. */ private float mStackY = 0; Loading Loading @@ -182,12 +182,12 @@ public class AmbientState { return mIsShadeOpening; } void setSectionPadding(float padding) { mSectionPadding = padding; void setOverExpansion(float overExpansion) { mOverExpansion = overExpansion; } float getSectionPadding() { return mSectionPadding; float getOverExpansion() { return mOverExpansion; } private static int getZDistanceBetweenElements(Context context) { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +23 −7 Original line number Diff line number Diff line Loading @@ -119,6 +119,7 @@ import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.function.BiConsumer; import java.util.function.Consumer; import javax.inject.Inject; import javax.inject.Named; Loading Loading @@ -470,6 +471,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } }; private Consumer<Integer> mScrollListener; private final ScrollAdapter mScrollAdapter = new ScrollAdapter() { @Override public boolean isScrolledToTop() { Loading Loading @@ -552,8 +554,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } } void setSectionPadding(float margin) { mAmbientState.setSectionPadding(margin); /** * Set the overexpansion of the panel to be applied to the view. */ void setOverExpansion(float margin) { mAmbientState.setOverExpansion(margin); updateStackPosition(); requestChildrenUpdate(); } Loading Loading @@ -1136,7 +1142,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable */ private void updateStackPosition() { // Consider interpolating from an mExpansionStartY for use on lockscreen and AOD float endTopPosition = mTopPadding + mExtraTopInsetForFullShadeTransition; float endTopPosition = mTopPadding + mExtraTopInsetForFullShadeTransition + mAmbientState.getOverExpansion(); final float fraction = mAmbientState.getExpansionFraction(); final float stackY = MathUtils.lerp(0, endTopPosition, fraction); mAmbientState.setStackY(stackY); Loading @@ -1144,7 +1151,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mOnStackYChanged.run(); } if (mQsExpansionFraction <= 0) { final float scrimTopPadding = mAmbientState.isOnKeyguard() ? 0 : mSidePaddings; final float stackEndHeight = Math.max(0f, getHeight() - getEmptyBottomMargin() - mTopPadding); mAmbientState.setStackEndHeight(stackEndHeight); Loading @@ -1166,7 +1172,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable @ShadeViewRefactor(RefactorComponent.COORDINATOR) public void setExpandedHeight(float height) { final float shadeBottom = getHeight() - getEmptyBottomMargin(); final float expansionFraction = MathUtils.constrain(height / shadeBottom, 0f, 1f); final float expansionFraction = MathUtils.saturate(height / shadeBottom); mAmbientState.setExpansionFraction(expansionFraction); updateStackPosition(); Loading Loading @@ -2395,8 +2401,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable float topOverScroll = getCurrentOverScrollAmount(true); return mScrolledToTopOnFirstDown && !mExpandedInThisMotion && topOverScroll > mMinTopOverScrollToEscape && initialVelocity > 0; && (initialVelocity > mMinimumVelocity || (topOverScroll > mMinTopOverScrollToEscape && initialVelocity > 0)); } /** Loading Loading @@ -4552,6 +4558,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } private void updateOnScrollChange() { if (mScrollListener != null) { mScrollListener.accept(mOwnScrollY); } updateForwardAndBackwardScrollability(); requestChildrenUpdate(); } Loading Loading @@ -5162,6 +5171,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable requestChildrenUpdate(); } /** * Set a listener to when scrolling changes. */ public void setOnScrollListener(Consumer<Integer> listener) { mScrollListener = listener; } /** * A listener that is notified when the empty space below the notifications is clicked on */ Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/animation/FlingAnimationUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -311,6 +311,13 @@ public class FlingAnimationUtils { return mMinVelocityPxPerSecond; } /** * @return a velocity considered fast */ public float getHighVelocityPxPerSecond() { return mHighVelocityPxPerSecond; } /** * An interpolator which interpolates two interpolators with an interpolator. */ Loading
packages/SystemUI/animation/src/com/android/systemui/animation/Interpolators.java +10 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,16 @@ public class Interpolators { (float) (1.0f - Math.exp(-b * progress)) * (overshootAmount + 1.0f)); } /** * Similar to {@link #getOvershootInterpolation(float, float, float)} but the overshoot * starts immediately here, instead of first having a section of non-overshooting * * @param progress a progress value going from 0 to 1 */ public static float getOvershootInterpolation(float progress) { return MathUtils.max(0.0f, (float) (1.0f - Math.exp(-4 * progress))); } /** * Interpolate alpha for notifications background scrim during shade expansion. * @param fraction Shade expansion fraction Loading
packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,9 @@ <!-- Move distance for the unlock hint animation on the lockscreen --> <dimen name="hint_move_distance">75dp</dimen> <!-- The overshoot amount when the panel flings open --> <dimen name="panel_overshoot_amount">16dp</dimen> <!-- The width of the region on the left/right edge of the screen for performing the camera/ phone hints. --> <dimen name="edge_tap_area_width">48dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +5 −5 Original line number Diff line number Diff line Loading @@ -83,7 +83,7 @@ public class AmbientState { private ExpandableNotificationRow mTrackedHeadsUpRow; private float mAppearFraction; private boolean mIsShadeOpening; private float mSectionPadding; private float mOverExpansion; /** Distance of top of notifications panel from top of screen. */ private float mStackY = 0; Loading Loading @@ -182,12 +182,12 @@ public class AmbientState { return mIsShadeOpening; } void setSectionPadding(float padding) { mSectionPadding = padding; void setOverExpansion(float overExpansion) { mOverExpansion = overExpansion; } float getSectionPadding() { return mSectionPadding; float getOverExpansion() { return mOverExpansion; } private static int getZDistanceBetweenElements(Context context) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +23 −7 Original line number Diff line number Diff line Loading @@ -119,6 +119,7 @@ import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.function.BiConsumer; import java.util.function.Consumer; import javax.inject.Inject; import javax.inject.Named; Loading Loading @@ -470,6 +471,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } }; private Consumer<Integer> mScrollListener; private final ScrollAdapter mScrollAdapter = new ScrollAdapter() { @Override public boolean isScrolledToTop() { Loading Loading @@ -552,8 +554,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } } void setSectionPadding(float margin) { mAmbientState.setSectionPadding(margin); /** * Set the overexpansion of the panel to be applied to the view. */ void setOverExpansion(float margin) { mAmbientState.setOverExpansion(margin); updateStackPosition(); requestChildrenUpdate(); } Loading Loading @@ -1136,7 +1142,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable */ private void updateStackPosition() { // Consider interpolating from an mExpansionStartY for use on lockscreen and AOD float endTopPosition = mTopPadding + mExtraTopInsetForFullShadeTransition; float endTopPosition = mTopPadding + mExtraTopInsetForFullShadeTransition + mAmbientState.getOverExpansion(); final float fraction = mAmbientState.getExpansionFraction(); final float stackY = MathUtils.lerp(0, endTopPosition, fraction); mAmbientState.setStackY(stackY); Loading @@ -1144,7 +1151,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mOnStackYChanged.run(); } if (mQsExpansionFraction <= 0) { final float scrimTopPadding = mAmbientState.isOnKeyguard() ? 0 : mSidePaddings; final float stackEndHeight = Math.max(0f, getHeight() - getEmptyBottomMargin() - mTopPadding); mAmbientState.setStackEndHeight(stackEndHeight); Loading @@ -1166,7 +1172,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable @ShadeViewRefactor(RefactorComponent.COORDINATOR) public void setExpandedHeight(float height) { final float shadeBottom = getHeight() - getEmptyBottomMargin(); final float expansionFraction = MathUtils.constrain(height / shadeBottom, 0f, 1f); final float expansionFraction = MathUtils.saturate(height / shadeBottom); mAmbientState.setExpansionFraction(expansionFraction); updateStackPosition(); Loading Loading @@ -2395,8 +2401,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable float topOverScroll = getCurrentOverScrollAmount(true); return mScrolledToTopOnFirstDown && !mExpandedInThisMotion && topOverScroll > mMinTopOverScrollToEscape && initialVelocity > 0; && (initialVelocity > mMinimumVelocity || (topOverScroll > mMinTopOverScrollToEscape && initialVelocity > 0)); } /** Loading Loading @@ -4552,6 +4558,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } private void updateOnScrollChange() { if (mScrollListener != null) { mScrollListener.accept(mOwnScrollY); } updateForwardAndBackwardScrollability(); requestChildrenUpdate(); } Loading Loading @@ -5162,6 +5171,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable requestChildrenUpdate(); } /** * Set a listener to when scrolling changes. */ public void setOnScrollListener(Consumer<Integer> listener) { mScrollListener = listener; } /** * A listener that is notified when the empty space below the notifications is clicked on */ Loading