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

Commit 237ffa48 authored by Adrian Roos's avatar Adrian Roos
Browse files

Fix BigText transitions

Fixes a bug where BigText would never transition
between the expanded and collapsed version because
padding was wrongly taken into account when checking
the view height.

Change-Id: I4df242b4133dacdff77b78cc2d4ff3954b75b8a7
Fixes: 29042222
parent 13d534e7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -47,12 +47,16 @@ public class TextViewTransformState extends TransformState {
                int ownEllipsized = getEllipsisCount();
                int otherEllipsized = otherTvs.getEllipsisCount();
                return ownEllipsized == otherEllipsized
                        && mText.getHeight() == otherTvs.mText.getHeight();
                        && getInnerHeight(mText) == getInnerHeight(otherTvs.mText);
            }
        }
        return super.sameAs(otherState);
    }

    private int getInnerHeight(TextView text) {
        return text.getHeight() - text.getPaddingTop() - text.getPaddingBottom();
    }

    private int getEllipsisCount() {
        Layout l = mText.getLayout();
        if (l != null) {