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

Commit 310df312 authored by Chris Wren's avatar Chris Wren Committed by Dan Sandler
Browse files

Clear the initialized flag when resetting the height.

When the notification was updated within the heads up, touches were being
dropped due to an invalid actual height, after a height reset in the update code.

Bug: 18102199
Change-Id: I6c95d360452665464a868b2bc5ce4f6e104b6652
parent b7efa04d
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -508,7 +508,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        if (mAppearAnimator != null) {
            mAppearAnimator.cancel();
        }
        mAnimationTranslationY = translationDirection * mActualHeight;
        mAnimationTranslationY = translationDirection * getActualHeight();
        if (mAppearAnimationFraction == -1.0f) {
            // not initialized yet, we start anew
            if (isAppearing) {
@@ -601,14 +601,15 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView

        float top;
        float bottom;
        final int actualHeight = getActualHeight();
        if (mAnimationTranslationY > 0.0f) {
            bottom = mActualHeight - heightFraction * mAnimationTranslationY * 0.1f
            bottom = actualHeight - heightFraction * mAnimationTranslationY * 0.1f
                    - translateYTotalAmount;
            top = bottom * heightFraction;
        } else {
            top = heightFraction * (mActualHeight + mAnimationTranslationY) * 0.1f -
            top = heightFraction * (actualHeight + mAnimationTranslationY) * 0.1f -
                    translateYTotalAmount;
            bottom = mActualHeight * (1 - heightFraction) + top * heightFraction;
            bottom = actualHeight * (1 - heightFraction) + top * heightFraction;
        }
        mAppearAnimationRect.set(left, top, right, bottom);
        setOutlineRect(left, top + mAppearAnimationTranslation, right,
+1 −1
Original line number Diff line number Diff line
@@ -156,9 +156,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
    }

    public void resetHeight() {
        super.resetHeight();
        mMaxExpandHeight = 0;
        mWasReset = true;
        mActualHeight = 0;
        onHeightReset();
        requestLayout();
    }
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ public abstract class ExpandableOutlineView extends ExpandableView {
                    outline.setRect(0,
                            mClipTopAmount,
                            getWidth(),
                            Math.max(mActualHeight, mClipTopAmount));
                            Math.max(getActualHeight(), mClipTopAmount));
                } else {
                    outline.setRect(mOutlineRect);
                }
+6 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ public abstract class ExpandableView extends FrameLayout {
    private final int mMaxNotificationHeight;

    private OnHeightChangedListener mOnHeightChangedListener;
    protected int mActualHeight;
    private int mActualHeight;
    protected int mClipTopAmount;
    private boolean mActualHeightInitialized;
    private ArrayList<View> mMatchParentViews = new ArrayList<View>();
@@ -103,6 +103,11 @@ public abstract class ExpandableView extends FrameLayout {
        }
    }

    protected void resetHeight() {
        mActualHeight = 0;
        mActualHeightInitialized = false;
    }

    protected int getInitialHeight() {
        return getHeight();
    }