blob: e4b52b9cc22509ee10df91cb9939b73471d7e88c [file] [log] [blame]
// Modifiers for composable layout elements.
syntax = "proto3";
package androidx.wear.tiles.testing.proto;
import "action.proto";
import "color.proto";
import "dimension.proto";
import "types.proto";
option java_package = "androidx.wear.tiles.testing.proto";
option java_outer_classname = "ModifiersProto";
// A modifier for an element which can have associated Actions for click events.
// When an element with a ClickableModifier is clicked it will fire the
// associated action.
message Clickable {
// The ID associated with this action.
string id = 1;
// The action to perform when the element this modifier is attached to is
// clicked.
Action on_click = 2;
}
// A modifier for an element which has accessibility semantics associated with
// it. This should generally be used sparingly, and in most cases should only be
// applied to the top-level layout element or to Clickables.
message Semantics {
// The content description associated with this element. This will be dictated
// when the element is focused by the screen reader.
string content_description = 1;
}
// A modifier to apply padding around an element.
message Padding {
// The padding on the end of the content, depending on the layout direction,
// in DP and the value of "rtl_aware".
DpProp end = 1;
// The padding on the start of the content, depending on the layout direction,
// in DP and the value of "rtl_aware".
DpProp start = 2;
// The padding at the top, in DP.
DpProp top = 3;
// The padding at the bottom, in DP.
DpProp bottom = 4;
// Whether the start/end padding is aware of RTL support. If true, the values
// for start/end will follow the layout direction (i.e. start will refer to
// the right hand side of the container if the device is using an RTL locale).
// If false, start/end will always map to left/right, accordingly.
BoolProp rtl_aware = 5;
}
// A modifier to apply a border around an element.
message Border {
// The width of the border, in DP.
DpProp width = 1;
// The color of the border.
ColorProp color = 2;
}
// The corner of a Box element.
message Corner {
// The radius of the corner in DP.
DpProp radius = 1;
}
// A modifier to apply a background to an element.
message Background {
// The background color for this element. If not defined, defaults to being
// transparent.
ColorProp color = 1;
// The corner properties of this element. This only affects the drawing of
// this element if it has a background color or border. If not defined,
// defaults to having a square corner.
Corner corner = 2;
}
// Modifiers for an element. These may change the way they are drawn (e.g.
// Padding or Background), or change their behaviour (e.g. Clickable, or
// Semantics).
message Modifiers {
// Allows its wrapped element to have actions associated with it, which will
// be executed when the element is tapped.
Clickable clickable = 1;
// Adds metadata for the modified element, for example, screen reader content
// descriptions.
Semantics semantics = 2;
// Adds padding to the modified element.
Padding padding = 3;
// Draws a border around the modified element.
Border border = 4;
// Adds a background (with optional corner radius) to the modified element.
Background background = 5;
}
// Modifiers that can be used with ArcLayoutElements. These may change the way
// they are drawn, or change their behaviour.
message ArcModifiers {
// Allows its wrapped element to have actions associated with it, which will
// be executed when the element is tapped.
Clickable clickable = 1;
// Adds metadata for the modified element, for example, screen reader content
// descriptions.
Semantics semantics = 2;
}
// Modifiers that can be used with Span elements. These may change the way
// they are drawn, or change their behaviour.
message SpanModifiers {
// Allows its wrapped element to have actions associated with it, which will
// be executed when the element is tapped.
Clickable clickable = 1;
}