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

Commit 44dc1413 authored by Adam Cohen's avatar Adam Cohen
Browse files

Clean up some flashy jank (issue 7454766)

Change-Id: I809f3afbbb70e82847aa4851d20058a2c483a32e
parent d51700b3
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -214,6 +214,11 @@ public class KeyguardViewStateManager implements
                    mKeyguardWidgetPager.setWidgetToResetOnPageFadeOut(mPageListeningToSlider);
                }
            }
            if (frame.isSmall()) {
                // This is to make sure that if the scroller animation gets cut off midway
                // that the frame doesn't stay in a partial down position.
                frame.setFrameHeight(frame.getSmallFrameHeight());
            }
            if (scrollState != SlidingChallengeLayout.SCROLL_STATE_FADING) {
                frame.hideFrame(this);
            }
@@ -244,7 +249,7 @@ public class KeyguardViewStateManager implements
                if (!frame.isSmall()) {
                    // We need to fetch the final page, in case the pages are in motion.
                    mPageListeningToSlider = mKeyguardWidgetPager.getNextPage();
                    frame.shrinkWidget();
                    frame.shrinkWidget(false);
                }
            } else {
                if (!frame.isSmall()) {
@@ -263,7 +268,7 @@ public class KeyguardViewStateManager implements
    public void onScrollPositionChanged(float scrollPosition, int challengeTop) {
        mChallengeTop = challengeTop;
        KeyguardWidgetFrame frame = mKeyguardWidgetPager.getWidgetPageAt(mPageListeningToSlider);
        if (frame != null && !mKeyguardWidgetPager.isPageMoving()) {
        if (frame != null && mLastScrollState != SlidingChallengeLayout.SCROLL_STATE_FADING) {
            frame.adjustFrame(getChallengeTopRelativeToFrame(frame, mChallengeTop));
        }
    }
+14 −2
Original line number Diff line number Diff line
@@ -329,6 +329,7 @@ public class KeyguardWidgetFrame extends FrameLayout {

    public void setMaxChallengeTop(int top) {
        boolean dirty = mMaxChallengeTop != top;
        mMaxChallengeTop = top;
        mSmallWidgetHeight = top - getPaddingTop();
        mSmallFrameHeight = top + getPaddingBottom();
        if (dirty && mIsSmall) {
@@ -348,11 +349,22 @@ public class KeyguardWidgetFrame extends FrameLayout {
        setFrameHeight(frameHeight);
    }

    public void shrinkWidget() {
    public void shrinkWidget(boolean alsoShrinkFrame) {
        mIsSmall = true;
        setWidgetHeight(mSmallWidgetHeight);

        if (alsoShrinkFrame) {
            setFrameHeight(mSmallFrameHeight);
        }
    }

    public int getSmallFrameHeight() {
        return mSmallFrameHeight;
    }

    public void shrinkWidget() {
        shrinkWidget(true);
    }

    public void setWidgetLockedSmall(boolean locked) {
        if (locked) {