Rename Item to Range
Bug: 156126205
Test: ./gradlew test
Test: ./gradlew ui:ui-text-core:cAT
RelNote: "API change: AnnotatedString.Item is renamed to AnnotatedString.Range."
Change-Id: I2d44dd9e4f565d5f90eeba93dc61a052109da32e
diff --git a/ui/ui-text-core/api/0.1.0-dev12.txt b/ui/ui-text-core/api/0.1.0-dev12.txt
index ba90a67..95424fc 100644
--- a/ui/ui-text-core/api/0.1.0-dev12.txt
+++ b/ui/ui-text-core/api/0.1.0-dev12.txt
@@ -201,14 +201,14 @@
package androidx.ui.text {
public final class AnnotatedString {
- ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles);
+ ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles);
method public String component1();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> component3();
- method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> annotations);
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> getSpanStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> getStringAnnotations(String tag, int start, int end);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> component2();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> component3();
+ method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> annotations);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> getSpanStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> getStringAnnotations(String tag, int start, int end);
method public String getText();
method public operator androidx.ui.text.AnnotatedString plus(androidx.ui.text.AnnotatedString other);
}
@@ -234,14 +234,14 @@
property public final int length;
}
- public static final class AnnotatedString.Item<T> {
- ctor public AnnotatedString.Item(T! item, int start, int end, String tag);
- ctor public AnnotatedString.Item(T! item, int start, int end);
+ public static final class AnnotatedString.Range<T> {
+ ctor public AnnotatedString.Range(T! item, int start, int end, String tag);
+ ctor public AnnotatedString.Range(T! item, int start, int end);
method public T! component1();
method public int component2();
method public int component3();
method public String component4();
- method public androidx.ui.text.AnnotatedString.Item<T> copy(T! item, int start, int end, String tag);
+ method public androidx.ui.text.AnnotatedString.Range<T> copy(T! item, int start, int end, String tag);
method public int getEnd();
method public T! getItem();
method public int getStart();
@@ -303,7 +303,7 @@
public final class MultiParagraph {
ctor public MultiParagraph(androidx.ui.text.MultiParagraphIntrinsics intrinsics, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints);
- ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.style.TextDirection getBidiRunDirection(int offset);
method public androidx.ui.geometry.Rect getBoundingBox(int offset);
method public androidx.ui.geometry.Rect getCursorRect(int offset);
@@ -347,11 +347,11 @@
}
public final class MultiParagraphIntrinsics implements androidx.ui.text.ParagraphIntrinsics {
- ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.AnnotatedString getAnnotatedString();
method public float getMaxIntrinsicWidth();
method public float getMinIntrinsicWidth();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
property public float maxIntrinsicWidth;
property public float minIntrinsicWidth;
}
@@ -418,11 +418,11 @@
}
public final class ParagraphIntrinsicsKt {
- method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = emptyList(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = emptyList(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
}
public final class ParagraphKt {
- method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public static androidx.ui.text.Paragraph Paragraph(androidx.ui.text.ParagraphIntrinsics paragraphIntrinsics, int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints);
}
@@ -524,24 +524,24 @@
}
public final class TextLayoutInput {
- ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.text.AnnotatedString component1();
method public androidx.ui.core.Constraints component10();
method public androidx.ui.text.TextStyle component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> component3();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> component3();
method public int component4();
method public boolean component5();
method public androidx.ui.text.style.TextOverflow component6();
method public androidx.ui.unit.Density component7();
method public androidx.ui.core.LayoutDirection component8();
method public androidx.ui.text.font.Font.ResourceLoader component9();
- method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.unit.Density getDensity();
method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public int getMaxLines();
method public androidx.ui.text.style.TextOverflow getOverflow();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
method public androidx.ui.text.font.Font.ResourceLoader getResourceLoader();
method public boolean getSoftWrap();
method public androidx.ui.text.TextStyle getStyle();
diff --git a/ui/ui-text-core/api/current.txt b/ui/ui-text-core/api/current.txt
index ba90a67..95424fc 100644
--- a/ui/ui-text-core/api/current.txt
+++ b/ui/ui-text-core/api/current.txt
@@ -201,14 +201,14 @@
package androidx.ui.text {
public final class AnnotatedString {
- ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles);
+ ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles);
method public String component1();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> component3();
- method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> annotations);
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> getSpanStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> getStringAnnotations(String tag, int start, int end);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> component2();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> component3();
+ method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> annotations);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> getSpanStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> getStringAnnotations(String tag, int start, int end);
method public String getText();
method public operator androidx.ui.text.AnnotatedString plus(androidx.ui.text.AnnotatedString other);
}
@@ -234,14 +234,14 @@
property public final int length;
}
- public static final class AnnotatedString.Item<T> {
- ctor public AnnotatedString.Item(T! item, int start, int end, String tag);
- ctor public AnnotatedString.Item(T! item, int start, int end);
+ public static final class AnnotatedString.Range<T> {
+ ctor public AnnotatedString.Range(T! item, int start, int end, String tag);
+ ctor public AnnotatedString.Range(T! item, int start, int end);
method public T! component1();
method public int component2();
method public int component3();
method public String component4();
- method public androidx.ui.text.AnnotatedString.Item<T> copy(T! item, int start, int end, String tag);
+ method public androidx.ui.text.AnnotatedString.Range<T> copy(T! item, int start, int end, String tag);
method public int getEnd();
method public T! getItem();
method public int getStart();
@@ -303,7 +303,7 @@
public final class MultiParagraph {
ctor public MultiParagraph(androidx.ui.text.MultiParagraphIntrinsics intrinsics, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints);
- ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.style.TextDirection getBidiRunDirection(int offset);
method public androidx.ui.geometry.Rect getBoundingBox(int offset);
method public androidx.ui.geometry.Rect getCursorRect(int offset);
@@ -347,11 +347,11 @@
}
public final class MultiParagraphIntrinsics implements androidx.ui.text.ParagraphIntrinsics {
- ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.AnnotatedString getAnnotatedString();
method public float getMaxIntrinsicWidth();
method public float getMinIntrinsicWidth();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
property public float maxIntrinsicWidth;
property public float minIntrinsicWidth;
}
@@ -418,11 +418,11 @@
}
public final class ParagraphIntrinsicsKt {
- method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = emptyList(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = emptyList(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
}
public final class ParagraphKt {
- method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public static androidx.ui.text.Paragraph Paragraph(androidx.ui.text.ParagraphIntrinsics paragraphIntrinsics, int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints);
}
@@ -524,24 +524,24 @@
}
public final class TextLayoutInput {
- ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.text.AnnotatedString component1();
method public androidx.ui.core.Constraints component10();
method public androidx.ui.text.TextStyle component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> component3();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> component3();
method public int component4();
method public boolean component5();
method public androidx.ui.text.style.TextOverflow component6();
method public androidx.ui.unit.Density component7();
method public androidx.ui.core.LayoutDirection component8();
method public androidx.ui.text.font.Font.ResourceLoader component9();
- method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.unit.Density getDensity();
method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public int getMaxLines();
method public androidx.ui.text.style.TextOverflow getOverflow();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
method public androidx.ui.text.font.Font.ResourceLoader getResourceLoader();
method public boolean getSoftWrap();
method public androidx.ui.text.TextStyle getStyle();
diff --git a/ui/ui-text-core/api/public_plus_experimental_0.1.0-dev12.txt b/ui/ui-text-core/api/public_plus_experimental_0.1.0-dev12.txt
index ba90a67..95424fc 100644
--- a/ui/ui-text-core/api/public_plus_experimental_0.1.0-dev12.txt
+++ b/ui/ui-text-core/api/public_plus_experimental_0.1.0-dev12.txt
@@ -201,14 +201,14 @@
package androidx.ui.text {
public final class AnnotatedString {
- ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles);
+ ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles);
method public String component1();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> component3();
- method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> annotations);
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> getSpanStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> getStringAnnotations(String tag, int start, int end);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> component2();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> component3();
+ method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> annotations);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> getSpanStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> getStringAnnotations(String tag, int start, int end);
method public String getText();
method public operator androidx.ui.text.AnnotatedString plus(androidx.ui.text.AnnotatedString other);
}
@@ -234,14 +234,14 @@
property public final int length;
}
- public static final class AnnotatedString.Item<T> {
- ctor public AnnotatedString.Item(T! item, int start, int end, String tag);
- ctor public AnnotatedString.Item(T! item, int start, int end);
+ public static final class AnnotatedString.Range<T> {
+ ctor public AnnotatedString.Range(T! item, int start, int end, String tag);
+ ctor public AnnotatedString.Range(T! item, int start, int end);
method public T! component1();
method public int component2();
method public int component3();
method public String component4();
- method public androidx.ui.text.AnnotatedString.Item<T> copy(T! item, int start, int end, String tag);
+ method public androidx.ui.text.AnnotatedString.Range<T> copy(T! item, int start, int end, String tag);
method public int getEnd();
method public T! getItem();
method public int getStart();
@@ -303,7 +303,7 @@
public final class MultiParagraph {
ctor public MultiParagraph(androidx.ui.text.MultiParagraphIntrinsics intrinsics, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints);
- ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.style.TextDirection getBidiRunDirection(int offset);
method public androidx.ui.geometry.Rect getBoundingBox(int offset);
method public androidx.ui.geometry.Rect getCursorRect(int offset);
@@ -347,11 +347,11 @@
}
public final class MultiParagraphIntrinsics implements androidx.ui.text.ParagraphIntrinsics {
- ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.AnnotatedString getAnnotatedString();
method public float getMaxIntrinsicWidth();
method public float getMinIntrinsicWidth();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
property public float maxIntrinsicWidth;
property public float minIntrinsicWidth;
}
@@ -418,11 +418,11 @@
}
public final class ParagraphIntrinsicsKt {
- method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = emptyList(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = emptyList(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
}
public final class ParagraphKt {
- method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public static androidx.ui.text.Paragraph Paragraph(androidx.ui.text.ParagraphIntrinsics paragraphIntrinsics, int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints);
}
@@ -524,24 +524,24 @@
}
public final class TextLayoutInput {
- ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.text.AnnotatedString component1();
method public androidx.ui.core.Constraints component10();
method public androidx.ui.text.TextStyle component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> component3();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> component3();
method public int component4();
method public boolean component5();
method public androidx.ui.text.style.TextOverflow component6();
method public androidx.ui.unit.Density component7();
method public androidx.ui.core.LayoutDirection component8();
method public androidx.ui.text.font.Font.ResourceLoader component9();
- method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.unit.Density getDensity();
method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public int getMaxLines();
method public androidx.ui.text.style.TextOverflow getOverflow();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
method public androidx.ui.text.font.Font.ResourceLoader getResourceLoader();
method public boolean getSoftWrap();
method public androidx.ui.text.TextStyle getStyle();
diff --git a/ui/ui-text-core/api/public_plus_experimental_current.txt b/ui/ui-text-core/api/public_plus_experimental_current.txt
index ba90a67..95424fc 100644
--- a/ui/ui-text-core/api/public_plus_experimental_current.txt
+++ b/ui/ui-text-core/api/public_plus_experimental_current.txt
@@ -201,14 +201,14 @@
package androidx.ui.text {
public final class AnnotatedString {
- ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles);
+ ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles);
method public String component1();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> component3();
- method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> annotations);
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> getSpanStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> getStringAnnotations(String tag, int start, int end);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> component2();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> component3();
+ method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> annotations);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> getSpanStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> getStringAnnotations(String tag, int start, int end);
method public String getText();
method public operator androidx.ui.text.AnnotatedString plus(androidx.ui.text.AnnotatedString other);
}
@@ -234,14 +234,14 @@
property public final int length;
}
- public static final class AnnotatedString.Item<T> {
- ctor public AnnotatedString.Item(T! item, int start, int end, String tag);
- ctor public AnnotatedString.Item(T! item, int start, int end);
+ public static final class AnnotatedString.Range<T> {
+ ctor public AnnotatedString.Range(T! item, int start, int end, String tag);
+ ctor public AnnotatedString.Range(T! item, int start, int end);
method public T! component1();
method public int component2();
method public int component3();
method public String component4();
- method public androidx.ui.text.AnnotatedString.Item<T> copy(T! item, int start, int end, String tag);
+ method public androidx.ui.text.AnnotatedString.Range<T> copy(T! item, int start, int end, String tag);
method public int getEnd();
method public T! getItem();
method public int getStart();
@@ -303,7 +303,7 @@
public final class MultiParagraph {
ctor public MultiParagraph(androidx.ui.text.MultiParagraphIntrinsics intrinsics, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints);
- ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.style.TextDirection getBidiRunDirection(int offset);
method public androidx.ui.geometry.Rect getBoundingBox(int offset);
method public androidx.ui.geometry.Rect getCursorRect(int offset);
@@ -347,11 +347,11 @@
}
public final class MultiParagraphIntrinsics implements androidx.ui.text.ParagraphIntrinsics {
- ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.AnnotatedString getAnnotatedString();
method public float getMaxIntrinsicWidth();
method public float getMinIntrinsicWidth();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
property public float maxIntrinsicWidth;
property public float minIntrinsicWidth;
}
@@ -418,11 +418,11 @@
}
public final class ParagraphIntrinsicsKt {
- method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = emptyList(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = emptyList(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
}
public final class ParagraphKt {
- method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public static androidx.ui.text.Paragraph Paragraph(androidx.ui.text.ParagraphIntrinsics paragraphIntrinsics, int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints);
}
@@ -524,24 +524,24 @@
}
public final class TextLayoutInput {
- ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.text.AnnotatedString component1();
method public androidx.ui.core.Constraints component10();
method public androidx.ui.text.TextStyle component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> component3();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> component3();
method public int component4();
method public boolean component5();
method public androidx.ui.text.style.TextOverflow component6();
method public androidx.ui.unit.Density component7();
method public androidx.ui.core.LayoutDirection component8();
method public androidx.ui.text.font.Font.ResourceLoader component9();
- method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.unit.Density getDensity();
method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public int getMaxLines();
method public androidx.ui.text.style.TextOverflow getOverflow();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
method public androidx.ui.text.font.Font.ResourceLoader getResourceLoader();
method public boolean getSoftWrap();
method public androidx.ui.text.TextStyle getStyle();
diff --git a/ui/ui-text-core/api/restricted_0.1.0-dev12.txt b/ui/ui-text-core/api/restricted_0.1.0-dev12.txt
index 6b1a5c9..0f3ac3a 100644
--- a/ui/ui-text-core/api/restricted_0.1.0-dev12.txt
+++ b/ui/ui-text-core/api/restricted_0.1.0-dev12.txt
@@ -206,14 +206,14 @@
package androidx.ui.text {
public final class AnnotatedString {
- ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles);
+ ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles);
method public String component1();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> component3();
- method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> annotations);
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> getSpanStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> getStringAnnotations(String tag, int start, int end);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> component2();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> component3();
+ method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> annotations);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> getSpanStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> getStringAnnotations(String tag, int start, int end);
method public String getText();
method public operator androidx.ui.text.AnnotatedString plus(androidx.ui.text.AnnotatedString other);
}
@@ -239,14 +239,14 @@
property public final int length;
}
- public static final class AnnotatedString.Item<T> {
- ctor public AnnotatedString.Item(T! item, int start, int end, String tag);
- ctor public AnnotatedString.Item(T! item, int start, int end);
+ public static final class AnnotatedString.Range<T> {
+ ctor public AnnotatedString.Range(T! item, int start, int end, String tag);
+ ctor public AnnotatedString.Range(T! item, int start, int end);
method public T! component1();
method public int component2();
method public int component3();
method public String component4();
- method public androidx.ui.text.AnnotatedString.Item<T> copy(T! item, int start, int end, String tag);
+ method public androidx.ui.text.AnnotatedString.Range<T> copy(T! item, int start, int end, String tag);
method public int getEnd();
method public T! getItem();
method public int getStart();
@@ -308,7 +308,7 @@
public final class MultiParagraph {
ctor public MultiParagraph(androidx.ui.text.MultiParagraphIntrinsics intrinsics, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints);
- ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.style.TextDirection getBidiRunDirection(int offset);
method public androidx.ui.geometry.Rect getBoundingBox(int offset);
method public androidx.ui.geometry.Rect getCursorRect(int offset);
@@ -352,11 +352,11 @@
}
public final class MultiParagraphIntrinsics implements androidx.ui.text.ParagraphIntrinsics {
- ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.AnnotatedString getAnnotatedString();
method public float getMaxIntrinsicWidth();
method public float getMinIntrinsicWidth();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
property public float maxIntrinsicWidth;
property public float minIntrinsicWidth;
}
@@ -423,11 +423,11 @@
}
public final class ParagraphIntrinsicsKt {
- method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = emptyList(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = emptyList(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
}
public final class ParagraphKt {
- method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public static androidx.ui.text.Paragraph Paragraph(androidx.ui.text.ParagraphIntrinsics paragraphIntrinsics, int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints);
}
@@ -526,13 +526,13 @@
}
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class TextDelegate {
- ctor public TextDelegate(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders);
+ ctor public TextDelegate(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders);
method public androidx.ui.unit.Density getDensity();
method public int getMaxIntrinsicWidth();
method public int getMaxLines();
method public int getMinIntrinsicWidth();
method public androidx.ui.text.style.TextOverflow getOverflow();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
method public androidx.ui.text.font.Font.ResourceLoader getResourceLoader();
method public boolean getSoftWrap();
method public androidx.ui.text.TextStyle getStyle();
@@ -553,24 +553,24 @@
}
public final class TextLayoutInput {
- ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.text.AnnotatedString component1();
method public androidx.ui.core.Constraints component10();
method public androidx.ui.text.TextStyle component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> component3();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> component3();
method public int component4();
method public boolean component5();
method public androidx.ui.text.style.TextOverflow component6();
method public androidx.ui.unit.Density component7();
method public androidx.ui.core.LayoutDirection component8();
method public androidx.ui.text.font.Font.ResourceLoader component9();
- method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.unit.Density getDensity();
method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public int getMaxLines();
method public androidx.ui.text.style.TextOverflow getOverflow();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
method public androidx.ui.text.font.Font.ResourceLoader getResourceLoader();
method public boolean getSoftWrap();
method public androidx.ui.text.TextStyle getStyle();
diff --git a/ui/ui-text-core/api/restricted_current.txt b/ui/ui-text-core/api/restricted_current.txt
index 6b1a5c9..0f3ac3a 100644
--- a/ui/ui-text-core/api/restricted_current.txt
+++ b/ui/ui-text-core/api/restricted_current.txt
@@ -206,14 +206,14 @@
package androidx.ui.text {
public final class AnnotatedString {
- ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles);
+ ctor public AnnotatedString(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles);
method public String component1();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> component3();
- method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> annotations);
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> getSpanStyles();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<java.lang.String>> getStringAnnotations(String tag, int start, int end);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> component2();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> component3();
+ method public androidx.ui.text.AnnotatedString copy(String text, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> paragraphStyles, java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> annotations);
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.ParagraphStyle>> getParagraphStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> getSpanStyles();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<java.lang.String>> getStringAnnotations(String tag, int start, int end);
method public String getText();
method public operator androidx.ui.text.AnnotatedString plus(androidx.ui.text.AnnotatedString other);
}
@@ -239,14 +239,14 @@
property public final int length;
}
- public static final class AnnotatedString.Item<T> {
- ctor public AnnotatedString.Item(T! item, int start, int end, String tag);
- ctor public AnnotatedString.Item(T! item, int start, int end);
+ public static final class AnnotatedString.Range<T> {
+ ctor public AnnotatedString.Range(T! item, int start, int end, String tag);
+ ctor public AnnotatedString.Range(T! item, int start, int end);
method public T! component1();
method public int component2();
method public int component3();
method public String component4();
- method public androidx.ui.text.AnnotatedString.Item<T> copy(T! item, int start, int end, String tag);
+ method public androidx.ui.text.AnnotatedString.Range<T> copy(T! item, int start, int end, String tag);
method public int getEnd();
method public T! getItem();
method public int getStart();
@@ -308,7 +308,7 @@
public final class MultiParagraph {
ctor public MultiParagraph(androidx.ui.text.MultiParagraphIntrinsics intrinsics, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints);
- ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraph(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean ellipsis, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.style.TextDirection getBidiRunDirection(int offset);
method public androidx.ui.geometry.Rect getBoundingBox(int offset);
method public androidx.ui.geometry.Rect getCursorRect(int offset);
@@ -352,11 +352,11 @@
}
public final class MultiParagraphIntrinsics implements androidx.ui.text.ParagraphIntrinsics {
- ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ ctor public MultiParagraphIntrinsics(androidx.ui.text.AnnotatedString annotatedString, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public androidx.ui.text.AnnotatedString getAnnotatedString();
method public float getMaxIntrinsicWidth();
method public float getMinIntrinsicWidth();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
property public float maxIntrinsicWidth;
property public float minIntrinsicWidth;
}
@@ -423,11 +423,11 @@
}
public final class ParagraphIntrinsicsKt {
- method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = emptyList(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = emptyList(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.ParagraphIntrinsics ParagraphIntrinsics(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
}
public final class ParagraphKt {
- method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
+ method public static androidx.ui.text.Paragraph Paragraph(String text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.SpanStyle>> spanStyles = listOf(), java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders = listOf(), int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader);
method public static androidx.ui.text.Paragraph Paragraph(androidx.ui.text.ParagraphIntrinsics paragraphIntrinsics, int maxLines = 2147483647, boolean ellipsis = false, androidx.ui.text.ParagraphConstraints constraints);
}
@@ -526,13 +526,13 @@
}
@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final class TextDelegate {
- ctor public TextDelegate(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders);
+ ctor public TextDelegate(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.text.font.Font.ResourceLoader resourceLoader, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders);
method public androidx.ui.unit.Density getDensity();
method public int getMaxIntrinsicWidth();
method public int getMaxLines();
method public int getMinIntrinsicWidth();
method public androidx.ui.text.style.TextOverflow getOverflow();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
method public androidx.ui.text.font.Font.ResourceLoader getResourceLoader();
method public boolean getSoftWrap();
method public androidx.ui.text.TextStyle getStyle();
@@ -553,24 +553,24 @@
}
public final class TextLayoutInput {
- ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ ctor public TextLayoutInput(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.text.AnnotatedString component1();
method public androidx.ui.core.Constraints component10();
method public androidx.ui.text.TextStyle component2();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> component3();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> component3();
method public int component4();
method public boolean component5();
method public androidx.ui.text.style.TextOverflow component6();
method public androidx.ui.unit.Density component7();
method public androidx.ui.core.LayoutDirection component8();
method public androidx.ui.text.font.Font.ResourceLoader component9();
- method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
+ method public androidx.ui.text.TextLayoutInput copy(androidx.ui.text.AnnotatedString text, androidx.ui.text.TextStyle style, java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> placeholders, int maxLines, boolean softWrap, androidx.ui.text.style.TextOverflow overflow, androidx.ui.unit.Density density, androidx.ui.core.LayoutDirection layoutDirection, androidx.ui.text.font.Font.ResourceLoader resourceLoader, androidx.ui.core.Constraints constraints);
method public androidx.ui.core.Constraints getConstraints();
method public androidx.ui.unit.Density getDensity();
method public androidx.ui.core.LayoutDirection getLayoutDirection();
method public int getMaxLines();
method public androidx.ui.text.style.TextOverflow getOverflow();
- method public java.util.List<androidx.ui.text.AnnotatedString.Item<androidx.ui.text.Placeholder>> getPlaceholders();
+ method public java.util.List<androidx.ui.text.AnnotatedString.Range<androidx.ui.text.Placeholder>> getPlaceholders();
method public androidx.ui.text.font.Font.ResourceLoader getResourceLoader();
method public boolean getSoftWrap();
method public androidx.ui.text.TextStyle getStyle();
diff --git a/ui/ui-text-core/src/androidTest/java/androidx/ui/text/MultiParagraphIntegrationTest.kt b/ui/ui-text-core/src/androidTest/java/androidx/ui/text/MultiParagraphIntegrationTest.kt
index 6d2858b..17d201f 100644
--- a/ui/ui-text-core/src/androidTest/java/androidx/ui/text/MultiParagraphIntegrationTest.kt
+++ b/ui/ui-text-core/src/androidTest/java/androidx/ui/text/MultiParagraphIntegrationTest.kt
@@ -1229,14 +1229,14 @@
val text = AnnotatedString(
text = "ab",
paragraphStyles = listOf(
- ParagraphStyleItem(
+ ParagraphStyleRange(
item = ParagraphStyle(
textDirectionAlgorithm = TextDirectionAlgorithm.ContentOrLtr
),
start = 0,
end = "a".length
),
- ParagraphStyleItem(
+ ParagraphStyleRange(
// skip setting [TextDirectionAlgorithm] on purpose, should inherit from the
// main [ParagraphStyle]
item = ParagraphStyle(),
@@ -1267,7 +1267,7 @@
val fontSize = 20
val width = 2.em
val placeholders = listOf(
- AnnotatedString.Item(
+ AnnotatedString.Range(
Placeholder(width, 1.em, PlaceholderVerticalAlign.AboveBaseline),
0,
1
@@ -1299,7 +1299,7 @@
val fontSize = 20
val width = 30.sp
val placeholders = listOf(
- AnnotatedString.Item(
+ AnnotatedString.Range(
Placeholder(width, 1.em, PlaceholderVerticalAlign.AboveBaseline),
0,
1
@@ -1332,7 +1332,7 @@
val width = 2.em
val height = 1.em
val placeholders = listOf(
- AnnotatedString.Item(
+ AnnotatedString.Range(
Placeholder(width, height, PlaceholderVerticalAlign.AboveBaseline),
0,
1
@@ -1370,12 +1370,12 @@
val width = 2.em
val height = 1.em
val placeholders = listOf(
- AnnotatedString.Item(
+ AnnotatedString.Range(
Placeholder(width, height, PlaceholderVerticalAlign.AboveBaseline),
0,
1
),
- AnnotatedString.Item(
+ AnnotatedString.Range(
Placeholder(width, height, PlaceholderVerticalAlign.AboveBaseline),
2,
3
@@ -1421,7 +1421,7 @@
val width = 2.em
val height = 1.em
val placeholders = listOf(
- AnnotatedString.Item(
+ AnnotatedString.Range(
Placeholder(width, height, PlaceholderVerticalAlign.AboveBaseline),
1,
3
@@ -1464,7 +1464,7 @@
private fun simpleMultiParagraphIntrinsics(
text: AnnotatedString,
fontSize: TextUnit = TextUnit.Inherit,
- placeholders: List<AnnotatedString.Item<Placeholder>> = listOf()
+ placeholders: List<AnnotatedString.Range<Placeholder>> = listOf()
): MultiParagraphIntrinsics {
return MultiParagraphIntrinsics(
text,
diff --git a/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphIntegrationTest.kt b/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphIntegrationTest.kt
index d8fab6b..71fd9bc 100644
--- a/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphIntegrationTest.kt
+++ b/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphIntegrationTest.kt
@@ -2614,7 +2614,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = paragraphWidth)
)
@@ -2638,7 +2638,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
style = TextStyle(fontSize = fontSize),
constraints = ParagraphConstraints(width = paragraphWidth)
)
@@ -2668,8 +2668,8 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, 0, text.length),
- AnnotatedString.Item(spanStyleOverwrite, 0, "abc".length)
+ AnnotatedString.Range(spanStyle, 0, text.length),
+ AnnotatedString.Range(spanStyleOverwrite, 0, "abc".length)
),
constraints = ParagraphConstraints(width = paragraphWidth)
)
@@ -2693,7 +2693,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
style = TextStyle(fontSize = fontSize)
)
@@ -2717,8 +2717,8 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, 0, text.length),
- AnnotatedString.Item(spanStyleNested, 0, text.length)
+ AnnotatedString.Range(spanStyle, 0, text.length),
+ AnnotatedString.Range(spanStyleNested, 0, text.length)
),
style = TextStyle(fontSize = fontSize)
)
@@ -2744,8 +2744,8 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(fontSizeStyle, 0, text.length),
- AnnotatedString.Item(fontSizeScaleStyle, 0, text.length)
+ AnnotatedString.Range(fontSizeStyle, 0, text.length),
+ AnnotatedString.Range(fontSizeScaleStyle, 0, text.length)
),
style = TextStyle(fontSize = paragraphFontSize)
)
@@ -2771,8 +2771,8 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(fontSizeScaleStyle, 0, text.length),
- AnnotatedString.Item(fontSizeStyle, 0, text.length)
+ AnnotatedString.Range(fontSizeScaleStyle, 0, text.length),
+ AnnotatedString.Range(fontSizeStyle, 0, text.length)
),
style = TextStyle(fontSize = paragraphFontSize)
)
@@ -2800,9 +2800,9 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(fontSizeScaleStyle1, 0, text.length),
- AnnotatedString.Item(fontSizeStyle, 0, text.length),
- AnnotatedString.Item(fontSizeScaleStyle2, 0, text.length)
+ AnnotatedString.Range(fontSizeScaleStyle1, 0, text.length),
+ AnnotatedString.Range(fontSizeStyle, 0, text.length),
+ AnnotatedString.Range(fontSizeScaleStyle2, 0, text.length)
),
style = TextStyle(fontSize = paragraphFontSize)
)
@@ -2824,7 +2824,7 @@
val paragraph = simpleParagraph(
text = text,
style = TextStyle(fontSize = fontSize),
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = Float.MAX_VALUE)
)
@@ -2847,7 +2847,7 @@
val paragraph = simpleParagraph(
text = text,
style = TextStyle(fontSize = fontSize),
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = Float.MAX_VALUE)
)
@@ -2870,7 +2870,7 @@
val paragraph = simpleParagraph(
text = text,
style = TextStyle(fontSize = fontSize),
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = Float.MAX_VALUE)
)
@@ -2897,8 +2897,8 @@
text = text,
style = TextStyle(fontSize = fontSize),
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, 0, text.length),
- AnnotatedString.Item(spanStyleOverwrite, 0, "abc".length)
+ AnnotatedString.Range(spanStyle, 0, text.length),
+ AnnotatedString.Range(spanStyleOverwrite, 0, "abc".length)
),
constraints = ParagraphConstraints(width = Float.MAX_VALUE)
)
@@ -2929,8 +2929,8 @@
text = text,
style = TextStyle(fontSize = fontSize),
spanStyles = listOf(
- AnnotatedString.Item(letterSpacingStyle, 0, text.length),
- AnnotatedString.Item(fontSizeStyle, 0, "abc".length)
+ AnnotatedString.Range(letterSpacingStyle, 0, text.length),
+ AnnotatedString.Range(fontSizeStyle, 0, "abc".length)
),
constraints = ParagraphConstraints(width = Float.MAX_VALUE)
)
@@ -2960,8 +2960,8 @@
text = text,
style = TextStyle(fontSize = fontSize),
spanStyles = listOf(
- AnnotatedString.Item(letterSpacingStyle, 0, text.length),
- AnnotatedString.Item(scaleXStyle, 0, "abc".length)
+ AnnotatedString.Range(letterSpacingStyle, 0, text.length),
+ AnnotatedString.Range(scaleXStyle, 0, "abc".length)
),
constraints = ParagraphConstraints(width = Float.MAX_VALUE)
)
@@ -2993,8 +2993,8 @@
text = text,
style = TextStyle(fontSize = fontSize),
spanStyles = listOf(
- AnnotatedString.Item(letterSpacingStyle, 0, text.length),
- AnnotatedString.Item(fontSizeStyle, 0, "abc".length)
+ AnnotatedString.Range(letterSpacingStyle, 0, text.length),
+ AnnotatedString.Range(fontSizeStyle, 0, "abc".length)
),
constraints = ParagraphConstraints(width = Float.MAX_VALUE)
)
@@ -3025,8 +3025,8 @@
text = text,
style = TextStyle(fontSize = fontSize),
spanStyles = listOf(
- AnnotatedString.Item(letterSpacingStyle, 0, text.length),
- AnnotatedString.Item(scaleXStyle, 0, "abc".length)
+ AnnotatedString.Range(letterSpacingStyle, 0, text.length),
+ AnnotatedString.Range(scaleXStyle, 0, "abc".length)
),
constraints = ParagraphConstraints(width = Float.MAX_VALUE)
)
@@ -3055,8 +3055,8 @@
text = text,
style = TextStyle(fontSize = fontSize.sp),
spanStyles = listOf(
- AnnotatedString.Item(letterSpacingEmStyle, 0, text.length),
- AnnotatedString.Item(letterSpacingSpStyle, 0, "abc".length)
+ AnnotatedString.Range(letterSpacingEmStyle, 0, text.length),
+ AnnotatedString.Range(letterSpacingSpStyle, 0, "abc".length)
),
constraints = ParagraphConstraints(width = Float.MAX_VALUE)
)
@@ -3085,8 +3085,8 @@
text = text,
style = TextStyle(fontSize = fontSize.sp),
spanStyles = listOf(
- AnnotatedString.Item(letterSpacingSpStyle, 0, "abc".length),
- AnnotatedString.Item(letterSpacingEmStyle, 0, text.length)
+ AnnotatedString.Range(letterSpacingSpStyle, 0, "abc".length),
+ AnnotatedString.Range(letterSpacingEmStyle, 0, text.length)
),
constraints = ParagraphConstraints(width = 500f)
)
@@ -3254,7 +3254,7 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, "a".length, text.length)
+ AnnotatedString.Range(spanStyle, "a".length, text.length)
),
style = TextStyle(
fontSize = fontSize,
@@ -3279,7 +3279,7 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, 0, "aA".length)
+ AnnotatedString.Range(spanStyle, 0, "aA".length)
),
style = TextStyle(
fontSize = fontSize,
@@ -3313,7 +3313,7 @@
val paragraphShadow = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, 0, text.length)
+ AnnotatedString.Range(spanStyle, 0, text.length)
),
constraints = ParagraphConstraints(width = paragraphWidth)
)
@@ -3806,7 +3806,7 @@
text = text,
style = TextStyle(fontSize = fontSize),
spanStyles = listOf(
- AnnotatedString.Item(
+ AnnotatedString.Range(
SpanStyle(fontSize = styledFontSize), "a".length, "a bb ".length
)
)
@@ -3901,7 +3901,7 @@
style: TextStyle? = null,
maxLines: Int = Int.MAX_VALUE,
ellipsis: Boolean = false,
- spanStyles: List<AnnotatedString.Item<SpanStyle>> = listOf(),
+ spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
density: Density? = null,
constraints: ParagraphConstraints = ParagraphConstraints(Float.MAX_VALUE)
): Paragraph {
diff --git a/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphIntrinsicIntegrationTest.kt b/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphIntrinsicIntegrationTest.kt
index 50f0ebc..277110f 100644
--- a/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphIntrinsicIntegrationTest.kt
+++ b/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphIntrinsicIntegrationTest.kt
@@ -98,7 +98,7 @@
text = text,
fontSize = fontSize,
spanStyles = listOf(
- SpanStyleItem(
+ SpanStyleRange(
item = SpanStyle(fontSize = styledFontSize),
start = "a ".length,
end = "a bb ".length
@@ -182,7 +182,7 @@
text = text,
fontSize = fontSize,
spanStyles = listOf(
- SpanStyleItem(
+ SpanStyleRange(
item = SpanStyle(fontSize = styledFontSize),
start = "a".length,
end = "a bb ".length
@@ -199,7 +199,7 @@
text: String = "",
style: TextStyle? = null,
fontSize: TextUnit = 14.sp,
- spanStyles: List<AnnotatedString.Item<SpanStyle>> = listOf()
+ spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf()
): ParagraphIntrinsics {
return ParagraphIntrinsics(
text = text,
diff --git a/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphPlaceholderIntegrationTest.kt b/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphPlaceholderIntegrationTest.kt
index 0fef88c..1b4cb7e 100644
--- a/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphPlaceholderIntegrationTest.kt
+++ b/ui/ui-text-core/src/androidTest/java/androidx/ui/text/ParagraphPlaceholderIntegrationTest.kt
@@ -38,7 +38,7 @@
val paragraph = simpleParagraph(
text = text,
fontSize = fontSize.sp,
- placeholders = listOf(AnnotatedString.Item(placeholder, 1, 2)),
+ placeholders = listOf(AnnotatedString.Range(placeholder, 1, 2)),
width = Float.MAX_VALUE
)
val placeholderRects = paragraph.placeholderRects
@@ -65,7 +65,7 @@
val paragraph = simpleParagraph(
text = text,
fontSize = fontSize.sp,
- placeholders = listOf(AnnotatedString.Item(placeholder, 1, 2)),
+ placeholders = listOf(AnnotatedString.Range(placeholder, 1, 2)),
width = Float.MAX_VALUE
)
val placeholderRects = paragraph.placeholderRects
@@ -96,7 +96,7 @@
val paragraph = simpleParagraph(
text = text,
fontSize = fontSize.sp,
- placeholders = listOf(AnnotatedString.Item(placeholder, 1, 2)),
+ placeholders = listOf(AnnotatedString.Range(placeholder, 1, 2)),
width = Float.MAX_VALUE
)
val placeholderRects = paragraph.placeholderRects
@@ -124,7 +124,7 @@
val paragraph = simpleParagraph(
text = text,
fontSize = fontSize.sp,
- placeholders = listOf(AnnotatedString.Item(placeholder, 1, 2)),
+ placeholders = listOf(AnnotatedString.Range(placeholder, 1, 2)),
width = Float.MAX_VALUE
)
val placeholderRects = paragraph.placeholderRects
@@ -152,7 +152,7 @@
val paragraph = simpleParagraph(
text = text,
fontSize = fontSize.sp,
- placeholders = listOf(AnnotatedString.Item(placeholder, 1, 2)),
+ placeholders = listOf(AnnotatedString.Range(placeholder, 1, 2)),
width = Float.MAX_VALUE
)
val placeholderRects = paragraph.placeholderRects
@@ -181,7 +181,7 @@
val paragraph = simpleParagraph(
text = text,
fontSize = fontSize.sp,
- placeholders = listOf(AnnotatedString.Item(placeholder, 1, 2)),
+ placeholders = listOf(AnnotatedString.Range(placeholder, 1, 2)),
width = Float.MAX_VALUE
)
val placeholderRects = paragraph.placeholderRects
@@ -210,7 +210,7 @@
val paragraph = simpleParagraph(
text = text,
fontSize = fontSize.sp,
- placeholders = listOf(AnnotatedString.Item(placeholder, 1, 2)),
+ placeholders = listOf(AnnotatedString.Range(placeholder, 1, 2)),
width = Float.MAX_VALUE
)
val placeholderRects = paragraph.placeholderRects
@@ -241,7 +241,7 @@
val paragraph = simpleParagraph(
text = text,
fontSize = fontSize.sp,
- placeholders = listOf(AnnotatedString.Item(placeholder, 1, 2)),
+ placeholders = listOf(AnnotatedString.Range(placeholder, 1, 2)),
width = Float.MAX_VALUE
)
val placeholderRects = paragraph.placeholderRects
@@ -273,9 +273,9 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(SpanStyle(fontSize = fontSizeSpan.sp), 2, 3)
+ AnnotatedString.Range(SpanStyle(fontSize = fontSizeSpan.sp), 2, 3)
),
- placeholders = listOf(AnnotatedString.Item(placeholder, 1, 2)),
+ placeholders = listOf(AnnotatedString.Range(placeholder, 1, 2)),
fontSize = fontSize.sp,
width = Float.MAX_VALUE
)
@@ -305,9 +305,9 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(SpanStyle(fontSize = fontSizeSpan.sp), 2, 3)
+ AnnotatedString.Range(SpanStyle(fontSize = fontSizeSpan.sp), 2, 3)
),
- placeholders = listOf(AnnotatedString.Item(placeholder, 1, 2)),
+ placeholders = listOf(AnnotatedString.Range(placeholder, 1, 2)),
fontSize = fontSize.sp,
width = Float.MAX_VALUE
)
@@ -337,9 +337,9 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(SpanStyle(fontSize = fontSizeSpan.sp), 2, 3)
+ AnnotatedString.Range(SpanStyle(fontSize = fontSizeSpan.sp), 2, 3)
),
- placeholders = listOf(AnnotatedString.Item(placeholder, 1, 2)),
+ placeholders = listOf(AnnotatedString.Range(placeholder, 1, 2)),
fontSize = fontSize.sp,
width = Float.MAX_VALUE
)
@@ -365,8 +365,8 @@
val placeholder = Placeholder(1.em, 1.em, PlaceholderVerticalAlign.TextCenter)
val placeholders = listOf(
- AnnotatedString.Item(placeholder, 0, 1),
- AnnotatedString.Item(placeholder, 2, 3)
+ AnnotatedString.Range(placeholder, 0, 1),
+ AnnotatedString.Range(placeholder, 2, 3)
)
val paragraph = simpleParagraph(
text = text,
@@ -390,8 +390,8 @@
private fun simpleParagraph(
text: String = "",
fontSize: TextUnit = TextUnit.Inherit,
- spanStyles: List<AnnotatedString.Item<SpanStyle>> = listOf(),
- placeholders: List<AnnotatedString.Item<Placeholder>> = listOf(),
+ spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
+ placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
width: Float = Float.MAX_VALUE,
maxLines: Int = Int.MAX_VALUE,
ellipsis: Boolean = false
diff --git a/ui/ui-text-core/src/androidTest/java/androidx/ui/text/platform/AndroidParagraphTest.kt b/ui/ui-text-core/src/androidTest/java/androidx/ui/text/platform/AndroidParagraphTest.kt
index b784a96..e2e5e08 100644
--- a/ui/ui-text-core/src/androidTest/java/androidx/ui/text/platform/AndroidParagraphTest.kt
+++ b/ui/ui-text-core/src/androidTest/java/androidx/ui/text/platform/AndroidParagraphTest.kt
@@ -109,7 +109,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -123,7 +123,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -139,8 +139,8 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, 0, text.length),
- AnnotatedString.Item(spanStyleOverwrite, 0, "abc".length)
+ AnnotatedString.Range(spanStyle, 0, text.length),
+ AnnotatedString.Range(spanStyleOverwrite, 0, "abc".length)
),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -157,7 +157,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -172,7 +172,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -187,7 +187,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -202,7 +202,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -221,7 +221,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -240,7 +240,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = paragraphWidth)
)
@@ -258,7 +258,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = paragraphWidth)
)
@@ -279,8 +279,8 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, 0, text.length),
- AnnotatedString.Item(spanStyleOverwrite, 0, "abc".length)
+ AnnotatedString.Range(spanStyle, 0, text.length),
+ AnnotatedString.Range(spanStyleOverwrite, 0, "abc".length)
),
constraints = ParagraphConstraints(width = paragraphWidth)
)
@@ -300,7 +300,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -317,7 +317,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -334,7 +334,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -349,7 +349,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -366,8 +366,8 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, 0, text.length),
- AnnotatedString.Item(spanStyleOverwrite, 0, "abc".length)
+ AnnotatedString.Range(spanStyle, 0, text.length),
+ AnnotatedString.Range(spanStyleOverwrite, 0, "abc".length)
),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -386,7 +386,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -405,7 +405,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -427,8 +427,8 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, 0, text.length),
- AnnotatedString.Item(spanStyleOverwrite, 0, "abc".length)
+ AnnotatedString.Range(spanStyle, 0, text.length),
+ AnnotatedString.Range(spanStyleOverwrite, 0, "abc".length)
),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -456,7 +456,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -471,7 +471,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -487,8 +487,8 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, 0, text.length),
- AnnotatedString.Item(spanStyleOverwrite, 0, "abc".length)
+ AnnotatedString.Range(spanStyle, 0, text.length),
+ AnnotatedString.Range(spanStyleOverwrite, 0, "abc".length)
),
constraints = ParagraphConstraints(width = 100.0f)
)
@@ -505,7 +505,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = 100.0f) // width is not important
)
@@ -519,7 +519,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = 100.0f) // width is not important
)
@@ -536,8 +536,8 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, 0, text.length),
- AnnotatedString.Item(spanStyleOverwrite, 0, "abc".length)
+ AnnotatedString.Range(spanStyle, 0, text.length),
+ AnnotatedString.Range(spanStyleOverwrite, 0, "abc".length)
),
constraints = ParagraphConstraints(width = 100.0f) // width is not important
)
@@ -554,7 +554,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = 100.0f) // width is not important
)
@@ -574,7 +574,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = 100.0f) // width is not important
)
@@ -592,7 +592,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, text.length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, text.length)),
constraints = ParagraphConstraints(width = 100.0f) // width is not important
)
@@ -631,7 +631,7 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, start = 0, end = text.length)
+ AnnotatedString.Range(spanStyle, start = 0, end = text.length)
),
constraints = ParagraphConstraints(width = 100.0f) // width is not important
)
@@ -663,8 +663,8 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(spanStyle, start = 0, end = text.length),
- AnnotatedString.Item(spanStyleOverwrite, start = 0, end = "abc".length)
+ AnnotatedString.Range(spanStyle, start = 0, end = text.length),
+ AnnotatedString.Range(spanStyleOverwrite, start = 0, end = "abc".length)
),
constraints = ParagraphConstraints(width = 100.0f) // width is not important
)
@@ -704,7 +704,7 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(
+ AnnotatedString.Range(
spanStyle,
expectedStart,
expectedEnd
@@ -741,7 +741,7 @@
val paragraph = simpleParagraph(
text = text,
spanStyles = listOf(
- AnnotatedString.Item(
+ AnnotatedString.Range(
spanStyle,
expectedStart,
expectedEnd
@@ -765,7 +765,7 @@
val paragraph = simpleParagraph(
text = text,
- spanStyles = listOf(AnnotatedString.Item(spanStyle, 0, "abc".length)),
+ spanStyles = listOf(AnnotatedString.Range(spanStyle, 0, "abc".length)),
constraints = ParagraphConstraints(width = 100.0f) // width is not important
)
@@ -1215,7 +1215,7 @@
private fun simpleParagraph(
text: String = "",
- spanStyles: List<AnnotatedString.Item<SpanStyle>> = listOf(),
+ spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
textIndent: TextIndent? = null,
textAlign: TextAlign? = null,
textDirectionAlgorithm: TextDirectionAlgorithm? = TextDirectionAlgorithm.ContentOrLtr,
diff --git a/ui/ui-text-core/src/main/java/androidx/ui/text/AnnotatedString.kt b/ui/ui-text-core/src/main/java/androidx/ui/text/AnnotatedString.kt
index 8d1d9d7..96b889a 100644
--- a/ui/ui-text-core/src/main/java/androidx/ui/text/AnnotatedString.kt
+++ b/ui/ui-text-core/src/main/java/androidx/ui/text/AnnotatedString.kt
@@ -17,7 +17,7 @@
package androidx.ui.text
import androidx.ui.text.AnnotatedString.Builder
-import androidx.ui.text.AnnotatedString.Item
+import androidx.ui.text.AnnotatedString.Range
import java.util.SortedSet
import kotlin.math.max
import kotlin.math.min
@@ -26,13 +26,13 @@
* The class changes the character level style of the specified range.
* @see AnnotatedString.Builder
*/
-typealias SpanStyleItem = Item<SpanStyle>
+typealias SpanStyleRange = Range<SpanStyle>
/**
* The class changes the paragraph level style of the specified range.
* @see AnnotatedString.Builder
*/
-typealias ParagraphStyleItem = Item<ParagraphStyle>
+typealias ParagraphStyleRange = Range<ParagraphStyle>
/**
* The basic data structure of text with multiple styles. To construct an [AnnotatedString] you
@@ -40,14 +40,14 @@
*/
data class AnnotatedString internal constructor(
val text: String,
- val spanStyles: List<SpanStyleItem> = listOf(),
- val paragraphStyles: List<ParagraphStyleItem> = listOf(),
- internal val annotations: List<Item<String>> = listOf()
+ val spanStyles: List<SpanStyleRange> = listOf(),
+ val paragraphStyles: List<ParagraphStyleRange> = listOf(),
+ internal val annotations: List<Range<String>> = listOf()
) {
constructor(
text: String,
- spanStyles: List<SpanStyleItem> = listOf(),
- paragraphStyles: List<ParagraphStyleItem> = listOf()
+ spanStyles: List<SpanStyleRange> = listOf(),
+ paragraphStyles: List<ParagraphStyleRange> = listOf()
) : this(text, spanStyles, paragraphStyles, listOf())
init {
@@ -72,18 +72,18 @@
/**
* Query the string annotations attached on this AnnotatedString.
* Annotations are metadata attached on the AnnotatedString, for example, a URL is a string
- * metadata attached on the a certain range. Annotations are also store with [Item] like the
+ * metadata attached on the a certain range. Annotations are also store with [Range] like the
* styles.
*
* @param tag the tag of the annotations that is being queried. It's used to distinguish
* the annotations for different purposes.
* @param start the start of the query range, inclusive.
* @param end the end of the query range, exclusive.
- * @return a list of annotations stored in [Item]. Notice that All annotations that intersect
+ * @return a list of annotations stored in [Range]. Notice that All annotations that intersect
* with the range [start, end) will be returned. When [start] is bigger than [end], an empty
* list will be returned.
*/
- fun getStringAnnotations(tag: String, start: Int, end: Int): List<Item<String>> =
+ fun getStringAnnotations(tag: String, start: Int, end: Int): List<Range<String>> =
annotations.filter {
tag == it.tag && intersect(start, end, it.start, it.end)
}
@@ -94,10 +94,10 @@
* @param item The object attached to [AnnotatedString]s.
* @param start The start of the range where [item] takes effect. It's inclusive
* @param end The end of the range where [item] takes effect. It's exclusive
- * @param tag The tag used to distinguish the different items. It is useful to store custom
- * data. And [Item]s with same tag can be queried with functions such as [getStringAnnotations].
+ * @param tag The tag used to distinguish the different ranges. It is useful to store custom
+ * data. And [Range]s with same tag can be queried with functions such as [getStringAnnotations].
*/
- data class Item<T>(val item: T, val start: Int, val end: Int, val tag: String) {
+ data class Range<T>(val item: T, val start: Int, val end: Int, val tag: String) {
constructor(item: T, start: Int, end: Int) : this(item, start, end, "")
init {
require(start <= end) { "Reversed range is not supported" }
@@ -114,29 +114,29 @@
*/
class Builder(capacity: Int = 16) {
- private data class MutableItem<T>(
+ private data class MutableRange<T>(
val item: T,
val start: Int,
var end: Int = Int.MIN_VALUE,
val tag: String = ""
) {
/**
- * Create an immutable [Item] object.
+ * Create an immutable [Range] object.
*
* @param defaultEnd if the end is not set yet, it will be set to this value.
*/
- fun toItem(defaultEnd: Int = Int.MIN_VALUE): Item<T> {
+ fun toRange(defaultEnd: Int = Int.MIN_VALUE): Range<T> {
val end = if (end == Int.MIN_VALUE) defaultEnd else end
check(end != Int.MIN_VALUE) { "Item.end should be set first" }
- return Item(item = item, start = start, end = end, tag = tag)
+ return Range(item = item, start = start, end = end, tag = tag)
}
}
private val text: StringBuilder = StringBuilder(capacity)
- private val spanStyles: MutableList<MutableItem<SpanStyle>> = mutableListOf()
- private val paragraphStyles: MutableList<MutableItem<ParagraphStyle>> = mutableListOf()
- private val annotations: MutableList<MutableItem<String>> = mutableListOf()
- private val styleStack: MutableList<MutableItem<out Any>> = mutableListOf()
+ private val spanStyles: MutableList<MutableRange<SpanStyle>> = mutableListOf()
+ private val paragraphStyles: MutableList<MutableRange<ParagraphStyle>> = mutableListOf()
+ private val annotations: MutableList<MutableRange<String>> = mutableListOf()
+ private val styleStack: MutableList<MutableRange<out Any>> = mutableListOf()
/**
* Create an [Builder] instance using the given [String].
@@ -206,7 +206,7 @@
* @param end the exclusive end offset of the range
*/
fun addStyle(style: SpanStyle, start: Int, end: Int) {
- spanStyles.add(MutableItem(item = style, start = start, end = end))
+ spanStyles.add(MutableRange(item = style, start = start, end = end))
}
/**
@@ -218,7 +218,7 @@
* @param end the exclusive end offset of the range
*/
fun addStyle(style: ParagraphStyle, start: Int, end: Int) {
- paragraphStyles.add(MutableItem(item = style, start = start, end = end))
+ paragraphStyles.add(MutableRange(item = style, start = start, end = end))
}
/**
@@ -231,7 +231,7 @@
* @see getStringAnnotations
*/
fun addStringAnnotation(scope: String, annotation: String, start: Int, end: Int) {
- annotations.add(MutableItem(annotation, start, end, scope))
+ annotations.add(MutableRange(annotation, start, end, scope))
}
/**
@@ -243,7 +243,7 @@
* @param style SpanStyle to be applied
*/
fun pushStyle(style: SpanStyle): Int {
- MutableItem(item = style, start = text.length).also {
+ MutableRange(item = style, start = text.length).also {
styleStack.add(it)
spanStyles.add(it)
}
@@ -259,7 +259,7 @@
* @param style ParagraphStyle to be applied
*/
fun pushStyle(style: ParagraphStyle): Int {
- MutableItem(item = style, start = text.length).also {
+ MutableRange(item = style, start = text.length).also {
styleStack.add(it)
paragraphStyles.add(it)
}
@@ -275,10 +275,10 @@
* @param tag the tag used to distinguish annotations
* @param annotation the string annotation attached on this AnnotatedString
* @see getStringAnnotations
- * @see Item
+ * @see Range
*/
fun pushStringAnnotation(tag: String, annotation: String): Int {
- MutableItem(item = annotation, start = text.length, tag = tag).also {
+ MutableRange(item = annotation, start = text.length, tag = tag).also {
styleStack.add(it)
annotations.add(it)
}
@@ -322,9 +322,9 @@
fun toAnnotatedString(): AnnotatedString {
return AnnotatedString(
text = text.toString(),
- spanStyles = spanStyles.map { it.toItem(text.length) }.toList(),
- paragraphStyles = paragraphStyles.map { it.toItem(text.length) }.toList(),
- annotations = annotations.map { it.toItem(text.length) }.toList()
+ spanStyles = spanStyles.map { it.toRange(text.length) }.toList(),
+ paragraphStyles = paragraphStyles.map { it.toRange(text.length) }.toList(),
+ annotations = annotations.map { it.toRange(text.length) }.toList()
)
}
}
@@ -347,26 +347,26 @@
*/
internal fun AnnotatedString.normalizedParagraphStyles(
defaultParagraphStyle: ParagraphStyle
-): List<ParagraphStyleItem> {
+): List<ParagraphStyleRange> {
val length = text.length
val paragraphStyles = paragraphStyles
var lastOffset = 0
- val result = mutableListOf<ParagraphStyleItem>()
+ val result = mutableListOf<ParagraphStyleRange>()
for ((style, start, end) in paragraphStyles) {
if (start != lastOffset) {
- result.add(Item(defaultParagraphStyle, lastOffset, start))
+ result.add(Range(defaultParagraphStyle, lastOffset, start))
}
- result.add(Item(defaultParagraphStyle.merge(style), start, end))
+ result.add(Range(defaultParagraphStyle.merge(style), start, end))
lastOffset = end
}
if (lastOffset != length) {
- result.add(Item(defaultParagraphStyle, lastOffset, length))
+ result.add(Range(defaultParagraphStyle, lastOffset, length))
}
// This is a corner case where annotatedString is an empty string without any ParagraphStyle.
// In this case, a dummy ParagraphStyle is created.
if (result.isEmpty()) {
- result.add(Item(defaultParagraphStyle, 0, 0))
+ result.add(Range(defaultParagraphStyle, 0, 0))
}
return result
}
@@ -382,7 +382,7 @@
private fun AnnotatedString.getLocalStyles(
start: Int,
end: Int
-): List<SpanStyleItem> {
+): List<SpanStyleRange> {
if (start == end) return listOf()
// If the given range covers the whole AnnotatedString, return SpanStyles without conversion.
if (start == 0 && end >= this.text.length) {
@@ -390,7 +390,7 @@
}
return spanStyles.filter { intersect(start, end, it.start, it.end) }
.map {
- Item(
+ Range(
it.item,
it.start.coerceIn(start, end) - start,
it.end.coerceIn(start, end) - start
@@ -421,15 +421,15 @@
defaultParagraphStyle: ParagraphStyle,
crossinline block: (
annotatedString: AnnotatedString,
- paragraphStyle: ParagraphStyleItem
+ paragraphStyle: ParagraphStyleRange
) -> T
): List<T> {
- return normalizedParagraphStyles(defaultParagraphStyle).map { paragraphStyleItem ->
+ return normalizedParagraphStyles(defaultParagraphStyle).map { paragraphStyleRange ->
val annotatedString = substringWithoutParagraphStyles(
- paragraphStyleItem.start,
- paragraphStyleItem.end
+ paragraphStyleRange.start,
+ paragraphStyleRange.end
)
- block(annotatedString, paragraphStyleItem)
+ block(annotatedString, paragraphStyleRange)
}
}
@@ -529,8 +529,8 @@
*/
private fun AnnotatedString.transform(transform: (String, Int, Int) -> String): AnnotatedString {
val transitions = sortedSetOf(0, text.length)
- collectItemTransitions(spanStyles, transitions)
- collectItemTransitions(paragraphStyles, transitions)
+ collectRangeTransitions(spanStyles, transitions)
+ collectRangeTransitions(paragraphStyles, transitions)
var resultStr = ""
val offsetMap = mutableMapOf(0 to 0)
@@ -541,13 +541,13 @@
val newSpanStyles = spanStyles.map {
// The offset map must have mapping entry from all style start, end position.
- Item(it.item, offsetMap[it.start]!!, offsetMap[it.end]!!)
+ Range(it.item, offsetMap[it.start]!!, offsetMap[it.end]!!)
}
val newParaStyles = paragraphStyles.map {
- Item(it.item, offsetMap[it.start]!!, offsetMap[it.end]!!)
+ Range(it.item, offsetMap[it.start]!!, offsetMap[it.end]!!)
}
val newAnnotations = annotations.map {
- Item(it.item, offsetMap[it.start]!!, offsetMap[it.end]!!)
+ Range(it.item, offsetMap[it.start]!!, offsetMap[it.end]!!)
}
return AnnotatedString(
@@ -559,19 +559,19 @@
}
/**
- * Adds all [AnnotatedString.Item] transition points
+ * Adds all [AnnotatedString.Range] transition points
*
- * @param items The list of AnnotatedString.Item
+ * @param ranges The list of AnnotatedString.Range
* @param target The output list
*/
-private fun <T> collectItemTransitions(
- items: List<Item<T>>,
+private fun <T> collectRangeTransitions(
+ ranges: List<Range<T>>,
target: SortedSet<Int>
) {
- items.fold(target) { acc, item ->
+ ranges.fold(target) { acc, range ->
acc.apply {
- add(item.start)
- add(item.end)
+ add(range.start)
+ add(range.end)
}
}
}
@@ -632,16 +632,16 @@
}
/**
- * Filter the Item list based on [Item.start] and [Item.end] to include items only in the range
+ * Filter the range list based on [Range.start] and [Range.end] to include ranges only in the range
* of [start] (inclusive) and [end] (exclusive).
*
* @param start the inclusive start offset of the text range
* @param end the exclusive end offset of the text range
*/
-private fun <T> filterItemsByRange(items: List<Item<T>>, start: Int, end: Int): List<Item<T>> {
+private fun <T> filterRanges(ranges: List<Range<T>>, start: Int, end: Int): List<Range<T>> {
require(start <= end) { "start ($start) should be less than or equal to end ($end)" }
- return items.filter { intersect(start, end, it.start, it.end) }.map {
- Item(
+ return ranges.filter { intersect(start, end, it.start, it.end) }.map {
+ Range(
item = it.item,
start = max(start, it.start) - start,
end = min(end, it.end) - start,
@@ -663,9 +663,9 @@
val text = text.substring(start, end)
return AnnotatedString(
text = text,
- spanStyles = filterItemsByRange(spanStyles, start, end),
- paragraphStyles = filterItemsByRange(paragraphStyles, start, end),
- annotations = filterItemsByRange(annotations, start, end)
+ spanStyles = filterRanges(spanStyles, start, end),
+ paragraphStyles = filterRanges(paragraphStyles, start, end),
+ annotations = filterRanges(annotations, start, end)
)
}
@@ -681,8 +681,8 @@
paragraphStyle: ParagraphStyle? = null
): AnnotatedString = AnnotatedString(
text,
- listOf(Item(spanStyle, 0, text.length)),
- if (paragraphStyle == null) listOf() else listOf(Item(paragraphStyle, 0, text.length))
+ listOf(Range(spanStyle, 0, text.length)),
+ if (paragraphStyle == null) listOf() else listOf(Range(paragraphStyle, 0, text.length))
)
/**
@@ -696,7 +696,7 @@
): AnnotatedString = AnnotatedString(
text,
listOf(),
- listOf(Item(paragraphStyle, 0, text.length))
+ listOf(Range(paragraphStyle, 0, text.length))
)
/**
diff --git a/ui/ui-text-core/src/main/java/androidx/ui/text/MultiParagraph.kt b/ui/ui-text-core/src/main/java/androidx/ui/text/MultiParagraph.kt
index 1a761ac..83a0940 100644
--- a/ui/ui-text-core/src/main/java/androidx/ui/text/MultiParagraph.kt
+++ b/ui/ui-text-core/src/main/java/androidx/ui/text/MultiParagraph.kt
@@ -66,7 +66,7 @@
constructor(
annotatedString: AnnotatedString,
style: TextStyle,
- placeholders: List<AnnotatedString.Item<Placeholder>> = listOf(),
+ placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
maxLines: Int = Int.MAX_VALUE,
ellipsis: Boolean = false,
constraints: ParagraphConstraints,
diff --git a/ui/ui-text-core/src/main/java/androidx/ui/text/MultiParagraphIntrinsics.kt b/ui/ui-text-core/src/main/java/androidx/ui/text/MultiParagraphIntrinsics.kt
index a7750d5..391a74d 100644
--- a/ui/ui-text-core/src/main/java/androidx/ui/text/MultiParagraphIntrinsics.kt
+++ b/ui/ui-text-core/src/main/java/androidx/ui/text/MultiParagraphIntrinsics.kt
@@ -40,7 +40,7 @@
class MultiParagraphIntrinsics(
val annotatedString: AnnotatedString,
style: TextStyle,
- val placeholders: List<AnnotatedString.Item<Placeholder>>,
+ val placeholders: List<AnnotatedString.Range<Placeholder>>,
density: Density,
resourceLoader: Font.ResourceLoader
) : ParagraphIntrinsics {
@@ -112,12 +112,12 @@
}
}
-private fun List<AnnotatedString.Item<Placeholder>>.getLocalPlaceholders(start: Int, end: Int) =
+private fun List<AnnotatedString.Range<Placeholder>>.getLocalPlaceholders(start: Int, end: Int) =
filter { intersect(start, end, it.start, it.end) }.map {
require(start <= it.start && it.end <= end) {
"placeholder can not overlap with paragraph."
}
- AnnotatedString.Item(it.item, it.start - start, it.end - start)
+ AnnotatedString.Range(it.item, it.start - start, it.end - start)
}
internal data class ParagraphIntrinsicInfo(
diff --git a/ui/ui-text-core/src/main/java/androidx/ui/text/Paragraph.kt b/ui/ui-text-core/src/main/java/androidx/ui/text/Paragraph.kt
index 4a9bf47..29c3c08 100644
--- a/ui/ui-text-core/src/main/java/androidx/ui/text/Paragraph.kt
+++ b/ui/ui-text-core/src/main/java/androidx/ui/text/Paragraph.kt
@@ -247,8 +247,8 @@
/* actual */ fun Paragraph(
text: String,
style: TextStyle,
- spanStyles: List<AnnotatedString.Item<SpanStyle>> = listOf(),
- placeholders: List<AnnotatedString.Item<Placeholder>> = listOf(),
+ spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
+ placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
maxLines: Int = DefaultMaxLines,
ellipsis: Boolean = false,
constraints: ParagraphConstraints,
diff --git a/ui/ui-text-core/src/main/java/androidx/ui/text/ParagraphIntrinsics.kt b/ui/ui-text-core/src/main/java/androidx/ui/text/ParagraphIntrinsics.kt
index fe529f3..b2248e3 100644
--- a/ui/ui-text-core/src/main/java/androidx/ui/text/ParagraphIntrinsics.kt
+++ b/ui/ui-text-core/src/main/java/androidx/ui/text/ParagraphIntrinsics.kt
@@ -45,8 +45,8 @@
/* actual */ fun ParagraphIntrinsics(
text: String,
style: TextStyle,
- spanStyles: List<AnnotatedString.Item<SpanStyle>> = emptyList(),
- placeholders: List<AnnotatedString.Item<Placeholder>> = emptyList(),
+ spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
+ placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
density: Density,
resourceLoader: Font.ResourceLoader
): ParagraphIntrinsics {
diff --git a/ui/ui-text-core/src/main/java/androidx/ui/text/TextDelegate.kt b/ui/ui-text-core/src/main/java/androidx/ui/text/TextDelegate.kt
index 0938de9..c26c259 100644
--- a/ui/ui-text-core/src/main/java/androidx/ui/text/TextDelegate.kt
+++ b/ui/ui-text-core/src/main/java/androidx/ui/text/TextDelegate.kt
@@ -83,7 +83,7 @@
val overflow: TextOverflow = TextOverflow.Clip,
val density: Density,
val resourceLoader: Font.ResourceLoader,
- val placeholders: List<AnnotatedString.Item<Placeholder>> = listOf()
+ val placeholders: List<AnnotatedString.Range<Placeholder>> = listOf()
) {
@VisibleForTesting
internal var paragraphIntrinsics: MultiParagraphIntrinsics? = null
diff --git a/ui/ui-text-core/src/main/java/androidx/ui/text/TextLayoutResult.kt b/ui/ui-text-core/src/main/java/androidx/ui/text/TextLayoutResult.kt
index 9f6e9d8..bab9260 100644
--- a/ui/ui-text-core/src/main/java/androidx/ui/text/TextLayoutResult.kt
+++ b/ui/ui-text-core/src/main/java/androidx/ui/text/TextLayoutResult.kt
@@ -52,7 +52,7 @@
* @see MultiParagraph
* @see MultiParagraphIntrinsics
*/
- val placeholders: List<AnnotatedString.Item<Placeholder>>,
+ val placeholders: List<AnnotatedString.Range<Placeholder>>,
/**
* The maxLines param used for computing this text layout.
diff --git a/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraph.kt b/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraph.kt
index 5759ec3..af1aa06 100644
--- a/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraph.kt
+++ b/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraph.kt
@@ -60,8 +60,8 @@
constructor(
text: String,
style: TextStyle,
- spanStyles: List<AnnotatedString.Item<SpanStyle>>,
- placeholders: List<AnnotatedString.Item<Placeholder>>,
+ spanStyles: List<AnnotatedString.Range<SpanStyle>>,
+ placeholders: List<AnnotatedString.Range<Placeholder>>,
maxLines: Int,
ellipsis: Boolean,
constraints: ParagraphConstraints,
diff --git a/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraphHelper.kt b/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraphHelper.kt
index 2af715f..46b4c88 100644
--- a/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraphHelper.kt
+++ b/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraphHelper.kt
@@ -189,8 +189,8 @@
contextFontSize: Float,
lineHeight: TextUnit,
textIndent: TextIndent?,
- spanStyles: List<AnnotatedString.Item<SpanStyle>>,
- placeholders: List<AnnotatedString.Item<Placeholder>>,
+ spanStyles: List<AnnotatedString.Range<SpanStyle>>,
+ placeholders: List<AnnotatedString.Range<Placeholder>>,
density: Density,
typefaceAdapter: TypefaceAdapter
): CharSequence {
diff --git a/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraphIntrinsics.kt b/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraphIntrinsics.kt
index cc8f298..ae1b8145 100644
--- a/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraphIntrinsics.kt
+++ b/ui/ui-text-core/src/main/java/androidx/ui/text/platform/AndroidParagraphIntrinsics.kt
@@ -28,8 +28,8 @@
internal class AndroidParagraphIntrinsics(
val text: String,
val style: TextStyle,
- val spanStyles: List<AnnotatedString.Item<SpanStyle>>,
- val placeholders: List<AnnotatedString.Item<Placeholder>>,
+ val spanStyles: List<AnnotatedString.Range<SpanStyle>>,
+ val placeholders: List<AnnotatedString.Range<Placeholder>>,
val typefaceAdapter: TypefaceAdapter,
val density: Density
) : ParagraphIntrinsics {
@@ -65,7 +65,7 @@
lineHeight = style.lineHeight,
textIndent = style.textIndent,
spanStyles = listOf(
- AnnotatedString.Item(
+ AnnotatedString.Range(
notAppliedStyle,
0,
text.length
diff --git a/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringBuilderTest.kt b/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringBuilderTest.kt
index ea4983a..4f8dbc0 100644
--- a/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringBuilderTest.kt
+++ b/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringBuilderTest.kt
@@ -70,7 +70,7 @@
}
val expectedSpanStyles = listOf(
- AnnotatedString.Item(style, range.start, range.end)
+ AnnotatedString.Range(style, range.start, range.end)
)
assertThat(annotatedString.paragraphStyles).isEmpty()
@@ -87,7 +87,7 @@
}
val expectedParagraphStyles = listOf(
- AnnotatedString.Item(style, range.start, range.end)
+ AnnotatedString.Range(style, range.start, range.end)
)
assertThat(annotatedString.spanStyles).isEmpty()
@@ -148,12 +148,12 @@
val expectedString = "$text$appendedText"
val expectedSpanStyles = listOf(
- SpanStyleItem(
+ SpanStyleRange(
item = SpanStyle(color),
start = 0,
end = text.length
),
- SpanStyleItem(
+ SpanStyleRange(
item = SpanStyle(appendedColor),
start = text.length,
end = expectedString.length
@@ -161,12 +161,12 @@
)
val expectedParagraphStyles = listOf(
- ParagraphStyleItem(
+ ParagraphStyleRange(
item = ParagraphStyle(lineHeight = lineHeight),
start = 0,
end = text.length
),
- ParagraphStyleItem(
+ ParagraphStyleRange(
item = ParagraphStyle(lineHeight = appendedLineHeight),
start = text.length,
end = expectedString.length
@@ -451,7 +451,7 @@
assertThat(buildResult.paragraphStyles).isEmpty()
assertThat(buildResult.spanStyles).isEqualTo(
- listOf(SpanStyleItem(style, 0, buildResult.length))
+ listOf(SpanStyleRange(style, 0, buildResult.length))
)
}
@@ -467,7 +467,7 @@
assertThat(buildResult.spanStyles).isEmpty()
assertThat(buildResult.paragraphStyles).isEqualTo(
- listOf(ParagraphStyleItem(style, 0, buildResult.length))
+ listOf(ParagraphStyleRange(style, 0, buildResult.length))
)
}
@@ -506,12 +506,12 @@
val expectedString = "$text1 $text2"
val expectedSpanStyles = listOf(
- SpanStyleItem(spanStyle1, 0, text1.length),
- SpanStyleItem(spanStyle2, text1.length + 1, expectedString.length)
+ SpanStyleRange(spanStyle1, 0, text1.length),
+ SpanStyleRange(spanStyle2, text1.length + 1, expectedString.length)
)
val expectedParagraphStyles = listOf(
- ParagraphStyleItem(paragraphStyle1, 0, text1.length),
- ParagraphStyleItem(paragraphStyle2, text1.length + 1, expectedString.length)
+ ParagraphStyleRange(paragraphStyle1, 0, text1.length),
+ ParagraphStyleRange(paragraphStyle2, text1.length + 1, expectedString.length)
)
assertThat(buildResult.text).isEqualTo(expectedString)
@@ -603,10 +603,10 @@
assertThat(buildResult.getStringAnnotations(scope, 10, 11)).hasSize(1)
val annotations = buildResult.getStringAnnotations(scope, 0, 11)
assertThat(annotations[0]).isEqualTo(
- AnnotatedString.Item(annotation1, 0, 11, scope)
+ AnnotatedString.Range(annotation1, 0, 11, scope)
)
assertThat(annotations[1]).isEqualTo(
- AnnotatedString.Item(annotation2, 5, 10, scope)
+ AnnotatedString.Range(annotation2, 5, 10, scope)
)
}
@@ -634,11 +634,11 @@
assertThat(buildResult.getStringAnnotations(scope1, 0, 5)).hasSize(1)
assertThat(buildResult.getStringAnnotations(scope1, 5, 10)).hasSize(1)
assertThat(buildResult.getStringAnnotations(scope1, 5, 10).first())
- .isEqualTo(AnnotatedString.Item(annotation1, 0, 11, scope1))
+ .isEqualTo(AnnotatedString.Range(annotation1, 0, 11, scope1))
assertThat(buildResult.getStringAnnotations(scope2, 5, 10)).hasSize(1)
assertThat(buildResult.getStringAnnotations(scope2, 5, 10).first())
- .isEqualTo(AnnotatedString.Item(annotation2, 5, 10, scope2))
+ .isEqualTo(AnnotatedString.Range(annotation2, 5, 10, scope2))
assertThat(buildResult.getStringAnnotations(scope2, 10, 11)).hasSize(0)
}
@@ -678,14 +678,14 @@
return AnnotatedString(
text = text,
spanStyles = listOf(
- SpanStyleItem(
+ SpanStyleRange(
item = SpanStyle(color),
start = 0,
end = text.length
)
),
paragraphStyles = listOf(
- ParagraphStyleItem(
+ ParagraphStyleRange(
item = ParagraphStyle(lineHeight = lineHeight),
start = 0,
end = text.length
diff --git a/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringTest.kt b/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringTest.kt
index 785392b..0b162e1 100644
--- a/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringTest.kt
+++ b/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringTest.kt
@@ -17,7 +17,7 @@
package androidx.ui.text
import androidx.ui.graphics.Color
-import androidx.ui.text.AnnotatedString.Item
+import androidx.ui.text.AnnotatedString.Range
import androidx.ui.text.style.TextAlign
import androidx.ui.unit.sp
import com.google.common.truth.Truth.assertThat
@@ -31,7 +31,7 @@
fun normalizedParagraphStyles() {
val text = "Hello World"
val paragraphStyle = ParagraphStyle(textAlign = TextAlign.Center)
- val paragraphStyles = listOf(Item(paragraphStyle, 0, 5))
+ val paragraphStyles = listOf(Range(paragraphStyle, 0, 5))
val annotatedString = AnnotatedString(text = text, paragraphStyles = paragraphStyles)
val defaultParagraphStyle = ParagraphStyle(lineHeight = 20.sp)
@@ -39,8 +39,8 @@
assertThat(paragraphs).isEqualTo(
listOf(
- Item(defaultParagraphStyle.merge(paragraphStyle), 0, 5),
- Item(defaultParagraphStyle, 5, text.length)
+ Range(defaultParagraphStyle.merge(paragraphStyle), 0, 5),
+ Range(defaultParagraphStyle, 5, text.length)
)
)
}
@@ -53,7 +53,7 @@
val paragraphs = annotatedString.normalizedParagraphStyles(defaultParagraphStyle)
- assertThat(paragraphs).isEqualTo(listOf(Item(defaultParagraphStyle, 0, text.length)))
+ assertThat(paragraphs).isEqualTo(listOf(Range(defaultParagraphStyle, 0, text.length)))
}
@Test
@@ -64,7 +64,7 @@
val paragraphs = annotatedString.normalizedParagraphStyles(defaultParagraphStyle)
- assertThat(paragraphs).isEqualTo(listOf(Item(defaultParagraphStyle, 0, text.length)))
+ assertThat(paragraphs).isEqualTo(listOf(Range(defaultParagraphStyle, 0, text.length)))
}
@Test
@@ -75,7 +75,7 @@
val paragraphs = annotatedString.normalizedParagraphStyles(defaultParagraphStyle)
- assertThat(paragraphs).isEqualTo(listOf(Item(defaultParagraphStyle, 0, text.length)))
+ assertThat(paragraphs).isEqualTo(listOf(Range(defaultParagraphStyle, 0, text.length)))
}
@Test
@@ -86,7 +86,7 @@
val paragraphs = annotatedString.normalizedParagraphStyles(defaultParagraphStyle)
- assertThat(paragraphs).isEqualTo(listOf(Item(defaultParagraphStyle, 0, 1)))
+ assertThat(paragraphs).isEqualTo(listOf(Range(defaultParagraphStyle, 0, 1)))
}
@Test
@@ -100,16 +100,16 @@
fun plus_operator_creates_a_new_annotated_string() {
val text1 = "Hello"
val spanStyles1 = listOf(
- Item(SpanStyle(color = Color.Red), 0, 3),
- Item(SpanStyle(color = Color.Blue), 2, 4)
+ Range(SpanStyle(color = Color.Red), 0, 3),
+ Range(SpanStyle(color = Color.Blue), 2, 4)
)
val paragraphStyles1 = listOf(
- Item(ParagraphStyle(lineHeight = 20.sp), 0, 1),
- Item(ParagraphStyle(lineHeight = 30.sp), 1, 5)
+ Range(ParagraphStyle(lineHeight = 20.sp), 0, 1),
+ Range(ParagraphStyle(lineHeight = 30.sp), 1, 5)
)
val annotations1 = listOf(
- Item("annotation1", 0, 2, "scope1"),
- Item("annotation1", 3, 5, "scope1")
+ Range("annotation1", 0, 2, "scope1"),
+ Range("annotation1", 3, 5, "scope1")
)
val annotatedString1 = AnnotatedString(
text = text1,
@@ -123,22 +123,22 @@
val paragraphStyle = ParagraphStyle(lineHeight = 10.sp)
val annotatedString2 = AnnotatedString(
text = text2,
- spanStyles = listOf(Item(spanStyle, 0, text2.length)),
- paragraphStyles = listOf(Item(paragraphStyle, 0, text2.length)),
- annotations = listOf(Item("annotation2", 0, text2.length, "scope2"))
+ spanStyles = listOf(Range(spanStyle, 0, text2.length)),
+ paragraphStyles = listOf(Range(paragraphStyle, 0, text2.length)),
+ annotations = listOf(Range("annotation2", 0, text2.length, "scope2"))
)
assertThat(annotatedString1 + annotatedString2).isEqualTo(
AnnotatedString(
"$text1$text2",
spanStyles1 + listOf(
- Item(spanStyle, text1.length, text1.length + text2.length)
+ Range(spanStyle, text1.length, text1.length + text2.length)
),
paragraphStyles1 + listOf(
- Item(paragraphStyle, text1.length, text1.length + text2.length)
+ Range(paragraphStyle, text1.length, text1.length + text2.length)
),
annotations1 + listOf(
- Item("annotation2", text1.length, text1.length + text2.length, "scope2")
+ Range("annotation2", text1.length, text1.length + text2.length, "scope2")
)
)
)
@@ -167,7 +167,7 @@
}.subSequence(1, 1)
assertThat(annotatedString).isEqualTo(
- AnnotatedString("", listOf(Item(SpanStyle(fontSize = 12.sp), 0, 0)))
+ AnnotatedString("", listOf(Range(SpanStyle(fontSize = 12.sp), 0, 0)))
)
}
@@ -236,7 +236,7 @@
}
assertThat(annotatedString.subSequence(1, 2)).isEqualTo(
- AnnotatedString("b", listOf(Item(style, 0, 0)))
+ AnnotatedString("b", listOf(Range(style, 0, 0)))
)
}
@@ -255,7 +255,7 @@
// subsequence with 1,1 will remove text, but include the style
assertThat(annotatedString.subSequence(1, 1)).isEqualTo(
- AnnotatedString("", listOf(Item(style, 0, 0)))
+ AnnotatedString("", listOf(Range(style, 0, 0)))
)
}
@@ -270,7 +270,7 @@
}
assertThat(annotatedString.subSequence(1, 1)).isEqualTo(
- AnnotatedString("", listOf(Item(style, 0, 0)))
+ AnnotatedString("", listOf(Range(style, 0, 0)))
)
}
@@ -285,7 +285,7 @@
}
assertThat(annotatedString.subSequence(1, 1)).isEqualTo(
- AnnotatedString("", listOf(Item(style, 0, 0)))
+ AnnotatedString("", listOf(Range(style, 0, 0)))
)
}
@@ -354,7 +354,7 @@
.isEqualTo(
AnnotatedString(
"",
- annotations = listOf(Item("annotation1", 0, 0, "scope1"))
+ annotations = listOf(Range("annotation1", 0, 0, "scope1"))
)
)
@@ -363,7 +363,7 @@
.isEqualTo(
AnnotatedString(
"",
- annotations = listOf(Item("annotation1", 0, 0, "scope1"))
+ annotations = listOf(Range("annotation1", 0, 0, "scope1"))
)
)
}
@@ -382,7 +382,7 @@
.isEqualTo(
AnnotatedString(
"abc",
- annotations = listOf(Item("annotation1", 2, 3, "scope1"))
+ annotations = listOf(Range("annotation1", 2, 3, "scope1"))
)
)
@@ -391,7 +391,7 @@
.isEqualTo(
AnnotatedString(
"de",
- annotations = listOf(Item("annotation1", 0, 1, "scope1"))
+ annotations = listOf(Range("annotation1", 0, 1, "scope1"))
)
)
}
@@ -411,7 +411,7 @@
.isEqualTo(
AnnotatedString(
"abcde",
- annotations = listOf(Item("annotation1", 2, 4, "scope1"))
+ annotations = listOf(Range("annotation1", 2, 4, "scope1"))
)
)
@@ -420,7 +420,7 @@
.isEqualTo(
AnnotatedString(
"cd",
- annotations = listOf(Item("annotation1", 0, 2, "scope1"))
+ annotations = listOf(Range("annotation1", 0, 2, "scope1"))
)
)
}
@@ -443,12 +443,12 @@
@Test(expected = IllegalArgumentException::class)
fun creating_item_with_start_greater_than_end_throws_exception() {
- Item(SpanStyle(color = Color.Red), 1, 0)
+ Range(SpanStyle(color = Color.Red), 1, 0)
}
@Test
fun creating_item_with_start_equal_to_end_does_not_throw_exception() {
- Item(SpanStyle(color = Color.Red), 1, 1)
+ Range(SpanStyle(color = Color.Red), 1, 1)
}
@Test
@@ -458,7 +458,7 @@
assertThat(
AnnotatedString(text, spanStyle)
).isEqualTo(
- AnnotatedString(text, listOf(Item(spanStyle, 0, text.length)))
+ AnnotatedString(text, listOf(Range(spanStyle, 0, text.length)))
)
}
@@ -472,7 +472,7 @@
AnnotatedString(
text,
listOf(),
- listOf(Item(paragraphStyle, 0, text.length))
+ listOf(Range(paragraphStyle, 0, text.length))
)
)
}
@@ -487,8 +487,8 @@
).isEqualTo(
AnnotatedString(
text,
- listOf(Item(spanStyle, 0, text.length)),
- listOf(Item(paragraphStyle, 0, text.length))
+ listOf(Range(spanStyle, 0, text.length)),
+ listOf(Range(paragraphStyle, 0, text.length))
)
)
}
diff --git a/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringTransformTest.kt b/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringTransformTest.kt
index fef6ba4..40ad298 100644
--- a/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringTransformTest.kt
+++ b/ui/ui-text-core/src/test/java/androidx/ui/text/AnnotatedStringTransformTest.kt
@@ -36,8 +36,8 @@
/**
* Helper function for creating AnnotatedString.Item with TextRange.
*/
- private fun <T> makeItem(style: T, range: TextRange) =
- AnnotatedString.Item(style, range.min, range.max)
+ private fun <T> makeRange(style: T, range: TextRange) =
+ AnnotatedString.Range(style, range.min, range.max)
/**
* Make AnnotatedString.Item with original string with using "(" and ")" characters.
@@ -51,14 +51,14 @@
*
* val text = "aaa bbb ccc"
*
- * makeItem(STYLE, "aaa (bbb )ccc")
+ * makeRange(STYLE, "aaa (bbb )ccc")
*/
- private fun <T> makeItem(style: T, rangeStr: String): AnnotatedString.Item<T> {
+ private fun <T> makeRange(style: T, rangeStr: String): AnnotatedString.Range<T> {
val start = rangeStr.indexOf('(')
val end = rangeStr.indexOf(')')
if (start >= end) throw RuntimeException("Invalid range str: $rangeStr")
- return makeItem(style, TextRange(start, end - 1 /* subtract start marker */))
+ return makeRange(style, TextRange(start, end - 1 /* subtract start marker */))
}
@Test
@@ -73,7 +73,7 @@
@Test
fun `English uppercase sparse`() {
val input = AnnotatedString("aaa bbb ccc",
- listOf(makeItem(spanStyle1, "aaa (bbb) ccc")))
+ listOf(makeRange(spanStyle1, "aaa (bbb) ccc")))
val uppercase = input.toUpperCase()
@@ -84,12 +84,12 @@
fun `English uppercase`() {
val input = AnnotatedString("aaa bbb ccc",
listOf(
- makeItem(spanStyle1, "(aaa bbb ccc)"),
- makeItem(spanStyle2, "(aaa )bbb ccc"),
- makeItem(spanStyle3, "aaa (bbb ccc)")
+ makeRange(spanStyle1, "(aaa bbb ccc)"),
+ makeRange(spanStyle2, "(aaa )bbb ccc"),
+ makeRange(spanStyle3, "aaa (bbb ccc)")
), listOf(
- makeItem(paraStyle1, "(aaa bbb )ccc"),
- makeItem(paraStyle2, "aaa bbb (ccc)")
+ makeRange(paraStyle1, "(aaa bbb )ccc"),
+ makeRange(paraStyle2, "aaa bbb (ccc)")
)
)
@@ -104,12 +104,12 @@
fun `English lowercase`() {
val input = AnnotatedString("aaa bbb ccc",
listOf(
- makeItem(spanStyle1, "(aaa bbb ccc)"),
- makeItem(spanStyle2, "(aaa )bbb ccc"),
- makeItem(spanStyle3, "aaa (bbb ccc)")
+ makeRange(spanStyle1, "(aaa bbb ccc)"),
+ makeRange(spanStyle2, "(aaa )bbb ccc"),
+ makeRange(spanStyle3, "aaa (bbb ccc)")
), listOf(
- makeItem(paraStyle1, "(aaa bbb )ccc"),
- makeItem(paraStyle2, "aaa bbb (ccc)")
+ makeRange(paraStyle1, "(aaa bbb )ccc"),
+ makeRange(paraStyle2, "aaa bbb (ccc)")
)
)
@@ -124,12 +124,12 @@
fun `English capitalize`() {
val input = AnnotatedString("aaa bbb ccc",
listOf(
- makeItem(spanStyle1, "(aaa bbb ccc)"),
- makeItem(spanStyle2, "(aaa )bbb ccc"),
- makeItem(spanStyle3, "aaa (bbb ccc)")
+ makeRange(spanStyle1, "(aaa bbb ccc)"),
+ makeRange(spanStyle2, "(aaa )bbb ccc"),
+ makeRange(spanStyle3, "aaa (bbb ccc)")
), listOf(
- makeItem(paraStyle1, "(aaa bbb )ccc"),
- makeItem(paraStyle2, "aaa bbb (ccc)")
+ makeRange(paraStyle1, "(aaa bbb )ccc"),
+ makeRange(paraStyle2, "aaa bbb (ccc)")
)
)
@@ -144,12 +144,12 @@
fun `English decapitalize`() {
val input = AnnotatedString("aaa bbb ccc",
listOf(
- makeItem(spanStyle1, "(aaa bbb ccc)"),
- makeItem(spanStyle2, "(aaa )bbb ccc"),
- makeItem(spanStyle3, "aaa (bbb ccc)")
+ makeRange(spanStyle1, "(aaa bbb ccc)"),
+ makeRange(spanStyle2, "(aaa )bbb ccc"),
+ makeRange(spanStyle3, "aaa (bbb ccc)")
), listOf(
- makeItem(paraStyle1, "(aaa bbb )ccc"),
- makeItem(paraStyle2, "aaa bbb (ccc)")
+ makeRange(paraStyle1, "(aaa bbb )ccc"),
+ makeRange(paraStyle2, "aaa bbb (ccc)")
)
)
@@ -164,12 +164,12 @@
fun `locale dependent uppercase or lowercase (Turkish uppercase)`() {
val input = AnnotatedString("hhh iii jjj",
listOf(
- makeItem(spanStyle1, "(hhh iii jjj)"),
- makeItem(spanStyle2, "(hhh )iii jjj"),
- makeItem(spanStyle3, "hhh (iii jjj)")
+ makeRange(spanStyle1, "(hhh iii jjj)"),
+ makeRange(spanStyle2, "(hhh )iii jjj"),
+ makeRange(spanStyle3, "hhh (iii jjj)")
), listOf(
- makeItem(paraStyle1, "(hhh iii )jjj"),
- makeItem(paraStyle2, "hhh iii (jjj)")
+ makeRange(paraStyle1, "(hhh iii )jjj"),
+ makeRange(paraStyle2, "hhh iii (jjj)")
)
)
@@ -181,15 +181,15 @@
assertEquals(
listOf(
- makeItem(spanStyle1, "(HHH $upperI$upperI$upperI JJJ)"),
- makeItem(spanStyle2, "(HHH )$upperI$upperI$upperI JJJ"),
- makeItem(spanStyle3, "HHH ($upperI$upperI$upperI JJJ)")
+ makeRange(spanStyle1, "(HHH $upperI$upperI$upperI JJJ)"),
+ makeRange(spanStyle2, "(HHH )$upperI$upperI$upperI JJJ"),
+ makeRange(spanStyle3, "HHH ($upperI$upperI$upperI JJJ)")
),
uppercase.spanStyles)
assertEquals(
listOf(
- makeItem(paraStyle1, "(HHH $upperI$upperI$upperI )JJJ"),
- makeItem(paraStyle2, "HHH $upperI$upperI$upperI (JJJ)")
+ makeRange(paraStyle1, "(HHH $upperI$upperI$upperI )JJJ"),
+ makeRange(paraStyle2, "HHH $upperI$upperI$upperI (JJJ)")
),
uppercase.paragraphStyles)
}
@@ -198,12 +198,12 @@
fun `not 1-by-1 mapping uppercase or lowercase (Lithuanian lowercase)`() {
val input = AnnotatedString("HHH ÌÌÌ YYY",
listOf(
- makeItem(spanStyle1, "(HHH ÌÌÌ YYY)"),
- makeItem(spanStyle2, "(HHH )ÌÌÌ YYY"),
- makeItem(spanStyle3, "HHH (ÌÌÌ YYY)")
+ makeRange(spanStyle1, "(HHH ÌÌÌ YYY)"),
+ makeRange(spanStyle2, "(HHH )ÌÌÌ YYY"),
+ makeRange(spanStyle3, "HHH (ÌÌÌ YYY)")
), listOf(
- makeItem(paraStyle1, "(HHH ÌÌÌ )YYY"),
- makeItem(paraStyle2, "HHH ÌÌÌ (YYY)")
+ makeRange(paraStyle1, "(HHH ÌÌÌ )YYY"),
+ makeRange(paraStyle2, "HHH ÌÌÌ (YYY)")
)
)
@@ -215,15 +215,15 @@
val lowerIDot = "Ì".toLowerCase(Locale.forLanguageTag("lt"))
assertEquals(
listOf(
- makeItem(spanStyle1, "(hhh $lowerIDot$lowerIDot$lowerIDot yyy)"),
- makeItem(spanStyle2, "(hhh )$lowerIDot$lowerIDot$lowerIDot yyy"),
- makeItem(spanStyle3, "hhh ($lowerIDot$lowerIDot$lowerIDot yyy)")
+ makeRange(spanStyle1, "(hhh $lowerIDot$lowerIDot$lowerIDot yyy)"),
+ makeRange(spanStyle2, "(hhh )$lowerIDot$lowerIDot$lowerIDot yyy"),
+ makeRange(spanStyle3, "hhh ($lowerIDot$lowerIDot$lowerIDot yyy)")
),
lowercase.spanStyles)
assertEquals(
listOf(
- makeItem(paraStyle1, "(hhh $lowerIDot$lowerIDot$lowerIDot )yyy"),
- makeItem(paraStyle2, "hhh $lowerIDot$lowerIDot$lowerIDot (yyy)")
+ makeRange(paraStyle1, "(hhh $lowerIDot$lowerIDot$lowerIDot )yyy"),
+ makeRange(paraStyle2, "hhh $lowerIDot$lowerIDot$lowerIDot (yyy)")
),
lowercase.paragraphStyles)
}
@@ -232,12 +232,12 @@
fun `nothing happens for CJK uppercase or lowercase (Japanese uppercase)`() {
val input = AnnotatedString("あああ いいい ううう",
listOf(
- makeItem(spanStyle1, "(あああ いいい ううう)"),
- makeItem(spanStyle2, "(あああ )いいい ううう"),
- makeItem(spanStyle3, "あああ (いいい ううう)")
+ makeRange(spanStyle1, "(あああ いいい ううう)"),
+ makeRange(spanStyle2, "(あああ )いいい ううう"),
+ makeRange(spanStyle3, "あああ (いいい ううう)")
), listOf(
- makeItem(paraStyle1, "(あああ いいい )ううう"),
- makeItem(paraStyle2, "あああ いいい (ううう)")
+ makeRange(paraStyle1, "(あああ いいい )ううう"),
+ makeRange(paraStyle2, "あああ いいい (ううう)")
)
)