summaryrefslogtreecommitdiff
path: root/graphics/java/android
diff options
context:
space:
mode:
author Seigo Nonaka <nona@google.com> 2023-10-10 06:48:47 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-10-10 06:48:47 +0000
commit8f1ce747fe4ac45328dbf79ab391e10d21abe8d7 (patch)
treedd1d9c02ea7ae25645b61990625db60cdd3ba755 /graphics/java/android
parent9b21812e032ff825cbc674bb6816fe4301047c70 (diff)
parent2c062da55a77bdb5284d0751a54e2d1309c9c9c4 (diff)
Merge "Add NoBreakSpan that prevent line break the portion of text" into main
Diffstat (limited to 'graphics/java/android')
-rw-r--r--graphics/java/android/graphics/text/LineBreakConfig.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/text/LineBreakConfig.java b/graphics/java/android/graphics/text/LineBreakConfig.java
index e81525fb7d60..f5e5803d4796 100644
--- a/graphics/java/android/graphics/text/LineBreakConfig.java
+++ b/graphics/java/android/graphics/text/LineBreakConfig.java
@@ -134,10 +134,25 @@ public final class LineBreakConfig {
*/
public static final int LINE_BREAK_STYLE_STRICT = 3;
+ /**
+ * The line break style that used for preventing automatic line breaking.
+ *
+ * This is useful when you want to preserve some words in the same line by using
+ * {@link android.text.style.LineBreakConfigSpan} or
+ * {@link android.text.style.LineBreakConfigSpan.NoBreakSpan} as a shorthand.
+ * Note that even if this style is specified, the grapheme based line break is still performed
+ * for preventing clipping text.
+ *
+ * @see android.text.style.LineBreakConfigSpan
+ * @see android.text.style.LineBreakConfigSpan.NoBreakSpan
+ */
+ @FlaggedApi(FLAG_NO_BREAK_NO_HYPHENATION_SPAN)
+ public static final int LINE_BREAK_STYLE_NO_BREAK = 4;
+
/** @hide */
@IntDef(prefix = { "LINE_BREAK_STYLE_" }, value = {
LINE_BREAK_STYLE_NONE, LINE_BREAK_STYLE_LOOSE, LINE_BREAK_STYLE_NORMAL,
- LINE_BREAK_STYLE_STRICT, LINE_BREAK_STYLE_UNSPECIFIED
+ LINE_BREAK_STYLE_STRICT, LINE_BREAK_STYLE_UNSPECIFIED, LINE_BREAK_STYLE_NO_BREAK
})
@Retention(RetentionPolicy.SOURCE)
public @interface LineBreakStyle {}