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

Commit b9144cea authored by Chris Wren's avatar Chris Wren Committed by Android (Google) Code Review
Browse files

Merge "Clear the initialized flag when resetting the height." into lmp-mr1-dev

parents 404658ee 310df312
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
@@ -154,9 +154,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();
    }