diff options
| author | Igor Viarheichyk <viarheichyk@google.com> | 2014-09-11 15:07:05 -0700 |
|---|---|---|
| committer | Elliott Hughes <enh@google.com> | 2014-09-19 22:02:08 +0000 |
| commit | ed0daa93e48d38e54a7ad1c99c461510a4c07599 (patch) | |
| tree | 85f5b0f42dc755f06cc75a8516cc3a0f0d611405 /core/java/android/text/TextUtils.java | |
| parent | c1ce74cab0e83d574df1bd7bb7b7eb16eec171f6 (diff) | |
| download | frameworks_base-ed0daa93e48d38e54a7ad1c99c461510a4c07599.zip frameworks_base-ed0daa93e48d38e54a7ad1c99c461510a4c07599.tar.gz frameworks_base-ed0daa93e48d38e54a7ad1c99c461510a4c07599.tar.bz2 | |
Use constants instead of resources for ellipsis.
All supported locales use only U+2025 and U+2026 to represent
ellipses, and it will unlikely change in future. Given translated
resources are inconsistent and often use three dots it is safer
to use constants instead of resources.
Change-Id: I51a6cb903f62f739fbadd6b78e5765c0028d641a
Diffstat (limited to 'core/java/android/text/TextUtils.java')
| -rw-r--r-- | core/java/android/text/TextUtils.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java index a5e62e1..dcf3a40 100644 --- a/core/java/android/text/TextUtils.java +++ b/core/java/android/text/TextUtils.java @@ -61,6 +61,8 @@ import java.util.regex.Pattern; public class TextUtils { private static final String TAG = "TextUtils"; + private static final String ELLIPSIS = new String(Layout.ELLIPSIS_NORMAL); + private static final String ELLIPSIS_TWO_DOTS = new String(Layout.ELLIPSIS_TWO_DOTS); private TextUtils() { /* cannot be instantiated */ } @@ -1068,14 +1070,9 @@ public class TextUtils { float avail, TruncateAt where, boolean preserveLength, EllipsizeCallback callback) { - - final String ellipsis = (where == TruncateAt.END_SMALL) ? - Resources.getSystem().getString(R.string.ellipsis_two_dots) : - Resources.getSystem().getString(R.string.ellipsis); - return ellipsize(text, paint, avail, where, preserveLength, callback, TextDirectionHeuristics.FIRSTSTRONG_LTR, - ellipsis); + (where == TruncateAt.END_SMALL) ? ELLIPSIS_TWO_DOTS : ELLIPSIS); } /** |
