Merge change 21638 into eclair
* changes: Don't use BoringLayout to display text that has paragraph-style markup.
This commit is contained in:
@@ -19,6 +19,7 @@ package android.text;
|
|||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.Path;
|
import android.graphics.Path;
|
||||||
|
import android.text.style.ParagraphStyle;
|
||||||
import android.util.FloatMath;
|
import android.util.FloatMath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -262,6 +263,14 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback
|
|||||||
|
|
||||||
TextUtils.recycle(temp);
|
TextUtils.recycle(temp);
|
||||||
|
|
||||||
|
if (boring && text instanceof Spanned) {
|
||||||
|
Spanned sp = (Spanned) text;
|
||||||
|
Object[] styles = sp.getSpans(0, text.length(), ParagraphStyle.class);
|
||||||
|
if (styles.length > 0) {
|
||||||
|
boring = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (boring) {
|
if (boring) {
|
||||||
Metrics fm = metrics;
|
Metrics fm = metrics;
|
||||||
if (fm == null) {
|
if (fm == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user