diff options
author | Roozbeh Pournader <roozbeh@google.com> | 2017-08-22 17:25:33 -0700 |
---|---|---|
committer | Roozbeh Pournader <roozbeh@google.com> | 2017-08-22 17:25:33 -0700 |
commit | c739bb001a4f4857b39519789effe8bdd6d28682 (patch) | |
tree | 151ae09c008bf555dca390e3332d6bd17906b294 /java/com | |
parent | 44db790aadd2ea63334f2fb346460dbcd6e1afc5 (diff) |
Switch AutoResizeTextView to use new linespacing API
This allows expanding linespacing based on actual fallback fonts
used. Since TextView has the feature on for P and later, Dialer
should assume it's on.
Bug: 28963299
Test: none
Change-Id: I2ce33ac7b5dff76f98bd48d1eef595b48b05106a
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/android/incallui/autoresizetext/AutoResizeTextView.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/java/com/android/incallui/autoresizetext/AutoResizeTextView.java b/java/com/android/incallui/autoresizetext/AutoResizeTextView.java index 5a22b93dc..8fd0b4868 100644 --- a/java/com/android/incallui/autoresizetext/AutoResizeTextView.java +++ b/java/com/android/incallui/autoresizetext/AutoResizeTextView.java @@ -226,13 +226,10 @@ public class AutoResizeTextView extends TextView { } else { // If multiline, lay the text out, then check the number of lines, the layout's height, // and each line's width. - StaticLayout layout = new StaticLayout(text, - textPaint, - maxWidth, - Alignment.ALIGN_NORMAL, - getLineSpacingMultiplier(), - getLineSpacingExtra(), - true); + StaticLayout layout = StaticLayout.Builder.obtain(text, 0, text.length(), textPaint, maxWidth) + .setLineSpacing(getLineSpacingExtra(), getLineSpacingMultiplier()) + .setUseLineSpacingFromFallbacks(true) + .build(); // Return false if we need more than maxLines. The text is obviously too big in this case. if (maxLines != NO_LINE_LIMIT && layout.getLineCount() > maxLines) { |