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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user