diff options
author | Haoyu Zhang <haoyuchang@google.com> | 2019-03-18 17:46:23 -0700 |
---|---|---|
committer | Haoyu Zhang <haoyuchang@google.com> | 2019-03-18 17:46:23 -0700 |
commit | 7ad6a515d875ed5d8821f549822d3881112a3a6e (patch) | |
tree | c00978b48fc47253d5503364a8cc3fc4f853de32 | |
parent | b54aa3d9aec501d1b423e95dee7e557d5916e798 (diff) |
Update LineBackgroundSpan.Standard java doc
Add code demo and result image.
Bug: 1526775
Test: make offline-sdk-docs
Change-Id: Ie8f7aa67a49dd79389e3973c2d94a204a1315e11
-rw-r--r-- | core/java/android/text/style/LineBackgroundSpan.java | 9 | ||||
-rw-r--r-- | docs/html/reference/images/text/style/linebackgroundspan.png | bin | 0 -> 29581 bytes |
2 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/text/style/LineBackgroundSpan.java b/core/java/android/text/style/LineBackgroundSpan.java index e43fd8303515..7cb91477738e 100644 --- a/core/java/android/text/style/LineBackgroundSpan.java +++ b/core/java/android/text/style/LineBackgroundSpan.java @@ -53,6 +53,15 @@ public interface LineBackgroundSpan extends ParagraphStyle /** * Default implementation of the {@link LineBackgroundSpan}, which changes the background * color of the lines to which the span is attached. + * <p> + * For example, an <code>LineBackgroundSpan</code> can be used like this: + * <pre> + * String text = "This is a multiline text. LineBackgroundSpan is applied here. This is a multiline text."; + * SpannableString string = new SpannableString(text); + * string.setSpan(new LineBackgroundSpan.Standard(Color.YELLOW), 26, 61, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + * </pre> + * <img src="{@docRoot}reference/android/images/text/style/linebackgroundspan.png" /> + * <figcaption>Text with <code>LineBackgroundSpan</code></figcaption> */ class Standard implements LineBackgroundSpan, ParcelableSpan { diff --git a/docs/html/reference/images/text/style/linebackgroundspan.png b/docs/html/reference/images/text/style/linebackgroundspan.png Binary files differnew file mode 100644 index 000000000000..37d525331e3d --- /dev/null +++ b/docs/html/reference/images/text/style/linebackgroundspan.png |