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

Commit b46d0a26 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Rename setVerticalPanelTranslation

It was never vertical :)

Test: make
Change-Id: I6b8da73cdd46835b3f4257a11b8bf75d0a2ca961
parent 959d407a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -430,7 +430,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
    private int mHeadsUpInset;
    private HeadsUpAppearanceController mHeadsUpAppearanceController;
    private NotificationIconAreaController mIconAreaController;
    private float mVerticalPanelTranslation;
    private float mHorizontalPanelTranslation;
    private final NotificationLockscreenUserManager mLockscreenUserManager =
            Dependency.get(NotificationLockscreenUserManager.class);
    protected final NotificationGutsManager mGutsManager =
@@ -4377,12 +4377,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd

    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    private void updatePanelTranslation() {
        setTranslationX(mVerticalPanelTranslation + mAntiBurnInOffsetX * mInterpolatedDarkAmount);
        setTranslationX(mHorizontalPanelTranslation + mAntiBurnInOffsetX * mInterpolatedDarkAmount);
    }

    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    public void setVerticalPanelTranslation(float verticalPanelTranslation) {
        mVerticalPanelTranslation = verticalPanelTranslation;
    public void setHorizontalPanelTranslation(float verticalPanelTranslation) {
        mHorizontalPanelTranslation = verticalPanelTranslation;
        updatePanelTranslation();
    }

+11 −10
Original line number Diff line number Diff line
@@ -1233,7 +1233,7 @@ public class NotificationPanelView extends PanelView implements
            updateDozingVisibilities(false /* animate */);
        }

        resetVerticalPanelPosition();
        resetHorizontalPanelPosition();
        updateQsState();
    }

@@ -2043,7 +2043,7 @@ public class NotificationPanelView extends PanelView implements
        super.onConfigurationChanged(newConfig);
        mAffordanceHelper.onConfigurationChanged();
        if (newConfig.orientation != mLastOrientation) {
            resetVerticalPanelPosition();
            resetHorizontalPanelPosition();
        }
        mLastOrientation = newConfig.orientation;
    }
@@ -2529,7 +2529,7 @@ public class NotificationPanelView extends PanelView implements
    @Override
    protected void onClosingFinished() {
        super.onClosingFinished();
        resetVerticalPanelPosition();
        resetHorizontalPanelPosition();
        setClosingWithAlphaFadeout(false);
    }

@@ -2546,7 +2546,7 @@ public class NotificationPanelView extends PanelView implements
     */
    protected void updateVerticalPanelPosition(float x) {
        if (mNotificationStackScroller.getWidth() * 1.75f > getWidth()) {
            resetVerticalPanelPosition();
            resetHorizontalPanelPosition();
            return;
        }
        float leftMost = mPositionMinSideMargin + mNotificationStackScroller.getWidth() / 2;
@@ -2556,16 +2556,17 @@ public class NotificationPanelView extends PanelView implements
            x = getWidth() / 2;
        }
        x = Math.min(rightMost, Math.max(leftMost, x));
        setVerticalPanelTranslation(x -
                (mNotificationStackScroller.getLeft() + mNotificationStackScroller.getWidth() / 2));
        float center =
                mNotificationStackScroller.getLeft() + mNotificationStackScroller.getWidth() / 2;
        setHorizontalPanelTranslation(x - center);
    }

    private void resetVerticalPanelPosition() {
        setVerticalPanelTranslation(0f);
    private void resetHorizontalPanelPosition() {
        setHorizontalPanelTranslation(0f);
    }

    protected void setVerticalPanelTranslation(float translation) {
        mNotificationStackScroller.setVerticalPanelTranslation(translation);
    protected void setHorizontalPanelTranslation(float translation) {
        mNotificationStackScroller.setHorizontalPanelTranslation(translation);
        mQsFrame.setTranslationX(translation);
        int size = mVerticalTranslationListener.size();
        for (int i = 0; i < size; i++) {