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

Commit 0a27be89 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix blank lockscreen.

Bug: 15281241
Change-Id: If315891274a97fa5cc579554b83b85cf3c87f0fb
parent c776997e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -423,6 +423,7 @@ public class KeyguardPageSwipeHelper {
            return;
        }
        if (!animate) {
            view.animate().cancel();
            view.setAlpha(alpha);
            view.setScaleX(scale);
            view.setScaleY(scale);
@@ -465,6 +466,13 @@ public class KeyguardPageSwipeHelper {
    }

    public void reset() {
        if (mSwipeAnimator != null) {
            mSwipeAnimator.cancel();
        }
        ArrayList<View> targetViews = mCallback.getTranslationViews();
        for (View view : targetViews) {
            view.animate().cancel();
        }
        setTranslation(0.0f, true);
        mSwipingInProgress = false;
    }
+47 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.view.ViewTreeObserver;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.FrameLayout;
@@ -67,6 +68,11 @@ public abstract class PanelView extends FrameLayout {
    private VelocityTrackerInterface mVelocityTracker;
    private FlingAnimationUtils mFlingAnimationUtils;

    /**
     * Whether an instant expand request is currently pending and we are just waiting for layout.
     */
    private boolean mInstantExpanding;

    PanelBar mBar;

    protected int mMaxPanelHeight = -1;
@@ -128,6 +134,9 @@ public abstract class PanelView extends FrameLayout {

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (mInstantExpanding) {
            return false;
        }

        /*
         * We capture touch events here and update the expand height here in case according to
@@ -263,6 +272,9 @@ public abstract class PanelView extends FrameLayout {

    @Override
    public boolean onInterceptTouchEvent(MotionEvent event) {
        if (mInstantExpanding) {
            return false;
        }

        /*
         * If the user drags anywhere inside the panel we intercept it if he moves his finger
@@ -556,6 +568,41 @@ public abstract class PanelView extends FrameLayout {
        }
    }

    public void instantExpand() {
        mInstantExpanding = true;
        abortAnimations();
        if (mTracking) {
            onTrackingStopped(true /* expands */); // The panel is expanded after this call.
            onExpandingFinished();
        }
        setVisibility(VISIBLE);

        // Wait for window manager to pickup the change, so we know the maximum height of the panel
        // then.
        getViewTreeObserver().addOnGlobalLayoutListener(
                new ViewTreeObserver.OnGlobalLayoutListener() {
                    @Override
                    public void onGlobalLayout() {
                        if (mStatusBar.getStatusBarWindow().getHeight()
                                != mStatusBar.getStatusBarHeight()) {
                            getViewTreeObserver().removeOnGlobalLayoutListener(this);
                            setExpandedFraction(1f);
                            mInstantExpanding = false;
                        }
                    }
                });

        // Make sure a layout really happens.
        requestLayout();
    }

    private void abortAnimations() {
        cancelPeek();
        if (mHeightAnimator != null) {
            mHeightAnimator.cancel();
        }
    }

    protected void startUnlockHintAnimation() {

        // We don't need to hint the user if an animation is already running or the user is changing
+6 −15
Original line number Diff line number Diff line
@@ -831,6 +831,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        return mStatusBarView;
    }

    public StatusBarWindowView getStatusBarWindow() {
        return mStatusBarWindow;
    }

    @Override
    protected WindowManager.LayoutParams getSearchLayoutParams(LayoutParams layoutParams) {
        boolean opaque = false;
@@ -2966,22 +2970,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,

    private void instantExpandNotificationsPanel() {

        // Make our window larger and the panel visible.
        // Make our window larger and the panel expanded.
        makeExpandedVisible(true);
        mNotificationPanel.setVisibility(View.VISIBLE);

        // Wait for window manager to pickup the change, so we know the maximum height of the panel
        // then.
        mNotificationPanel.getViewTreeObserver().addOnGlobalLayoutListener(
                new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                if (mStatusBarWindow.getHeight() != getStatusBarHeight()) {
                    mNotificationPanel.getViewTreeObserver().removeOnGlobalLayoutListener(this);
                    mNotificationPanel.setExpandedFraction(1);
                }
            }
        });
        mNotificationPanel.instantExpand();
    }

    private void instantCollapseNotificationPanel() {