Merge "Small fixes and apply formatting to protolayout and tile protos." into androidx-main
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/action.proto b/wear/protolayout/protolayout-proto/src/main/proto/action.proto
index 944843d..8e64ff0 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/action.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/action.proto
@@ -3,8 +3,8 @@
package androidx.wear.protolayout.proto;
-import "state.proto";
import "dynamic_data.proto";
+import "state.proto";
option java_package = "androidx.wear.protolayout.proto";
option java_outer_classname = "ActionProto";
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/color.proto b/wear/protolayout/protolayout-proto/src/main/proto/color.proto
index aff2220..f743302 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/color.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/color.proto
@@ -12,12 +12,11 @@
// A property defining a color.
message ColorProp {
-
oneof optional_argb {
- // The static color value, in ARGB format. If a dynamic value is also set and the
- // renderer supports dynamic values for the corresponding field, this static
- // value will be ignored. If the static value is not specified, zero
- // (equivalent to {@link Color#TRANSPARENT}) will be used instead.
+ // The static color value, in ARGB format. If a dynamic value is also set
+ // and the renderer supports dynamic values for the corresponding field,
+ // this static value will be ignored. If the static value is not specified,
+ // zero (equivalent to {@link Color#TRANSPARENT}) will be used instead.
uint32 argb = 1;
}
@@ -32,8 +31,6 @@
message ColorStop {
// The color for this stop. Only opaque colors are supported. Any transparent
// colors will have their alpha component set to 0xFF (opaque).
- //
-
ColorProp color = 1;
oneof optional_offset {
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/device_parameters.proto b/wear/protolayout/protolayout-proto/src/main/proto/device_parameters.proto
index bcd3063..d9b7017 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/device_parameters.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/device_parameters.proto
@@ -53,18 +53,23 @@
// The shape of the device's screen
ScreenShape screen_shape = 5;
- // The maximum schema version supported by the current renderer.
+ // The maximum schema version supported by the current renderer. When building
+ // a layout that uses features not available on schema version 1.0 , this can
+ // be used to conditionally choose which feature to use.
androidx.wear.protolayout.expression.proto.VersionInfo renderer_schema_version = 6;
- // Renderer supported capabilities
+ // Renderer supported Capabilities
Capabilities capabilities = 8;
}
-// Capabilities describing the features that the renderer supports.
+// Capabilities describing the features that the renderer supports. These
+// features are not necessarily tied to a specific schema version. Layout
+// providers can use these information to conditionally generate different
+// layouts based on the presence/value of a feature.
message Capabilities {
- // Current minimum freshness limit in milliseconds. This can change based on
- // various factors. Any freshness request lower than the current limit will be
- // replaced by that limit. A value of 0 here signifies that the minimum
- // freshness limit in unknown.
+ // Current minimum freshness limit in milliseconds for a layout. This can
+ // change based on various factors. Any freshness request lower than the
+ // current limit will be replaced by that limit. A value of 0 here signifies
+ // that the minimum freshness limit in unknown.
uint64 minimum_freshness_limit_millis = 1;
}
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/dimension.proto b/wear/protolayout/protolayout-proto/src/main/proto/dimension.proto
index 78df47e..d910435 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/dimension.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/dimension.proto
@@ -12,21 +12,23 @@
// A type for linear dimensions, measured in dp.
message DpProp {
-
oneof optional_value {
- // The static value, in dp. If a dynamic value is also set and the renderer supports
- // dynamic values for the corresponding field, this static value will be
- // ignored. If the static value is not specified, zero will be used instead.
+ // The static value, in dp. If a dynamic value is also set and the renderer
+ // supports dynamic values for the corresponding field, this static value
+ // will be ignored. If the static value is not specified, zero will be used
+ // instead.
float value = 1;
}
- // The dynamic value, in dp. Note that when setting this value, the static value is
- // still required to be set to support older renderers that only read the
- // static value. If {@code dynamicValue} has an invalid result, the provided
- // static value will be used instead.
+ // The dynamic value, in dp. Note that when setting this value, the static
+ // value is still required to be set to support older renderers that only read
+ // the static value. If {@code dynamicValue} has an invalid result, the
+ // provided static value will be used instead.
androidx.wear.protolayout.expression.proto.DynamicFloat dynamic_value = 2;
oneof optional_value_for_layout {
+ // The fixed value to reserve the space when used on a layout-changing data
+ // bind.
float value_for_layout = 3;
}
@@ -88,23 +90,28 @@
// A type for angular dimensions, measured in degrees.
message DegreesProp {
-
oneof optional_value {
- // The static value, in degrees. If a dynamic value is also set and the renderer
- // supports dynamic values for the corresponding field, this static value will be
- // ignored. If the static value is not specified, zero will be used instead.
+ // The static value, in degrees. If a dynamic value is also set and the
+ // renderer supports dynamic values for the corresponding field, this static
+ // value will be ignored. If the static value is not specified, zero will be
+ // used instead.
float value = 1;
}
- // The dynamic value, in degrees. Note that when setting this value, the static value is
- // still required to be set to support older renderers that only read the
- // static value. If {@code dynamicValue} has an invalid result, the provided
- // static value will be used instead.
+ // The dynamic value, in degrees. Note that when setting this value, the
+ // static value is still required to be set to support older renderers that
+ // only read the static value. If {@code dynamicValue} has an invalid result,
+ // the provided static value will be used instead.
androidx.wear.protolayout.expression.proto.DynamicFloat dynamic_value = 2;
oneof optional_value_for_layout {
+ // The fixed value to reserve the space when used on a layout-changing data
+ // bind.
float value_for_layout = 3;
}
+
+ // Angular alignment of the actual content within the space reserved by
+ // value_for_layout. If not specified, defaults to center alignment.
AngularAlignment angular_alignment_for_layout = 4;
}
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/dynamic.proto b/wear/protolayout/protolayout-proto/src/main/proto/dynamic.proto
index 95c5231..f0a0f04 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/dynamic.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/dynamic.proto
@@ -4,8 +4,8 @@
package androidx.wear.protolayout.expression.proto;
import "animation_parameters.proto";
-import "fixed.proto";
import "fingerprint.proto";
+import "fixed.proto";
option java_package = "androidx.wear.protolayout.expression.proto";
option java_outer_classname = "DynamicProto";
@@ -109,7 +109,9 @@
DynamicFloat value_if_false = 3;
}
-// Rounding mode to use when converting a float to an int32.
+// Rounding mode to use when converting a float to an int32. If the value is
+// larger than {@link Integer#MAX_VALUE} or smaller than {@link
+// Integer#MIN_VALUE}, the result of this operation will be invalid.
enum FloatToInt32RoundMode {
// An undefined rounding mode.
ROUND_MODE_UNDEFINED = 0;
@@ -133,7 +135,7 @@
FloatToInt32RoundMode round_mode = 2;
}
-// A static interpolation node, between two fixed int32 values.
+// A static interpolation, between two fixed int32 values.
message AnimatableFixedInt32 {
// The value to start animating from.
int32 from_value = 1;
@@ -205,15 +207,17 @@
// The source of Int32 data to convert to a string.
DynamicInt32 input = 1;
- // Minimum integer digits. Sign and grouping characters are not considered
- // when applying minIntegerDigits constraint. If not defined, defaults to one.
- // For example,in the English locale, applying minIntegerDigit=4 to 12 would
- // yield "0012".
- optional int32 min_integer_digits = 4;
+ oneof optional_min_integer_digits {
+ // Minimum integer digits. Sign and grouping characters are not considered
+ // when applying minIntegerDigits constraint. If not defined, defaults to
+ // one. For example,in the for locale en_US, applying minIntegerDigit=4 to
+ // 12 would yield "0012".
+ int32 min_integer_digits = 4;
+ }
// Digit grouping used. Grouping size and grouping character depend on the
// current locale. If not defined, defaults to false.
- // For example, in the English locale, using grouping with 1234 would yield
+ // For example, in the for locale en_US, using grouping with 1234 would yield
// "1,234".
bool grouping_used = 5;
}
@@ -255,11 +259,14 @@
// The source of Float data to convert to a string.
DynamicFloat input = 1;
- // Maximum fraction digits. Rounding will be applied if maxFractionDigits is
- // smaller than number of fraction digits. If not defined, defaults to three.
- // minimumFractionDigits must be <= maximumFractionDigits. If the condition is
- // not satisfied, then minimumFractionDigits will be used for both fields.
- optional int32 max_fraction_digits = 2;
+ oneof optional_max_fraction_digits {
+ // Maximum fraction digits. Rounding will be applied if maxFractionDigits is
+ // smaller than number of fraction digits. If not defined, defaults to
+ // three. minimumFractionDigits must be <= maximumFractionDigits. If the
+ // condition is not satisfied, then minimumFractionDigits will be used for
+ // both fields.
+ int32 max_fraction_digits = 2;
+ }
// Minimum fraction digits. Zeros will be appended to the end to satisfy this
// constraint. If not defined, defaults to zero. minimumFractionDigits must be
@@ -267,20 +274,25 @@
// minimumFractionDigits will be used for both fields.
int32 min_fraction_digits = 3;
- // Minimum integer digits. Sign and grouping characters are not considered
- // when applying minIntegerDigits constraint. If not defined, defaults to one.
- // For example, in the English locale, applying minIntegerDigit=4 to 12.34
- // would yield "0012.34".
- optional int32 min_integer_digits = 4;
+ oneof optional_min_integer_digits {
+ // Minimum integer digits. Sign and grouping characters are not considered
+ // when applying minIntegerDigits constraint. If not defined, defaults to
+ // one. For example, in the for locale en_US, applying minIntegerDigit=4
+ // to 12.34 would yield "0012.34".
+ int32 min_integer_digits = 4;
+ }
// Digit grouping used. Grouping size and grouping character depend on the
// current locale. If not defined, defaults to false.
- // For example, in the English locale, using grouping with 1234.56 would yield
- // "1,234.56".
+ // For example, in the for locale en_US, using grouping with 1234.56 would
+ // yield "1,234.56".
bool grouping_used = 5;
}
// A dynamic string type.
+//
+// DynamicString string value is subject to being truncated if it's too
+// long.
message DynamicString {
oneof inner {
FixedString fixed = 1;
@@ -325,7 +337,7 @@
DynamicInt32 input = 1;
}
-// A static interpolation node, between two fixed floating point values.
+// A static interpolation, between two fixed floating point values.
message AnimatableFixedFloat {
// The number to start animating from.
float from_value = 1;
@@ -501,8 +513,8 @@
ComparisonFloatOp float_comparison = 6;
}
- // The fingerprint for the dynamic node
- androidx.wear.protolayout.proto.NodeFingerprint fingerprint = 7;
+ // The fingerprint for the dynamic node
+ androidx.wear.protolayout.proto.NodeFingerprint fingerprint = 7;
}
// A dynamic Color which sources its data from the tile's state.
@@ -514,7 +526,7 @@
string source_namespace = 2;
}
-// A static interpolation node, between two fixed color values.
+// A static interpolation, between two fixed color values.
message AnimatableFixedColor {
// The color value (in ARGB format) to start animating from.
uint32 from_argb = 1;
@@ -546,7 +558,7 @@
// operand. This implements:
// ```color result = condition ? value_if_true : value_if_false```
message ConditionalColorOp {
- // The condition to use.
+ // The condition to use.
DynamicBool condition = 1;
// The color to yield if condition is true.
@@ -588,6 +600,9 @@
}
// A dynamic time instant type.
+//
+// DynamicInstant precision is seconds. Thus, any time or duration
+// operation will operate on that precision level.
message DynamicInstant {
oneof inner {
FixedInstant fixed = 1;
@@ -601,7 +616,8 @@
}
// A dynamic zoned date-time type.
-// <p> DynamicZonedDateTime precision is seconds. Thus, any related time
+//
+// DynamicZonedDateTime precision is seconds. Thus, any related time
// operation will operate on that precision level.
message DynamicZonedDateTime {
oneof inner {
@@ -613,11 +629,12 @@
message InstantToZonedDateTimeOp {
// The instant to convert.
DynamicInstant instant = 1;
+
// The ZoneId following the time-zone ID format used by java {@link ZoneId}.
string zone_id = 2;
}
-// The date-time part to retrieve using ZonedDateTimePartOp.
+// The datetime part to retrieve using ZonedDateTimePartOp.
enum ZonedDateTimePartType {
// Undefined date-time part type.
ZONED_DATE_TIME_PART_UNDEFINED = 0;
@@ -637,12 +654,12 @@
ZONED_DATE_TIME_PART_YEAR = 7;
}
-// Retrieve the specified date-time part of a DynamicZonedDateTime instance as a
+// Retrieve the specified datetime part of a DynamicZonedDateTime instance as a
// DynamicInt32.
message GetZonedDateTimePartOp {
- // The zoned date-time input.
+ // The zoned datetime input.
DynamicZonedDateTime input = 1;
- // The date-time part to retrieve.
+ // The datetime part to retrieve.
ZonedDateTimePartType part_type = 2;
}
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/fixed.proto b/wear/protolayout/protolayout-proto/src/main/proto/fixed.proto
index 7bbe903..f0f1365 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/fixed.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/fixed.proto
@@ -21,7 +21,8 @@
// A fixed float type.
message FixedFloat {
- // The value.
+ // The value. Note that a NAN value is considered invalid and any expression
+ // with this node will have an invalid value.
float value = 1;
}
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/layout.proto b/wear/protolayout/protolayout-proto/src/main/proto/layout.proto
index e55a6199d..8b4eebc 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/layout.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/layout.proto
@@ -83,28 +83,31 @@
// The styling of a font (e.g. font size, and metrics).
message FontStyle {
- // The available sizes of the font, in scaled pixels (sp). If not specified, defaults to the size
- // of the system's "body" font.
+ // The available sizes of the font, in scaled pixels (sp). If not specified,
+ // defaults to the size of the system's "body" font.
//
- // If more than one size is specified and this FontStyle is applied to a Text element with static
- // text, the text size will be automatically picked from the provided sizes to try to perfectly
- // fit within its parent bounds. In other words, the largest size from the specified preset sizes
- // that can fit the most text within the parent bounds will be used.
+ // If more than one size is specified and this FontStyle is applied to a Text
+ // element with static text, the text size will be automatically picked from
+ // the provided sizes to try to perfectly fit within its parent bounds. In
+ // other words, the largest size from the specified preset sizes that can fit
+ // the most text within the parent bounds will be used.
//
- // The specified sizes don't have to be sorted. The maximum number of sizes used is limited to 10.
+ // The specified sizes don't have to be sorted. The maximum number of sizes
+ // used is limited to 10.
//
- // Note that, if multiple sizes are set, the parent of the Text element this corresponds to
- // shouldn't have its width and height set to wrapped, as it can lead to unexpected results.
+ // Note that, if multiple sizes are set, the parent of the Text element this
+ // corresponds to shouldn't have its width and height set to wrapped, as it
+ // can lead to unexpected results.
//
- // If this FontStyle is set to any other element besides Text, or that Text element has dynamic
- // field, only the last added size will be use.
+ // If this FontStyle is set to any other element besides Text, or that Text
+ // element has dynamic field, only the last added size will be use.
//
// Any previously added values with this method or #setSize will be cleared.
//
- // While this field is accessible from 1.0 as singular, it only accepts multiple values since
- // version 1.3 and renderers supporting version 1.3 will use the multiple values to automatically
- // scale text. Renderers who don't support this version will use the first size among multiple
- // values.
+ // While this field is accessible from 1.0 as singular, it only accepts
+ // multiple values since version 1.3 and renderers supporting version 1.3 will
+ // use the multiple values to automatically scale text. Renderers who don't
+ // support this version will use the first size among multiple values.
repeated SpProp size = 1;
// Whether the text should be rendered in a italic typeface. If not specified,
@@ -170,15 +173,15 @@
// Overflow behavior is undefined.
TEXT_OVERFLOW_UNDEFINED = 0;
- // Truncate the text at the last line defined by {@code setMaxLines} in Text to fit in the Text
- // element's bounds, but add an ellipsis (i.e. ...) to the end of the text if it has been
- // truncated.
+ // Truncate the text to fit inside of the Text element's bounds. If text is
+ // truncated, it will be truncated on a word boundary.
TEXT_OVERFLOW_TRUNCATE = 1;
- // Truncate the text to fit in the Text element's bounds, but add an ellipsis
- // (i.e. ...) to the end of the text if it has been truncated. Note that this will not add an
- // ellipsis if the number of lines that fits into the available space is less than the
- // {@code setMaxLines} in Text.
+ // Truncate the text at the last line defined by {@code setMaxLines} in Text
+ // to fit in the Text element's bounds, but add an ellipsis (i.e. ...) to the
+ // end of the text if it has been truncated. Note that this will not add an
+ // ellipsis if the number of lines that fits into the available space is less
+ // than the {@code setMaxLines} in Text.
//
// DEPRECATED: Use {@link #TEXT_OVERFLOW_ELLIPSIZE} instead.
TEXT_OVERFLOW_ELLIPSIZE_END = 2;
@@ -193,8 +196,9 @@
// Truncate the text to fit in the Text element's parent bounds, but add an
// ellipsis (i.e. ...) to the end of the text if it has been truncated.
//
- // <p>Note that, when this is used, the parent of the Text element this corresponds to shouldn't
- // have its width and height set to wrapped, as it can lead to unexpected results.
+ // <p>Note that, when this is used, the parent of the Text element this
+ // corresponds to shouldn't have its width and height set to wrapped, as it
+ // can lead to unexpected results.
TEXT_OVERFLOW_ELLIPSIZE = 4;
}
@@ -215,9 +219,11 @@
// An Android platform specific text style configuration options for styling and
// compatibility.
+// Note that from 1.3 version this field is ignored and defaults to excluded
+// font padding.
message AndroidTextStyle {
- // Whether the Text excludes padding specified by the font, i.e. extra top and bottom padding
- // above the normal ascent and descent. The default is false.
+ // Whether the Text excludes padding specified by the font, i.e. extra top and
+ // bottom padding above the normal ascent and descent. The default is false.
bool exclude_font_padding = 1;
}
@@ -572,6 +578,10 @@
// inside its parent container, and all of its children will be placed on that
// circle. The fields anchor_angle and anchor_type can be used to specify where
// to draw children within this circle.
+//
+// <p> Note that when setting padding for the arc, if padding values (top,
+// button, left, and right) are not equal, the largest between them will be used
+// to apply padding uniformly to all sides.
message Arc {
// Contents of this container.
repeated ArcLayoutElement contents = 1;
@@ -614,7 +624,8 @@
// this value.
DegreesProp max_angle = 6;
- // The direction in which child elements are laid out.
+ // The direction in which child elements are laid out.<setter> If not set,
+ // defaults to ARC_DIRECTION_NORMAL.</setter>
ArcDirectionProp arc_direction = 7;
}
@@ -630,7 +641,8 @@
// Modifiers for this element.
ArcModifiers modifiers = 3;
- // The direction in which this text is drawn.
+ // The direction in which this text is drawn.<setter> If not set, defaults to
+ // ARC_DIRECTION_CLOCKWISE.</setter>
ArcDirectionProp arc_direction = 4;
}
@@ -673,7 +685,8 @@
// The line stroke cap. If not defined, defaults to STROKE_CAP_ROUND.
StrokeCapProp stroke_cap = 6;
- // The direction in which this line is drawn.
+ // The direction in which this line is drawn.<setter> If not set, defaults to
+ // ARC_DIRECTION_CLOCKWISE.</setter>
ArcDirectionProp arc_direction = 8;
}
@@ -752,9 +765,10 @@
ARC_DIRECTION_COUNTER_CLOCKWISE = 2;
}
-// An extensible StrokeCap property.
+// An extensible ArcDirection property that can be set to any curved element to
+// control the drawing direction.
message ArcDirectionProp {
- // The value.
+ // The arc direction value.
ArcDirection value = 1;
}
@@ -768,8 +782,7 @@
// payload cannot be parsed by the renderer extension, then still nothing should
// be rendered, although this behaviour is defined by the renderer extension.
message ExtensionLayoutElement {
-
- // The content of the renderer extension element. This can be any data; it is
+ // The content of the renderer extension element. This can be any data; it is
// expected that the renderer extension knows how to parse this field.
bytes payload = 1;
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/modifiers.proto b/wear/protolayout/protolayout-proto/src/main/proto/modifiers.proto
index d2f90ba..e96b8f6 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/modifiers.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/modifiers.proto
@@ -52,7 +52,7 @@
// Role is undefined. It may be automatically populated.
SEMANTICS_ROLE_NONE = 0;
- // The element is an Image.
+ // The element is an image.
SEMANTICS_ROLE_IMAGE = 1;
// The element is a Button control.
@@ -95,6 +95,8 @@
// The localized state description of the semantics node.
// For example: "on" or "off". This will be dictated when the element is
// focused by the screen reader.
+ //
+ // This field is bindable and will use the dynamic value (if set).
StringProp state_description = 3;
}
@@ -165,29 +167,39 @@
bytes tag_data = 1;
}
-// A modifier to apply transformations to the element. All of these transformations can be animated
-// by setting dynamic values. This modifier is not layout affecting.
+// A modifier to apply transformations to the element. All of these
+// transformations can be animated by setting dynamic values.
+// This modifier is not layout affecting.
message Transformation {
- // The horizontal offset of this element relative to the location where the element's layout
- // placed it. If not set, defaults to zero.
+ // The horizontal offset of this element relative to the location where the
+ // element's layout placed it.
DpProp translation_x = 1;
- // The vertical offset of this element in addition to the location where the element's layout
- // placed it. If not set, defaults to zero.
+
+ // The vertical offset of this element in addition to the location where the
+ // element's layout placed it.
DpProp translation_y = 2;
- // The scale of this element in the x direction around the pivot point, as a proportion of the
- // element's unscaled width. If not set, defaults to one.
+
+ // The scale of this element in the x direction around the pivot point, as a
+ // proportion of the element's unscaled width .
FloatProp scale_x = 3;
- // The scale of this element in the y direction around the pivot point, as a proportion of the
- // element's unscaled height. If not set, defaults to one.
+
+ // The scale of this element in the y direction around the pivot point, as a
+ // proportion of the element's unscaled height.
FloatProp scale_y = 4;
- // The clockwise Degrees that the element is rotated around the pivot point. If not set, defaults
- // to zero.
+
+ // The clockwise degrees that the element is rotated around the pivot point.
DegreesProp rotation = 5;
- // The x offset of the point around which the element is rotated
- // and scaled. Dynamic value is supported. If not set, defaults to the element center.
+
+ // The horizontal location of the point around which the element is rotated
+ // and scaled. With type DpProp, it is the offset from the element center;
+ // otherwise with type BoundingBoxRatio, it is the location proportional to
+ // the bounding box width.
PivotDimension pivot_x = 6;
- // The y offset of the point around which the element is rotated
- // and scaled. Dynamic value is supported. If not set, defaults to the element center.
+
+ // The vertical location of the point around which the element is rotated and
+ // scaled. With type DpProp, it is the offset from the element center;
+ // otherwise with type BoundingBoxRatio, it is the location proportional to
+ // the bounding box height.
PivotDimension pivot_y = 7;
}
@@ -222,7 +234,14 @@
// underneath it.
AnimatedVisibility content_update_animation = 7;
-
+ // Whether the attached element is hidden, or visible. If the element is
+ // hidden, then it will still consume space in the layout, but will not render
+ // any contents, nor will any children render any contents.
+ //
+ // Note that a hidden element also cannot be clickable (i.e. a Clickable
+ // modifier would be ignored).
+ //
+ // Defaults to false (i.e. not hidden).
// This field is deprecated and is only kept for backward compatibility.
BoolProp hidden = 8;
@@ -231,7 +250,8 @@
// Whether the attached element is visible, or hidden. If the element is
// hidden, then it will still consume space in the layout, but will not render
- // any contents, nor will any children render any contents. Defaults to visible.
+ // any contents, nor will any children render any contents. Defaults to
+ // visible.
//
// Note that a hidden element also cannot be clickable (i.e. a Clickable
// modifier would be ignored).
@@ -242,7 +262,7 @@
// The opacity of the element with a value from 0 to 1, where 0 means
// the element is completely transparent and 1 means the element is
- // completely opaque. Dynamic value is supported.
+ // completely opaque. Defaults to 1.
FloatProp opacity = 12;
}
@@ -407,7 +427,9 @@
// descriptions.
Semantics semantics = 2;
- // The opacity of the element
+ // The opacity of the element with a value from 0 to 1, where 0 means
+ // the element is completely transparent and 1 means the element is
+ // completely opaque. Defaults to 1.
FloatProp opacity = 4;
reserved 3;
@@ -425,8 +447,7 @@
// element.
message Shadow {
// The blur radius of the shadow. It controls the size of the blur that is
- // drawn.
- // When set to zero, the shadow is not drawn. Defaults to zero.
+ // drawn. When set to zero, the shadow is not drawn. Defaults to zero.
DpProp blur_radius = 1;
// The color used in the shadow. Defaults to Black.
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/trigger.proto b/wear/protolayout/protolayout-proto/src/main/proto/trigger.proto
index 24e5132..7550beb 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/trigger.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/trigger.proto
@@ -26,7 +26,8 @@
androidx.wear.protolayout.expression.proto.DynamicBool condition = 1;
}
-// The triggers that can be fired.
+// The triggers that can be fired. These triggers can be used to allow acting on
+// events. For example some animations can be set to start based on a trigger.
message Trigger {
oneof inner {
OnVisibleTrigger on_visible_trigger = 1;
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/types.proto b/wear/protolayout/protolayout-proto/src/main/proto/types.proto
index 059ec86..f8e3145 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/types.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/types.proto
@@ -11,7 +11,6 @@
// An int32 type.
message Int32Prop {
-
oneof optional_value {
// The static value.
int32 value = 1;
@@ -23,12 +22,11 @@
// A string type.
message StringProp {
-
oneof optional_value {
- // The static value. If a dynamic value is also set and the renderer supports
- // dynamic values for the corresponding field, this static value will be
- // ignored. If the static value is not specified, {@code null} will be used
- // instead.
+ // The static value. If a dynamic value is also set and the renderer
+ // supports dynamic values for the corresponding field, this static value
+ // will be ignored. If the static value is not specified, {@code null} will
+ // be used instead.
string value = 1;
}
@@ -51,11 +49,11 @@
// A float type.
message FloatProp {
-
oneof optional_value {
- // The static value. If a dynamic value is also set and the renderer supports
- // dynamic values for the corresponding field, this static value will be
- // ignored. If the static value is not specified, zero will be used instead.
+ // The static value. If a dynamic value is also set and the renderer
+ // supports dynamic values for the corresponding field, this static value
+ // will be ignored. If the static value is not specified, zero will be used
+ // instead.
float value = 1;
}
@@ -68,12 +66,17 @@
// A boolean type.
message BoolProp {
-
oneof optional_value {
- // The static value.
+ // The static value. If a dynamic value is also set and the renderer
+ // supports dynamic values for the corresponding field, this static value
+ // will be ignored. If the static value is not specified, false will be used
+ // instead.
bool value = 1;
}
- // The dynamic value.
+ // The dynamic value. Note that when setting this value, the static value is
+ // still required to be set to support older renderers that only read the
+ // static value. If {@code dynamicValue} has an invalid result, the provided
+ // static value will be used instead.
androidx.wear.protolayout.expression.proto.DynamicBool dynamic_value = 2;
}
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/version.proto b/wear/protolayout/protolayout-proto/src/main/proto/version.proto
index 636de02..04f4ba2 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/version.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/version.proto
@@ -1,4 +1,4 @@
-// The schema version information of a layout.
+// The schema version information of a layout (or an expression).
syntax = "proto3";
package androidx.wear.protolayout.expression.proto;
diff --git a/wear/tiles/tiles-proto/src/main/proto/requests.proto b/wear/tiles/tiles-proto/src/main/proto/requests.proto
index 10226de..e7302b0 100644
--- a/wear/tiles/tiles-proto/src/main/proto/requests.proto
+++ b/wear/tiles/tiles-proto/src/main/proto/requests.proto
@@ -12,10 +12,11 @@
// Parameters passed to a Tile Service when the renderer is requesting a new
// version of the tile.
message TileRequest {
- // Parameters describing the device requesting the tile update.
+ // The DeviceParameters object describing the device requesting the tile
+ // update. If not set, a default empty instance is used.
androidx.wear.protolayout.proto.DeviceParameters device_configuration = 1;
- // The state that should be used when building the tile.
+ // The State that should be used when building the tile.
androidx.wear.protolayout.proto.State current_state = 2;
// The ID of the tile being requested.
@@ -38,7 +39,7 @@
// similar.
repeated string resource_ids = 2;
- // Parameters describing the device requesting the resources.
+ // The DeviceParameters object describing the device requesting the resources.
androidx.wear.protolayout.proto.DeviceParameters device_configuration = 3;
// The ID of the tile for which resources are being requested.
diff --git a/wear/tiles/tiles-proto/src/main/proto/tile.proto b/wear/tiles/tiles-proto/src/main/proto/tile.proto
index e87249f..19cd984 100644
--- a/wear/tiles/tiles-proto/src/main/proto/tile.proto
+++ b/wear/tiles/tiles-proto/src/main/proto/tile.proto
@@ -19,7 +19,8 @@
// resource version.
string resources_version = 1;
- // The tiles to show in the carousel, along with their validity periods.
+ // The Timeline containing the layouts for the tiles to show in the carousel,
+ // along with their validity periods.
androidx.wear.protolayout.proto.Timeline tile_timeline = 2;
// The schema version that this tile was built with.