diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2012-06-13 15:45:38 -0700 |
---|---|---|
committer | Fabrice Di Meglio <fdimeglio@google.com> | 2012-06-13 15:54:55 -0700 |
commit | 8d44fff7e62f77c3b3072a96712cc1389e63ca64 (patch) | |
tree | b1b60b75b94ecb473c1eb96cb8a1852ca609068f /core/java/android/text/Layout.java | |
parent | 68cefd201809372a547257a273b805cabbd0da68 (diff) | |
download | frameworks_base-8d44fff7e62f77c3b3072a96712cc1389e63ca64.zip frameworks_base-8d44fff7e62f77c3b3072a96712cc1389e63ca64.tar.gz frameworks_base-8d44fff7e62f77c3b3072a96712cc1389e63ca64.tar.bz2 |
Fix bug #6661824 Hebrew Text can be clipped
- use the correct ellipsis char in both measurement and rendered string
Change-Id: Ia00285fc16da528f18702719026503b5d0610642
Diffstat (limited to 'core/java/android/text/Layout.java')
-rw-r--r-- | core/java/android/text/Layout.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java index c453a5d..ba43aae 100644 --- a/core/java/android/text/Layout.java +++ b/core/java/android/text/Layout.java @@ -1695,8 +1695,14 @@ public abstract class Layout { return text.getSpans(start, end, type); } + private char getEllipsisChar(TextUtils.TruncateAt method) { + return (method == TextUtils.TruncateAt.END_SMALL) ? + ELLIPSIS_TWO_DOTS[0] : + ELLIPSIS_NORMAL[0]; + } + private void ellipsize(int start, int end, int line, - char[] dest, int destoff) { + char[] dest, int destoff, TextUtils.TruncateAt method) { int ellipsisCount = getEllipsisCount(line); if (ellipsisCount == 0) { @@ -1710,7 +1716,7 @@ public abstract class Layout { char c; if (i == ellipsisStart) { - c = '\u2026'; // ellipsis + c = getEllipsisChar(method); // ellipsis } else { c = '\uFEFF'; // 0-width space } @@ -1784,7 +1790,7 @@ public abstract class Layout { TextUtils.getChars(mText, start, end, dest, destoff); for (int i = line1; i <= line2; i++) { - mLayout.ellipsize(start, end, i, dest, destoff); + mLayout.ellipsize(start, end, i, dest, destoff, mMethod); } } @@ -1889,4 +1895,6 @@ public abstract class Layout { /* package */ static final Directions DIRS_ALL_RIGHT_TO_LEFT = new Directions(new int[] { 0, RUN_LENGTH_MASK | RUN_RTL_FLAG }); + /* package */ static final char[] ELLIPSIS_NORMAL = { '\u2026' }; // this is "..." + /* package */ static final char[] ELLIPSIS_TWO_DOTS = { '\u2025' }; // this is ".." } |