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

Commit 81e36fe7 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a measuring bug when the panel was collapsed

This lead to the dismissView and other views being measured with
height 0 and therefore harm performance and animations.

Bug: 20665047
Change-Id: I985c40948994b409cea5ac7c34a711ce243c62f1
parent 173f2d0f
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -59,13 +59,6 @@ public abstract class ExpandableView extends FrameLayout {
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int ownMaxHeight = mMaxViewHeight;
        int heightMode = MeasureSpec.getMode(heightMeasureSpec);
        boolean hasFixedHeight = heightMode == MeasureSpec.EXACTLY;
        boolean isHeightLimited = heightMode == MeasureSpec.AT_MOST;
        if (hasFixedHeight || isHeightLimited) {
            int size = MeasureSpec.getSize(heightMeasureSpec);
            ownMaxHeight = Math.min(ownMaxHeight, size);
        }
        int newHeightSpec = MeasureSpec.makeMeasureSpec(ownMaxHeight, MeasureSpec.AT_MOST);
        int maxChildHeight = 0;
        int childCount = getChildCount();
@@ -92,8 +85,7 @@ public abstract class ExpandableView extends FrameLayout {
                mMatchParentViews.add(child);
            }
        }
        int ownHeight = hasFixedHeight ? ownMaxHeight :
                isHeightLimited ? Math.min(ownMaxHeight, maxChildHeight) : maxChildHeight;
        int ownHeight = Math.min(ownMaxHeight, maxChildHeight);
        newHeightSpec = MeasureSpec.makeMeasureSpec(ownHeight, MeasureSpec.EXACTLY);
        for (View child : mMatchParentViews) {
            child.measure(getChildMeasureSpec(