From 8059e0903e36cbb5cf8b5c5d5d653acc9bbc8402 Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Wed, 10 Aug 2011 16:31:58 -0700 Subject: Fix bug #3388534 Long file names are improperly displayed when played - force ellipsising when there are more lines found than maxLines - do not care about lines when we have reached maxLines - also fix relayouting when changing maxLines thru setMaxLines() - do not allow START / MIDDLE ellipsis when there are multiple lines (and print a log accordingly) Change-Id: I90f5a7f5200a220aceee01fb7300bec2c4c3a075 --- core/java/android/text/Layout.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'core/java/android/text/Layout.java') diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java index eabeef0611e0..421e9959bd55 100644 --- a/core/java/android/text/Layout.java +++ b/core/java/android/text/Layout.java @@ -880,6 +880,10 @@ public abstract class Layout { } } Directions directions = getLineDirections(line); + // Returned directions can actually be null + if (directions == null) { + return 0f; + } int dir = getParagraphDirection(line); TextLine tl = TextLine.obtain(); @@ -1781,17 +1785,6 @@ 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; -- cgit v1.2.3