Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cca41d65 authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Alignment of pulsing notifications" into pi-dev

parents be72f3d5 5605734a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@
    <dimen name="widget_title_font_size">24sp</dimen>
    <!-- Slice subtitle  -->
    <dimen name="widget_label_font_size">16sp</dimen>
    <!-- Slice offset when pulsing -->
    <dimen name="widget_pulsing_bottom_padding">24dp</dimen>
    <!-- Clock without header -->
    <dimen name="widget_big_font_size">64dp</dimen>
    <!-- Clock with header -->
+19 −8
Original line number Diff line number Diff line
@@ -98,6 +98,11 @@ public class KeyguardClockPositionAlgorithm {
     */
    private int mBurnInPreventionOffsetY;

    /**
     * Clock vertical padding when pulsing.
     */
    private int mPulsingPadding;

    /**
     * Doze/AOD transition amount.
     */
@@ -109,9 +114,9 @@ public class KeyguardClockPositionAlgorithm {
    private boolean mCurrentlySecure;

    /**
     * If notification panel view currently has a touch.
     * Dozing and receiving a notification (AOD notification.)
     */
    private boolean mTracking;
    private boolean mPulsing;

    /**
     * Distance in pixels between the top of the screen and the first view of the bouncer.
@@ -130,11 +135,13 @@ public class KeyguardClockPositionAlgorithm {
                R.dimen.burn_in_prevention_offset_x);
        mBurnInPreventionOffsetY = res.getDimensionPixelSize(
                R.dimen.burn_in_prevention_offset_y);
        mPulsingPadding = res.getDimensionPixelSize(
                R.dimen.widget_pulsing_bottom_padding);
    }

    public void setup(int minTopMargin, int maxShadeBottom, int notificationStackHeight,
            float expandedHeight, float maxPanelHeight, int parentHeight, int keyguardStatusHeight,
            float dark, boolean secure, boolean tracking, int bouncerTop) {
            float dark, boolean secure, boolean pulsing, int bouncerTop) {
        mMinTopMargin = minTopMargin + mContainerTopPadding;
        mMaxShadeBottom = maxShadeBottom;
        mNotificationStackHeight = notificationStackHeight;
@@ -144,7 +151,7 @@ public class KeyguardClockPositionAlgorithm {
        mKeyguardStatusHeight = keyguardStatusHeight;
        mDarkAmount = dark;
        mCurrentlySecure = secure;
        mTracking = tracking;
        mPulsing = pulsing;
        mBouncerTop = bouncerTop;
    }

@@ -152,7 +159,7 @@ public class KeyguardClockPositionAlgorithm {
        final int y = getClockY();
        result.clockY = y;
        result.clockAlpha = getClockAlpha(y);
        result.stackScrollerPadding = y + mKeyguardStatusHeight;
        result.stackScrollerPadding = y + (mPulsing ? 0 : mKeyguardStatusHeight);
        result.clockX = (int) interpolate(0, burnInPreventionOffsetX(), mDarkAmount);
    }

@@ -194,9 +201,13 @@ public class KeyguardClockPositionAlgorithm {

    private int getClockY() {
        // Dark: Align the bottom edge of the clock at about half of the screen:
        final float clockYDark = getMaxClockY() + burnInPreventionOffsetY();
        final float clockYRegular = getExpandedClockPosition();
        final boolean hasEnoughSpace = mMinTopMargin + mKeyguardStatusHeight < mBouncerTop;
        float clockYDark = getMaxClockY() + burnInPreventionOffsetY();
        if (mPulsing) {
            clockYDark -= mPulsingPadding;
        }

        float clockYRegular = getExpandedClockPosition();
        boolean hasEnoughSpace = mMinTopMargin + mKeyguardStatusHeight < mBouncerTop;
        float clockYTarget = mCurrentlySecure && hasEnoughSpace ?
                mMinTopMargin : -mKeyguardStatusHeight;

+3 −8
Original line number Diff line number Diff line
@@ -238,6 +238,7 @@ public class NotificationPanelView extends PanelView implements
    private boolean mIsFullWidth;
    private float mDarkAmount;
    private float mDarkAmountTarget;
    private boolean mPulsing;
    private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger();
    private boolean mNoVisibleNotifications = true;
    private ValueAnimator mDarkAnimator;
@@ -477,7 +478,7 @@ public class NotificationPanelView extends PanelView implements
                    mKeyguardStatusView.getHeight(),
                    mDarkAmount,
                    mStatusBar.isKeyguardCurrentlySecure(),
                    mTracking,
                    mPulsing,
                    mBouncerTop);
            mClockPositionAlgorithm.run(mClockPositionResult);
            if (animate || mClockAnimator != null) {
@@ -2689,14 +2690,8 @@ public class NotificationPanelView extends PanelView implements
        positionClockAndNotifications();
    }

    public void setNoVisibleNotifications(boolean noNotifications) {
        mNoVisibleNotifications = noNotifications;
        if (mQs != null) {
            mQs.setHasNotifications(!noNotifications);
        }
    }

    public void setPulsing(boolean pulsing) {
        mPulsing = pulsing;
        mKeyguardStatusView.setPulsing(pulsing);
        positionClockAndNotifications();
        mNotificationStackScroller.setPulsing(pulsing, mKeyguardStatusView.getLocationOnScreen()[1]