diff options
| author | Gilles Debunne <debunne@google.com> | 2011-02-03 14:17:05 -0800 |
|---|---|---|
| committer | Gilles Debunne <debunne@google.com> | 2011-02-18 16:05:15 -0800 |
| commit | f3fa0cdbaea109b114f7facbb5d42de3fc12bbc8 (patch) | |
| tree | f77a3e54bb69fb71a230da03e536f305e1884f43 /core/java/android/text/Layout.java | |
| parent | e7c943926db892d479ba4a0a9b9b314db8abaaee (diff) | |
Bugfixes in StaticLayout.
Bug 3422121
With ellipsize, lines starting with a very long word that does not
fit inside the width were simply ignored. Cut the long word instead.
start - widthStart index offset shift in BiDi.
The original ellipsize-end patch that added '...' after the last
word on end-ellipsized lines has been punted in favor of a true
ellipsize support in I.
I believe the StaticLayout calculateEllipsise is a no-op since textwidth <= avail
by construction: fitWidth and okwidth are < outerWidth. The only exception is the
paraEnd != here case in generate (when not a single character fits in width).
This case is exercised by StaticLayoutTest in cts (width of 8 pixels) and revealed
an offset error in widstart.
All in all, it looks like this code was probably never really tested. I tried some
typical text configuration to make sure these changes improved the situation.
Change-Id: Ibee410bd7db453abf93e10e8beb844eae998922c
Diffstat (limited to 'core/java/android/text/Layout.java')
| -rw-r--r-- | core/java/android/text/Layout.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java index 97a216a8415d..1e4cca95ec9c 100644 --- a/core/java/android/text/Layout.java +++ b/core/java/android/text/Layout.java @@ -1727,6 +1727,17 @@ public abstract class Layout { } } + /** + * Inform this layout that not all of its lines will be displayed, because a maximum number of + * lines has been set on the associated TextView. + * + * A non strictly positive value means that all lines are displayed. + * + * @param lineCount number of visible lines + * @hide + */ + public void setMaximumVisibleLineCount(int lineCount) {} + private CharSequence mText; private TextPaint mPaint; /* package */ TextPaint mWorkPaint; @@ -1765,14 +1776,4 @@ public abstract class Layout { /* package */ static final Directions DIRS_ALL_RIGHT_TO_LEFT = new Directions(new int[] { 0, RUN_LENGTH_MASK | RUN_RTL_FLAG }); - /** - * Inform this layout that not all of its lines will be displayed, because a maximum number of - * lines has been set on the associated TextView. - * - * A non positive value means that all lines are displayed. - * - * @param line line number of the last visible line (line numbers start at 1 for the first line) - * @hide - */ - public void setMaximumVisibleLineCount(int line) {} } |
