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

Commit 8508e691 authored by Selim Cinek's avatar Selim Cinek Committed by Android Git Automerger
Browse files

am edac8c89: am 31e307e6: am 1b459f89: Merge "Cleaned up status bar closing...

am edac8c89: am 31e307e6: am 1b459f89: Merge "Cleaned up status bar closing handling" into lmp-mr1-dev

* commit 'edac8c89':
  Cleaned up status bar closing handling
parents a6ca04e6 edac8c89
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -236,4 +236,8 @@ public class PanelBar extends FrameLayout {
    public void onExpandingFinished() {

    }

    public void onClosingFinished() {

    }
}
+27 −20
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ public abstract class PanelView extends FrameLayout {
    };

    protected void onExpandingFinished() {
        mClosing = false;
        endClosing();
        mBar.onExpandingFinished();
    }

@@ -249,9 +249,7 @@ public abstract class PanelView extends FrameLayout {
                trackMovement(event);
                if (!waitForTouchSlop || (mHeightAnimator != null && !mHintAnimationRunning) ||
                        mPeekPending || mPeekAnimator != null) {
                    if (mHeightAnimator != null) {
                        mHeightAnimator.cancel(); // end any outstanding animations
                    }
                    cancelHeightAnimator();
                    cancelPeek();
                    mTouchSlopExceeded = (mHeightAnimator != null && !mHintAnimationRunning)
                            || mPeekPending || mPeekAnimator != null;
@@ -292,9 +290,7 @@ public abstract class PanelView extends FrameLayout {
                            mInitialTouchY = y;
                            h = 0;
                        }
                        if (mHeightAnimator != null) {
                            mHeightAnimator.cancel(); // end any outstanding animations
                        }
                        cancelHeightAnimator();
                        removeCallbacks(mPeekRunnable);
                        mPeekPending = false;
                        onTrackingStarted();
@@ -371,7 +367,7 @@ public abstract class PanelView extends FrameLayout {
    }

    protected void onTrackingStarted() {
        mClosing = false;
        endClosing();
        mTracking = true;
        mCollapseAfterPeek = false;
        mBar.onTrackingStarted(PanelView.this);
@@ -406,9 +402,7 @@ public abstract class PanelView extends FrameLayout {
                mStatusBar.userActivity();
                if (mHeightAnimator != null && !mHintAnimationRunning ||
                        mPeekPending || mPeekAnimator != null) {
                    if (mHeightAnimator != null) {
                        mHeightAnimator.cancel(); // end any outstanding animations
                    }
                    cancelHeightAnimator();
                    cancelPeek();
                    mTouchSlopExceeded = true;
                    return true;
@@ -440,9 +434,7 @@ public abstract class PanelView extends FrameLayout {
                trackMovement(event);
                if (scrolledToBottom) {
                    if (h < -mTouchSlop && h < -Math.abs(x - mInitialTouchX)) {
                        if (mHeightAnimator != null) {
                            mHeightAnimator.cancel();
                        }
                        cancelHeightAnimator();
                        mInitialOffsetOnTouch = mExpandedHeight;
                        mInitialTouchY = y;
                        mInitialTouchX = x;
@@ -460,6 +452,20 @@ public abstract class PanelView extends FrameLayout {
        return false;
    }

    private void cancelHeightAnimator() {
        if (mHeightAnimator != null) {
            mHeightAnimator.cancel();
        }
        endClosing();
    }

    private void endClosing() {
        if (mClosing) {
            mClosing = false;
            onClosingFinished();
        }
    }

    private void initVelocityTracker() {
        if (mVelocityTracker != null) {
            mVelocityTracker.recycle();
@@ -699,9 +705,7 @@ public abstract class PanelView extends FrameLayout {
                mPeekRunnable.run();
            }
        } else if (!isFullyCollapsed() && !mTracking && !mClosing) {
            if (mHeightAnimator != null) {
                mHeightAnimator.cancel();
            }
            cancelHeightAnimator();
            mClosing = true;
            notifyExpandingStarted();
            if (delayed) {
@@ -784,13 +788,16 @@ public abstract class PanelView extends FrameLayout {

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

    protected void onClosingFinished() {
        mBar.onClosingFinished();
    }


    protected void startUnlockHintAnimation() {

        // We don't need to hint the user if an animation is already running or the user is changing
+4 −0
Original line number Diff line number Diff line
@@ -3795,6 +3795,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        runPostCollapseRunnables();
    }

    public void onClosingFinished() {
        runPostCollapseRunnables();
    }

    public void onUnlockHintStarted() {
        mKeyguardIndicationController.showTransientIndication(R.string.keyguard_unlock);
    }
+6 −1
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.util.EventLog;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
@@ -151,6 +150,12 @@ public class PhoneStatusBarView extends PanelBar {
        mScrimController.onTrackingStarted();
    }

    @Override
    public void onClosingFinished() {
        super.onClosingFinished();
        mBar.onClosingFinished();
    }

    @Override
    public void onTrackingStopped(PanelView panel, boolean expand) {
        super.onTrackingStopped(panel, expand);