summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorjoneckenrode <joneckenrode@google.com>2022-08-18 17:09:56 +0000
committerjoneckenrode <joneckenrode@google.com>2022-08-23 20:55:59 +0000
commitbf5d4d519035ddc6e680fe902cf000aca2cff474 (patch)
tree257b6e64fc575b01bd1e5c9e6d85ee58277db25d /core/java
parent5c7bab4ccb2bd25333f69ab08952559eba54a3f3 (diff)
docs: Edited API documentation related to line-break and line-break word styles.
Files patched from CL 19608033, https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/19608033. Could not cherry-pick CL because LineBreakConfig.java on master contains Android U code. Staged to: https://android.devsite.corp.google.com/reference/android/widget/TextView https://android.devsite.corp.google.com/reference/android/R.attr https://android.devsite.corp.google.com/reference/kotlin/android/R.attr Test: Built API docs Change-Id: Ie322096ee2cc0ab3e24bb7d2ff8c398e8861726f
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/widget/TextView.java63
1 files changed, 38 insertions, 25 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 23393ffe885c..bdad9e366ba5 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -4877,20 +4877,28 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
}
/**
- * Set the line break style for text wrapping.
+ * Sets the line-break style for text wrapping.
*
- * The line break style to indicates the line break strategies can be used when
- * calculating the text wrapping. The line break style affects rule-based breaking. It
- * specifies the strictness of line-breaking rules.
- * There are several types for the line break style:
- * {@link LineBreakConfig#LINE_BREAK_STYLE_LOOSE},
- * {@link LineBreakConfig#LINE_BREAK_STYLE_NORMAL} and
- * {@link LineBreakConfig#LINE_BREAK_STYLE_STRICT}. The default values of the line break style
- * is {@link LineBreakConfig#LINE_BREAK_STYLE_NONE}, indicating no breaking rule is specified.
- * See <a href="https://www.w3.org/TR/css-text-3/#line-break-property">
- * the line-break property</a>
+ * <p>Line-break style specifies the line-break strategies that can be used
+ * for text wrapping. The line-break style affects rule-based line breaking
+ * by specifying the strictness of line-breaking rules.
*
- * @param lineBreakStyle the line break style for the text.
+ * <p>The following are types of line-break styles:
+ * <ul>
+ * <li>{@link LineBreakConfig#LINE_BREAK_STYLE_LOOSE}
+ * <li>{@link LineBreakConfig#LINE_BREAK_STYLE_NORMAL}
+ * <li>{@link LineBreakConfig#LINE_BREAK_STYLE_STRICT}
+ * </ul>
+ *
+ * <p>The default line-break style is
+ * {@link LineBreakConfig#LINE_BREAK_STYLE_NONE}, which specifies that no
+ * line-breaking rules are used.
+ *
+ * <p>See the
+ * <a href="https://www.w3.org/TR/css-text-3/#line-break-property" class="external">
+ * line-break property</a> for more information.
+ *
+ * @param lineBreakStyle The line-break style for the text.
*/
public void setLineBreakStyle(@LineBreakConfig.LineBreakStyle int lineBreakStyle) {
if (mLineBreakStyle != lineBreakStyle) {
@@ -4904,17 +4912,22 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
}
/**
- * Set the line break word style for text wrapping.
+ * Sets the line-break word style for text wrapping.
+ *
+ * <p>The line-break word style affects dictionary-based line breaking by
+ * providing phrase-based line-breaking opportunities. Use
+ * {@link LineBreakConfig#LINE_BREAK_WORD_STYLE_PHRASE} to specify
+ * phrase-based line breaking.
+ *
+ * <p>The default line-break word style is
+ * {@link LineBreakConfig#LINE_BREAK_WORD_STYLE_NONE}, which specifies that
+ * no line-breaking word style is used.
*
- * The line break word style affects dictionary-based breaking and provide phrase-based
- * breaking opportunities. The type for the line break word style is
- * {@link LineBreakConfig#LINE_BREAK_WORD_STYLE_PHRASE}. The default values of the line break
- * word style is {@link LineBreakConfig#LINE_BREAK_WORD_STYLE_NONE}, indicating no breaking rule
- * is specified.
- * See <a href="https://www.w3.org/TR/css-text-3/#word-break-property">
- * the word-break property</a>
+ * <p>See the
+ * <a href="https://www.w3.org/TR/css-text-3/#word-break-property" class="external">
+ * word-break property</a> for more information.
*
- * @param lineBreakWordStyle the line break word style for the tet
+ * @param lineBreakWordStyle The line-break word style for the text.
*/
public void setLineBreakWordStyle(@LineBreakConfig.LineBreakWordStyle int lineBreakWordStyle) {
if (mLineBreakWordStyle != lineBreakWordStyle) {
@@ -4928,18 +4941,18 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
}
/**
- * Get the current line break style for text wrapping.
+ * Gets the current line-break style for text wrapping.
*
- * @return the current line break style to be used for text wrapping.
+ * @return The line-break style to be used for text wrapping.
*/
public @LineBreakConfig.LineBreakStyle int getLineBreakStyle() {
return mLineBreakStyle;
}
/**
- * Get the current line word break style for text wrapping.
+ * Gets the current line-break word style for text wrapping.
*
- * @return the current line break word style to be used for text wrapping.
+ * @return The line-break word style to be used for text wrapping.
*/
public @LineBreakConfig.LineBreakWordStyle int getLineBreakWordStyle() {
return mLineBreakWordStyle;