diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-03-20 16:01:50 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-03-20 16:01:50 +0000 |
commit | 0a8d0b237afc12ddf01076fe7fafe4f099ec3a07 (patch) | |
tree | 7ca5867d3a1925f4ef172f3ea371d2c1c077355b | |
parent | 4144961dc672ae91ad81a7e6c2ff6a46914d9f66 (diff) | |
parent | 10b1aeec1544e2c91f2dbaf7a5877e3e509bfd82 (diff) |
Merge "Add code sample and result image for LineHeightSpan"
-rw-r--r-- | core/java/android/text/style/LineHeightSpan.java | 10 | ||||
-rw-r--r-- | docs/html/reference/images/text/style/lineheightspan.png | bin | 0 -> 23937 bytes |
2 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/text/style/LineHeightSpan.java b/core/java/android/text/style/LineHeightSpan.java index 7fb0f950f583..610cf2c7c784 100644 --- a/core/java/android/text/style/LineHeightSpan.java +++ b/core/java/android/text/style/LineHeightSpan.java @@ -70,7 +70,15 @@ public interface LineHeightSpan extends ParagraphStyle, WrapTogetherSpan { * Default implementation of the {@link LineHeightSpan}, which changes the line height of the * attached paragraph. * <p> - * LineHeightSpan will change the line height of the entire paragraph, even though it + * For example, a paragraph with its line height equal to 100px can be set like this: + * <pre> + * SpannableString string = new SpannableString("This is a multiline paragraph. This is a multiline paragraph."); + * string.setSpan(new LineHeightSpan.Standard(100), 0, string.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + * </pre> + * <img src="{@docRoot}reference/android/images/text/style/lineheightspan.png" /> + * <figcaption>Text with line height set to 100 pixels.</figcaption> + * <p> + * Notice that LineHeightSpan will change the line height of the entire paragraph, even though it * covers only part of the paragraph. * </p> */ diff --git a/docs/html/reference/images/text/style/lineheightspan.png b/docs/html/reference/images/text/style/lineheightspan.png Binary files differnew file mode 100644 index 000000000000..18f575392b63 --- /dev/null +++ b/docs/html/reference/images/text/style/lineheightspan.png |