diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-08-17 17:24:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-08-17 17:24:47 -0700 |
commit | 30c1738b2cd9e59263a4eecc4e666f7a3cb35b03 (patch) | |
tree | 8b8054fa069bb5053f026bad3fa3358bfa06fea1 /core | |
parent | 517825091a2fdbdb20dc569184f2736c78ecc1bd (diff) | |
parent | 86fcef87b802ee58147127dc5cca940239a30404 (diff) | |
download | frameworks_base-30c1738b2cd9e59263a4eecc4e666f7a3cb35b03.zip frameworks_base-30c1738b2cd9e59263a4eecc4e666f7a3cb35b03.tar.gz frameworks_base-30c1738b2cd9e59263a4eecc4e666f7a3cb35b03.tar.bz2 |
Merge change 21638 into eclair
* changes:
Don't use BoringLayout to display text that has paragraph-style markup.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/text/BoringLayout.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/text/BoringLayout.java b/core/java/android/text/BoringLayout.java index 843754b..944f735 100644 --- a/core/java/android/text/BoringLayout.java +++ b/core/java/android/text/BoringLayout.java @@ -19,6 +19,7 @@ package android.text; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; +import android.text.style.ParagraphStyle; import android.util.FloatMath; /** @@ -262,6 +263,14 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback 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) { Metrics fm = metrics; if (fm == null) { |