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

Commit 98fb09c2 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix animation play time, animation and alpha.

Change-Id: Ib5f0a7880473930da3db70fcbd8c4e620f267cf8
parent 864347ae
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -230,10 +230,13 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        // Check whether there is already a background animation running.
        if (mBackgroundAnimator != null) {
            startAlpha = (Integer) mBackgroundAnimator.getAnimatedValue();
            duration = (int) (NotificationActivator.ANIMATION_LENGTH_MS
                                - mBackgroundAnimator.getCurrentPlayTime());
            duration = (int) mBackgroundAnimator.getCurrentPlayTime();
            mBackgroundAnimator.removeAllListeners();
            mBackgroundAnimator.cancel();
            if (duration <= 0) {
                updateBackgroundResource();
                return;
            }
        }
        mBackgroundNormal.setAlpha(startAlpha);
        mBackgroundAnimator =
@@ -257,10 +260,12 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    private void updateBackgroundResource() {
        if (mDimmed) {
            setBackgroundDimmed(mDimmedBgResId);
            mBackgroundDimmed.setAlpha(255);
            setBackgroundNormal(null);
        } else {
            setBackgroundDimmed(null);
            setBackgroundNormal(mBgResId);
            mBackgroundNormal.setAlpha(255);
        }
    }

+0 −7
Original line number Diff line number Diff line
@@ -1415,13 +1415,6 @@ public abstract class BaseStatusBar extends SystemUI implements
        return mBouncerShowing;
    }

    /**
     * See {@link PowerManager#isInteractive()} for the meaning of this method.
     */
    public boolean isScreenTurnedOn() {
        return mPowerManager.isInteractive();
    }

    public void destroy() {
        if (mSearchPanelView != null) {
            mWindowManager.removeViewImmediate(mSearchPanelView);
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ public class DragDownHelper implements Gefingerpoken {
                        mCallback.setUserLockedChild(mStartingChild, false);
                    }
                    mOnDragDownListener.onDraggedDown(mStartingChild);
                    mDraggingDown = false;
                } else {
                    stopDragging();
                    return false;
+8 −1
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ public class NotificationPanelView extends PanelView implements
    private NotificationStackScrollLayout mNotificationStackScroller;
    private boolean mTrackingSettings;
    private int mNotificationTopPadding;
    private boolean mAnimateNextTopPaddingChange;

    public NotificationPanelView(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -80,7 +81,13 @@ public class NotificationPanelView extends PanelView implements
        mNotificationStackScroller.setTopPadding(mStatusBar.getBarState() == StatusBarState.KEYGUARD
                ? mKeyguardStatusView.getBottom() + keyguardBottomMargin
                : mHeader.getBottom() + mNotificationTopPadding,
                mStatusBar.isScreenTurnedOn() && mStatusBar.isExpandedVisible());
                mAnimateNextTopPaddingChange);
        mAnimateNextTopPaddingChange = false;
    }

    public void animateNextTopPaddingChange() {
        mAnimateNextTopPaddingChange = true;
        requestLayout();
    }

    @Override
+4 −5
Original line number Diff line number Diff line
@@ -631,7 +631,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                        R.layout.status_bar_notification_keyguard_overflow, mStackScroller, false);
        mKeyguardIconOverflowContainer.setOnActivatedListener(this);
        mKeyguardCarrierLabel = mStatusBarWindow.findViewById(R.id.keyguard_carrier_text);
        mKeyguardIconOverflowContainer.setOnClickListener(mOverflowClickListener);
        // TODO: Comment in when transition is ready.
        //mKeyguardIconOverflowContainer.setOnClickListener(mOverflowClickListener);
        mStackScroller.addView(mKeyguardIconOverflowContainer);

        mExpandedContents = mStackScroller;
@@ -2990,6 +2991,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        setBarState(StatusBarState.SHADE);
        if (mLeaveOpenOnKeyguardHide) {
            mLeaveOpenOnKeyguardHide = false;
            mNotificationPanel.animateNextTopPaddingChange();
        } else {
            instantCollapseNotificationPanel();
        }
@@ -3176,6 +3178,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            mLeaveOpenOnKeyguardHide = true;
            showBouncer();
        } else if (mStatusBarKeyguardViewManager.isSecure()) {
            mNotificationPanel.animateNextTopPaddingChange();
            setBarState(StatusBarState.SHADE_LOCKED);
            updateKeyguardState();
        } else {
@@ -3195,10 +3198,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        }
    }

    public boolean isExpandedVisible() {
        return mExpandedVisible;
    }

    public static boolean inBounds(View view, MotionEvent event, boolean orAbove) {
        final int[] location = new int[2];
        view.getLocationInWindow(location);
Loading