From 237ffa48d0de34ba0498f440983256a195672197 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Thu, 2 Jun 2016 13:15:09 -0700 Subject: [PATCH] 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 --- .../statusbar/notification/TextViewTransformState.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/TextViewTransformState.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/TextViewTransformState.java index 20dbc4a31b8ae..6fe5756ea9f8f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/TextViewTransformState.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/TextViewTransformState.java @@ -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) {