diff options
Diffstat (limited to 'core/java/android/text/StaticLayout.java')
| -rw-r--r-- | core/java/android/text/StaticLayout.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index e8b2045ef828..583cbe615fa4 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -763,7 +763,8 @@ public class StaticLayout extends Layout { return; } - float ellipsisWidth = paint.measureText(HORIZONTAL_ELLIPSIS); + float ellipsisWidth = paint.measureText( + (where == TextUtils.TruncateAt.END_SMALL) ? ELLIPSIS_TWO_DOTS : ELLIPSIS_NORMAL); int ellipsisStart = 0; int ellipsisCount = 0; int len = lineEnd - lineStart; @@ -791,7 +792,8 @@ public class StaticLayout extends Layout { Log.w(TAG, "Start Ellipsis only supported with one line"); } } - } else if (where == TextUtils.TruncateAt.END || where == TextUtils.TruncateAt.MARQUEE) { + } else if (where == TextUtils.TruncateAt.END || where == TextUtils.TruncateAt.MARQUEE || + where == TextUtils.TruncateAt.END_SMALL) { float sum = 0; int i; @@ -1001,7 +1003,9 @@ public class StaticLayout extends Layout { private static final char CHAR_HYPHEN = '-'; private static final double EXTRA_ROUNDING = 0.5; - private static final String HORIZONTAL_ELLIPSIS = "\u2026"; // this is "..." + + private static final String ELLIPSIS_NORMAL = "\u2026"; // this is "..." + private static final String ELLIPSIS_TWO_DOTS = "\u2025"; // this is ".." private static final int CHAR_FIRST_HIGH_SURROGATE = 0xD800; private static final int CHAR_LAST_LOW_SURROGATE = 0xDFFF; |
