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
This commit is contained in:
Adrian Roos
2016-06-02 13:15:09 -07:00
parent 13d534e7f2
commit 237ffa48d0

View File

@@ -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) {