diff options
| author | Siyamed Sinir <siyamed@google.com> | 2017-10-11 02:20:27 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-10-11 02:20:27 +0000 |
| commit | 2d729d55aaeb8658dc79ca48ba5a77723510ebb1 (patch) | |
| tree | 8237f3969287bb022c62207462d4f2470028257f /core/java/android/text/StaticLayout.java | |
| parent | ce0d273b1740bde96fb557f143443af06ce578ee (diff) | |
| parent | a273a70ecbb0d1aaf9aeceec7aa91591290a4871 (diff) | |
Merge "Removed unused variables from text layout code"
Diffstat (limited to 'core/java/android/text/StaticLayout.java')
| -rw-r--r-- | core/java/android/text/StaticLayout.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index 335901759067..4b6b6ae8bf83 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -440,8 +440,6 @@ public class StaticLayout extends Layout { private Pair<String, long[]> getLocaleAndHyphenatorIfChanged(TextPaint paint) { final LocaleList locales = paint.getTextLocales(); - final String languageTags; - long[] hyphenators; if (!locales.equals(mLocales)) { mLocales = locales; return new Pair(locales.toLanguageTags(), getHyphenators(locales)); @@ -520,7 +518,7 @@ public class StaticLayout extends Layout { private LocaleList mLocales; - private static final SynchronizedPool<Builder> sPool = new SynchronizedPool<Builder>(3); + private static final SynchronizedPool<Builder> sPool = new SynchronizedPool<>(3); } public StaticLayout(CharSequence source, TextPaint paint, @@ -945,10 +943,10 @@ public class StaticLayout extends Layout { boolean moreChars = (endPos < bufEnd); final int ascent = fallbackLineSpacing - ? Math.min(fmAscent, (int) Math.round(ascents[breakIndex])) + ? Math.min(fmAscent, Math.round(ascents[breakIndex])) : fmAscent; final int descent = fallbackLineSpacing - ? Math.max(fmDescent, (int) Math.round(descents[breakIndex])) + ? Math.max(fmDescent, Math.round(descents[breakIndex])) : fmDescent; v = out(source, here, endPos, ascent, descent, fmTop, fmBottom, @@ -1175,7 +1173,7 @@ public class StaticLayout extends Layout { mWorkPaint.set(paint); do { final float ellipsizedWidth = guessEllipsis(text, lineStart, lineEnd, widths, - widthStart, tempAvail, where, line, textWidth, mWorkPaint, forceEllipsis, dir); + widthStart, tempAvail, where, line, mWorkPaint, forceEllipsis, dir); if (ellipsizedWidth <= avail) { lineFits = true; } else { @@ -1205,7 +1203,7 @@ public class StaticLayout extends Layout { // This method temporarily modifies the TextPaint passed to it, so the TextPaint passed to it // should not be accessed while the method is running. private float guessEllipsis(CharSequence text, int lineStart, int lineEnd, float[] widths, - int widthStart, float avail, TextUtils.TruncateAt where, int line, float textWidth, + int widthStart, float avail, TextUtils.TruncateAt where, int line, TextPaint paint, boolean forceEllipsis, int dir) { final int savedHyphenEdit = paint.getHyphenEdit(); paint.setHyphenEdit(0); |
