Update javadoc for fields that are available at 1.0 and made bindable in
1.2.
Bug: 277267696
Change-Id: Ic3a77e22076c01142feec297d8720018daadb060
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/layout.proto b/wear/protolayout/protolayout-proto/src/main/proto/layout.proto
index fe23db4..1b0033d 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/layout.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/layout.proto
@@ -96,6 +96,10 @@
BoolProp underline = 3;
// The text color. If not defined, defaults to white.
+ //
+ // While this field is statically accessible from 1.0, it's only bindable
+ // since version 1.2 and renderers supporting version 1.2 will use the dynamic
+ // value (if set).
ColorProp color = 4;
// The weight of the font. If the provided value is not supported on a
@@ -162,6 +166,15 @@
// A text string.
message Text {
// The text to render.
+ //
+ // While this field is statically accessible from 1.0, it's only bindable
+ // since version 1.2 and renderers supporting version 1.2 will use the dynamic
+ // value (if set).
+ //
+ // When using a dynamic value, make sure to specify the bounding constraints
+ // for the affected layout element through {@code
+ // setLayoutConstraintsForDynamicText(StringLayoutConstraint)} otherwise
+ // {@code build()} fails.
StringProp text = 1;
// The style of font to use (size, bold etc). If not specified, defaults to
@@ -244,6 +257,10 @@
//
// Note that only Android image resources can be tinted; Inline images will
// not be tinted, and this property will have no effect.
+ //
+ // While this field is statically accessible from 1.0, it's only bindable
+ // since version 1.2 and renderers supporting version 1.2 will use the dynamic
+ // value (if set).
ColorProp tint = 1;
}
@@ -282,9 +299,27 @@
// The width of this Spacer. When this is added as the direct child of an Arc,
// this must be specified as an angular dimension, otherwise a linear
// dimension must be used. If not defined, defaults to 0.
+ //
+ // While this field is statically accessible from 1.0, it's only bindable
+ // since version 1.2 and renderers supporting version 1.2 will use the dynamic
+ // value (if set).
+ //
+ // When using a dynamic value, make sure to specify the bounding constraints
+ // for the affected layout element through {@code
+ // setLayoutConstraintsForDynamicWidth(HorizontalLayoutConstraint)} otherwise
+ // {@code build()} fails.
SpacerDimension width = 1;
// The height of this spacer. If not defined, defaults to 0.
+ //
+ // While this field is statically accessible from 1.0, it's only bindable
+ // since version 1.2 and renderers supporting version 1.2 will use the dynamic
+ // value (if set).
+ //
+ // When using a dynamic value, make sure to specify the bounding constraints
+ // for the affected layout element through {@code
+ // setLayoutConstraintsForDynamicWidth(HorizontalLayoutConstraint)} otherwise
+ // {@code build()} fails.
SpacerDimension height = 2;
// Modifiers for this element.
@@ -490,6 +525,15 @@
// Values do not have to be clamped to the range 0-360; values less than 0
// degrees will sweep anti-clockwise (i.e. -90 degrees is equivalent to 270
// degrees), and values >360 will be be placed at X mod 360 degrees.
+ //
+ // While this field is statically accessible from 1.0, it's only bindable
+ // since version 1.2 and renderers supporting version 1.2 will use the dynamic
+ // value (if set).
+ //
+ // When using a dynamic value, make sure to specify the bounding constraints
+ // for the affected layout element through {@code
+ // setLayoutConstraintsForDynamicAnchorAngle(AngularLayoutConstraint)}
+ // otherwise {@code build()} fails.
DegreesProp anchor_angle = 2;
// How to align the contents of this container relative to anchor_angle. If
@@ -529,12 +573,25 @@
// A line that can be used in an Arc and renders as a round progress bar.
message ArcLine {
// The length of this line, in degrees. If not defined, defaults to 0.
+ //
+ // While this field is statically accessible from 1.0, it's only bindable
+ // since version 1.2 and renderers supporting version 1.2 will use the dynamic
+ // value (if set).
+ //
+ // When using a dynamic value, make sure to specify the bounding constraints
+ // for the affected layout element through {@code
+ // setLayoutConstraintsForDynamicLength(AngularLayoutConstraint)} otherwise
+ // {@code build()} fails.
DegreesProp length = 1;
// The thickness of this line. If not defined, defaults to 0.
DpProp thickness = 2;
// The color of this line.
+ //
+ // While this field is statically accessible from 1.0, it's only bindable
+ // since version 1.2 and renderers supporting version 1.2 will use the dynamic
+ // value (if set).
ColorProp color = 3;
// Modifiers for this element.
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/modifiers.proto b/wear/protolayout/protolayout-proto/src/main/proto/modifiers.proto
index 0e765ca..4b4a012 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/modifiers.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/modifiers.proto
@@ -60,6 +60,10 @@
// The content description associated with this element. This will be dictated
// when the element is focused by the screen reader.
+ //
+ // While this field is statically accessible from 1.0, it's only bindable
+ // since version 1.2 and renderers supporting version 1.2 will use the dynamic
+ // value (if set).
StringProp content_description = 4;
// The type of user interface element. Accessibility services might use this
@@ -101,6 +105,10 @@
DpProp width = 1;
// The color of the border.
+ //
+ // While this field is statically accessible from 1.0, it's only bindable
+ // since version 1.2 and renderers supporting version 1.2 will use the dynamic
+ // value (if set).
ColorProp color = 2;
}
@@ -114,6 +122,10 @@
message Background {
// The background color for this element. If not defined, defaults to being
// transparent.
+ //
+ // While this field is statically accessible from 1.0, it's only bindable
+ // since version 1.2 and renderers supporting version 1.2 will use the dynamic
+ // value (if set).
ColorProp color = 1;
// The corner properties of this element. This only affects the drawing of
diff --git a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/LayoutElementBuilders.java b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/LayoutElementBuilders.java
index ddfea03..e20a3f37f 100644
--- a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/LayoutElementBuilders.java
+++ b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/LayoutElementBuilders.java
@@ -445,8 +445,9 @@
}
/**
- * Gets the text color. If not defined, defaults to white. Intended for testing purposes
- * only.
+ * Gets the text color. If not defined, defaults to white.
+ *
+ * @since 1.0
*/
@Nullable
public ColorProp getColor() {
@@ -585,9 +586,8 @@
/**
* Sets the text color. If not defined, defaults to white.
*
- * <p>This field is made bindable from version 1.2 and will use the dynamic value (if
- * set). Older renderers will still consider this field as non-bindable and will use the
- * static value.
+ * <p>While this field is statically accessible from 1.0, it's only bindable since
+ * version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
*
* @since 1.0
*/
@@ -914,8 +914,8 @@
public Builder() {}
/**
- * Sets whether the {@link Text} excludes padding specified by the font, i.e. extra
- * top and bottom padding above the normal ascent and descent. The default is false.
+ * Sets whether the {@link Text} excludes padding specified by the font, i.e. extra top
+ * and bottom padding above the normal ascent and descent. The default is false.
*
* @since 1.2
*/
@@ -945,7 +945,11 @@
this.mFingerprint = fingerprint;
}
- /** Gets the text to render. Intended for testing purposes only. */
+ /**
+ * Gets the text to render.
+ *
+ * @since 1.0
+ */
@Nullable
public StringProp getText() {
if (mImpl.hasText()) {
@@ -1119,14 +1123,13 @@
/**
* Sets the text to render.
*
- * <p>This field is made bindable from version 1.2 and will use the dynamic value (if
- * set). Older renderers will still consider this field as non-bindable and will use the
- * static value.
+ * <p>While this field is statically accessible from 1.0, it's only bindable since
+ * version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
*
* <p>When using a dynamic value, make sure to specify the bounding constraints for the
- * affected layout element through {@link
- * #setLayoutConstraintsForDynamicText(StringLayoutConstraint)} otherwise {@link
- * #build()} fails.
+ * affected layout element through {@code
+ * setLayoutConstraintsForDynamicText(StringLayoutConstraint)} otherwise {@code build()}
+ * fails.
*
* @since 1.0
*/
@@ -1404,7 +1407,9 @@
* alpha channel will be blended with the requested color).
*
* <p>Note that only Android image resources can be tinted; Inline images will not be
- * tinted, and this property will have no effect. Intended for testing purposes only.
+ * tinted, and this property will have no effect.
+ *
+ * @since 1.0
*/
@Nullable
public ColorProp getTint() {
@@ -1448,9 +1453,10 @@
* <p>Note that only Android image resources can be tinted; Inline images will not be
* tinted, and this property will have no effect.
*
- * <p>This field is made bindable from version 1.2 and will use the dynamic value (if
- * set). Older renderers will still consider this field as non-bindable and will use the
- * static value.
+ * <p>While this field is statically accessible from 1.0, it's only bindable since
+ * version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
+ *
+ * @since 1.0
*/
@NonNull
public Builder setTint(@NonNull ColorProp tint) {
@@ -1703,6 +1709,8 @@
* Gets the width of this {@link Spacer}. When this is added as the direct child of an
* {@link Arc}, this must be specified as an angular dimension, otherwise a linear dimension
* must be used. If not defined, defaults to 0.
+ *
+ * @since 1.0
*/
@Nullable
public SpacerDimension getWidth() {
@@ -1728,7 +1736,11 @@
}
}
- /** Gets the height of this spacer. If not defined, defaults to 0. */
+ /**
+ * Gets the height of this spacer. If not defined, defaults to 0.
+ *
+ * @since 1.0
+ */
@Nullable
public SpacerDimension getHeight() {
if (mImpl.hasHeight()) {
@@ -1803,14 +1815,15 @@
* {@link Arc}, this must be specified as an angular dimension, otherwise a linear
* dimension must be used. If not defined, defaults to 0.
*
- * <p>This field is made bindable from version 1.2 and will use the dynamic value (if
- * set). Older renderers will still consider this field as non-bindable and will use the
- * static value.
+ * <p>While this field is statically accessible from 1.0, it's only bindable since
+ * version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
*
* <p>When using a dynamic value, make sure to specify the bounding constraints for the
- * affected layout element through {@link
- * #setLayoutConstraintsForDynamicWidth(HorizontalLayoutConstraint)} otherwise {@link
- * #build()} fails.
+ * affected layout element through {@code
+ * setLayoutConstraintsForDynamicWidth(HorizontalLayoutConstraint)} otherwise {@code
+ * build()} fails.
+ *
+ * @since 1.0
*/
@NonNull
public Builder setWidth(@NonNull SpacerDimension width) {
@@ -1847,14 +1860,13 @@
/**
* Sets the height of this spacer. If not defined, defaults to 0.
*
- * <p>This field is made bindable from version 1.2 and will use the dynamic value (if
- * set). Older renderers will still consider this field as non-bindable and will use the
- * static value.
+ * <p>While this field is statically accessible from 1.0, it's only bindable since
+ * version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
*
* <p>When using a dynamic value, make sure to specify the bounding constraints for the
- * affected layout element through {@link
- * #setLayoutConstraintsForDynamicWidth(HorizontalLayoutConstraint)} otherwise {@link
- * #build()} fails.
+ * affected layout element through {@code
+ * setLayoutConstraintsForDynamicWidth(HorizontalLayoutConstraint)} otherwise {@code
+ * build()} fails.
*
* @since 1.0
*/
@@ -3252,7 +3264,9 @@
*
* <p>Values do not have to be clamped to the range 0-360; values less than 0 degrees will
* sweep anti-clockwise (i.e. -90 degrees is equivalent to 270 degrees), and values >360
- * will be be placed at X mod 360 degrees. Intended for testing purposes only.
+ * will be be placed at X mod 360 degrees.
+ *
+ * @since 1.0
*/
@Nullable
public DegreesProp getAnchorAngle() {
@@ -3368,14 +3382,13 @@
* will sweep anti-clockwise (i.e. -90 degrees is equivalent to 270 degrees), and values
* >360 will be be placed at X mod 360 degrees.
*
- * <p>This field is made bindable from version 1.2 and will use the dynamic value (if
- * set). Older renderers will still consider this field as non-bindable and will use the
- * static value.
+ * <p>While this field is statically accessible from 1.0, it's only bindable since
+ * version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
*
* <p>When using a dynamic value, make sure to specify the bounding constraints for the
- * affected layout element through {@link
- * #setLayoutConstraintsForDynamicAnchorAngle(AngularLayoutConstraint)} otherwise {@link
- * #build()} fails.
+ * affected layout element through {@code
+ * setLayoutConstraintsForDynamicAnchorAngle(AngularLayoutConstraint)} otherwise {@code
+ * build()} fails.
*
* @since 1.0
*/
@@ -3627,8 +3640,9 @@
}
/**
- * Gets the length of this line, in degrees. If not defined, defaults to 0. Intended for
- * testing purposes only.
+ * Gets the length of this line, in degrees. If not defined, defaults to 0.
+ *
+ * @since 1.0
*/
@Nullable
public DegreesProp getLength() {
@@ -3667,7 +3681,11 @@
}
}
- /** Gets the color of this line. Intended for testing purposes only. */
+ /**
+ * Gets the color of this line.
+ *
+ * @since 1.0
+ */
@Nullable
public ColorProp getColor() {
if (mImpl.hasColor()) {
@@ -3725,14 +3743,13 @@
/**
* Sets the length of this line, in degrees. If not defined, defaults to 0.
*
- * <p>This field is made bindable from version 1.2 and will use the dynamic value (if
- * set). Older renderers will still consider this field as non-bindable and will use the
- * static value.
+ * <p>While this field is statically accessible from 1.0, it's only bindable since
+ * version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
*
* <p>When using a dynamic value, make sure to specify the bounding constraints for the
- * affected layout element through {@link
- * #setLayoutConstraintsForDynamicLength(AngularLayoutConstraint)} otherwise {@link
- * #build()} fails.
+ * affected layout element through {@code
+ * setLayoutConstraintsForDynamicLength(AngularLayoutConstraint)} otherwise {@code
+ * build()} fails.
*
* @since 1.0
*/
@@ -3773,9 +3790,8 @@
/**
* Sets the color of this line.
*
- * <p>This field is made bindable from version 1.2 and will use the dynamic value (if
- * set). Older renderers will still consider this field as non-bindable and will use the
- * static value.
+ * <p>While this field is statically accessible from 1.0, it's only bindable since
+ * version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
*
* @since 1.0
*/
diff --git a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/ModifiersBuilders.java b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/ModifiersBuilders.java
index 9b854fd..3e8ae62 100644
--- a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/ModifiersBuilders.java
+++ b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/ModifiersBuilders.java
@@ -449,10 +449,6 @@
* Gets the content description associated with this element. This will be dictated when the
* element is focused by the screen reader.
*
- * <p>This field is made bindable from version 1.2 and will use the dynamic value (if set).
- * Older renderers will still consider this field as non-bindable and will use the static
- * value.
- *
* @since 1.0
*/
@Nullable
@@ -577,9 +573,8 @@
* Sets the content description associated with this element. This will be dictated when
* the element is focused by the screen reader.
*
- * <p>This field is made bindable and will use the dynamic value (if set) from version
- * 1.2 Older renderers will still consider this field as non-bindable and will use the
- * static value.
+ * <p>While this field is statically accessible from 1.0, it's only bindable since
+ * version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
*
* @since 1.0
*/
@@ -921,9 +916,8 @@
/**
* Sets the color of the border.
*
- * <p>This field is made bindable and will use the dynamic value (if set) from version
- * 1.2 Older renderers will still consider this field as non-bindable and will use the
- * static value.
+ * <p>While this field is statically accessible from 1.0, it's only bindable since
+ * version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
*
* @since 1.0
*/
@@ -1110,9 +1104,8 @@
* Sets the background color for this element. If not defined, defaults to being
* transparent.
*
- * <p>This field is made bindable and supports dynamic colors from version 1.2 Older
- * renderers will still consider this field as non-bindable and will use the static
- * value.
+ * <p>While this field is statically accessible from 1.0, it's only bindable since
+ * version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
*
* @since 1.0
*/