1// Alignment messages and enumerations, for use in other elements. 2syntax = "proto3"; 3 4package androidx.wear.protolayout.proto; 5 6option java_package = "androidx.wear.protolayout.proto"; 7option java_outer_classname = "AlignmentProto"; 8 9// The horizontal alignment of an element within its container. 10enum HorizontalAlignment { 11 // Horizontal alignment is undefined. 12 HORIZONTAL_ALIGN_UNDEFINED = 0; 13 14 // Horizontally align to the left. 15 HORIZONTAL_ALIGN_LEFT = 1; 16 17 // Horizontally align to center. 18 HORIZONTAL_ALIGN_CENTER = 2; 19 20 // Horizontally align to the right. 21 HORIZONTAL_ALIGN_RIGHT = 3; 22 23 // Horizontally align to the content start (left in LTR layouts, right in RTL 24 // layouts). 25 HORIZONTAL_ALIGN_START = 4; 26 27 // Horizontally align to the content end (right in LTR layouts, left in RTL 28 // layouts). 29 HORIZONTAL_ALIGN_END = 5; 30} 31 32// An extensible HorizontalAlignment property. 33message HorizontalAlignmentProp { 34 // The value 35 HorizontalAlignment value = 1; 36} 37 38// The vertical alignment of an element within its container. 39enum VerticalAlignment { 40 // Vertical alignment is undefined. 41 VERTICAL_ALIGN_UNDEFINED = 0; 42 43 // Vertically align to the top. 44 VERTICAL_ALIGN_TOP = 1; 45 46 // Vertically align to center. 47 VERTICAL_ALIGN_CENTER = 2; 48 49 // Vertically align to the bottom. 50 VERTICAL_ALIGN_BOTTOM = 3; 51} 52 53// An extensible VerticalAlignment property. 54message VerticalAlignmentProp { 55 // The value. 56 VerticalAlignment value = 1; 57} 58 59// Alignment of a text element. 60enum TextAlignment { 61 // Alignment is undefined. 62 TEXT_ALIGN_UNDEFINED = 0; 63 64 // Align to the "start" of the Text element (left in LTR layouts, right in 65 // RTL layouts). 66 TEXT_ALIGN_START = 1; 67 68 // Align to the center of the Text element. 69 TEXT_ALIGN_CENTER = 2; 70 71 // Align to the "end" of the Text element (right in LTR layouts, left in RTL 72 // layouts). 73 TEXT_ALIGN_END = 3; 74} 75 76// An extensible TextAlignment property. 77message TextAlignmentProp { 78 // The value. 79 TextAlignment value = 1; 80} 81 82// The anchor position of an Arc's elements. This is used to specify how 83// elements added to an Arc should be laid out with respect to anchor_angle. 84// 85// As an example, assume that the following diagrams are wrapped to an arc, and 86// each represents an Arc element containing a single Text element. The Text 87// element's anchor_angle is "0" for all cases. 88// 89// ``` 90// ARC_ANCHOR_START: 91// -180 0 180 92// Hello World! 93// 94// 95// ARC_ANCHOR_CENTER: 96// -180 0 180 97// Hello World! 98// 99// ARC_ANCHOR_END: 100// -180 0 180 101// Hello World! 102// ``` 103enum ArcAnchorType { 104 // Anchor position is undefined. 105 ARC_ANCHOR_UNDEFINED = 0; 106 107 // Anchor at the start of the elements. This will cause elements added to an 108 // arc to begin at the given anchor_angle, and sweep around to the right. 109 ARC_ANCHOR_START = 1; 110 111 // Anchor at the center of the elements. This will cause the center of the 112 // whole set of elements added to an arc to be pinned at the given 113 // anchor_angle. 114 ARC_ANCHOR_CENTER = 2; 115 116 // Anchor at the end of the elements. This will cause the set of elements 117 // inside the arc to end at the specified anchor_angle, i.e. all elements 118 // should be to the left of anchor_angle. 119 ARC_ANCHOR_END = 3; 120} 121 122// An extensible ArcAnchorType property. 123message ArcAnchorTypeProp { 124 // The value. 125 ArcAnchorType value = 1; 126} 127 128// How to lay out components in a Arc context when they are smaller than their 129// container. This would be similar to HorizontalAlignment in a Box or Column. 130enum AngularAlignment { 131 // Angular alignment is undefined. 132 ANGULAR_ALIGNMENT_UNDEFINED = 0; 133 134 // Align to the start of the container. As an example, if the container 135 // starts at 90 degrees and has 180 degrees of sweep, the element within 136 // would draw from 90 degrees, clockwise. 137 ANGULAR_ALIGNMENT_START = 1; 138 139 // Align to the center of the container. As an example, if the container 140 // starts at 90 degrees, and has 180 degrees of sweep, and the contained 141 // element has 90 degrees of sweep, the element would draw between 135 and 142 // 225 degrees. 143 ANGULAR_ALIGNMENT_CENTER = 2; 144 145 // Align to the end of the container. As an example, if the container 146 // starts at 90 degrees and has 180 degrees of sweep, and the contained 147 // element has 90 degrees of sweep, the element would draw between 180 and 270 148 // degrees. 149 ANGULAR_ALIGNMENT_END = 3; 150} 151