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

Commit c934c434 authored by Adrian Roos's avatar Adrian Roos
Browse files

AoD: Reposition shelf under clock

Bug: 30876804
Test: manual
Change-Id: I9a50ee57d7acef1af866968e67feac7803801a02
parent 7a9551a3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -170,6 +170,11 @@ public class KeyguardStatusView extends GridLayout {
        }
    }

    public int getClockBottom() {
        return mClockView.getBottom() +
                ((MarginLayoutParams) mClockView.getLayoutParams()).bottomMargin;
    }

    public static String formatNextAlarm(Context context, AlarmManager.AlarmClockInfo info) {
        if (info == null) {
            return "";
+5 −5
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ public class DozeScrimController {

    private final Context mContext;
    private final View mStackScroller;
    private final KeyguardStatusView mKeyguardStatusView;
    private final NotificationPanelView mNotificationPanelView;

    private boolean mDozing;
    private DozeHost.PulseCallback mPulseCallback;
@@ -55,12 +55,12 @@ public class DozeScrimController {
    private float mBehindTarget;

    public DozeScrimController(ScrimController scrimController, Context context,
            View stackScroller, KeyguardStatusView keyguardStatusView) {
            View stackScroller, NotificationPanelView notificationPanelView) {
        mContext = context;
        mStackScroller = stackScroller;
        mScrimController = scrimController;
        mDozeParameters = new DozeParameters(context);
        mKeyguardStatusView = keyguardStatusView;
        mNotificationPanelView = notificationPanelView;
    }

    public void setDozing(boolean dozing, boolean animate) {
@@ -70,7 +70,7 @@ public class DozeScrimController {
            abortAnimations();
            mScrimController.setDozeBehindAlpha(1f);
            mScrimController.setDozeInFrontAlpha(mDozeParameters.getAlwaysOn() ? 0f : 1f);
            mKeyguardStatusView.setDark(true);
            mNotificationPanelView.setDark(true);
        } else {
            cancelPulsing();
            if (animate) {
@@ -86,7 +86,7 @@ public class DozeScrimController {
                mScrimController.setDozeInFrontAlpha(0f);
            }
            // TODO: animate
            mKeyguardStatusView.setDark(false);
            mNotificationPanelView.setDark(false);
        }
    }

+9 −1
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ public class KeyguardClockPositionAlgorithm {
    }

    private AccelerateInterpolator mAccelerateInterpolator = new AccelerateInterpolator();
    private int mClockBottom;
    private boolean mDark;

    /**
     * Refreshes the dimension values.
@@ -86,7 +88,8 @@ public class KeyguardClockPositionAlgorithm {
    }

    public void setup(int maxKeyguardNotifications, int maxPanelHeight, float expandedHeight,
            int notificationCount, int height, int keyguardStatusHeight, float emptyDragAmount) {
            int notificationCount, int height, int keyguardStatusHeight, float emptyDragAmount,
            int clockBottom, boolean dark) {
        mMaxKeyguardNotifications = maxKeyguardNotifications;
        mMaxPanelHeight = maxPanelHeight;
        mExpandedHeight = expandedHeight;
@@ -94,6 +97,8 @@ public class KeyguardClockPositionAlgorithm {
        mHeight = height;
        mKeyguardStatusHeight = keyguardStatusHeight;
        mEmptyDragAmount = emptyDragAmount;
        mClockBottom = clockBottom;
        mDark = dark;
    }

    public float getMinStackScrollerPadding(int height, int keyguardStatusHeight) {
@@ -115,6 +120,9 @@ public class KeyguardClockPositionAlgorithm {
                result.clockY,
                y + getClockNotificationsPadding() + mKeyguardStatusHeight);
        result.clockAlpha = getClockAlpha(result.clockScale);
        if (mDark) {
            result.stackScrollerPadding = mClockBottom + y;
        }
    }

    private float getClockScale(int notificationPadding, int clockY, int startPadding) {
+10 −1
Original line number Diff line number Diff line
@@ -211,6 +211,7 @@ public class NotificationPanelView extends PanelView implements
    private boolean mOpening;
    private int mIndicationBottomPadding;
    private boolean mIsFullWidth;
    private boolean mDark;

    public NotificationPanelView(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -391,7 +392,9 @@ public class NotificationPanelView extends PanelView implements
                    mNotificationStackScroller.getNotGoneChildCount(),
                    getHeight(),
                    mKeyguardStatusView.getHeight(),
                    mEmptyDragAmount);
                    mEmptyDragAmount,
                    mKeyguardStatusView.getClockBottom(),
                    mDark);
            mClockPositionAlgorithm.run(mClockPositionResult);
            if (animate || mClockAnimator != null) {
                startClockAnimation(mClockPositionResult.clockY);
@@ -2453,4 +2456,10 @@ public class NotificationPanelView extends PanelView implements
            }
        }
    };

    public void setDark(boolean dark) {
        mDark = dark;
        mKeyguardStatusView.setDark(dark);
        positionClockAndNotifications();
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -898,7 +898,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        mStackScroller.setScrimController(mScrimController);
        mStatusBarView.setScrimController(mScrimController);
        mDozeScrimController = new DozeScrimController(mScrimController, context, mStackScroller,
                mKeyguardStatusView);
                mNotificationPanel);

        // Other icons
        mLocationController = new LocationControllerImpl(mContext,