Skip to content

Commit 8457239

Browse files
authored
Adds Watch Face Format (WFF) v2 specification (#17)
* Adds v2 specification * Update links
1 parent fb6fbda commit 8457239

File tree

96 files changed

+4977
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+4977
-8
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Face Format to build both watch faces and watch face design tools.
1111
The [XSD specification][xsd-specs] provides you with the specification needed in
1212
order to build validation into your watch face creation tools and processes.
1313

14+
There are different versions of the specification: The latest is version 2 which
15+
builds and expands on version 1. Different versions have different Wear OS
16+
version support. To understand the differences in capabilities and compatibility
17+
please [see this guide][wff-features].
18+
1419
## XSD Validator
1520

1621
The [XSD validator][xsd-validator] is a tool that allows you to check whether
@@ -42,4 +47,5 @@ Watch Face Format is distributed under the Apache 2.0 license, see the
4247
[wff]: https://developer.android.com/training/wearables/wff/
4348
[samples]: https://github.com/android/wear-os-samples/tree/main/WatchFaceFormat
4449
[xsd-specs]: third_party/wff/specification/documents/1/
45-
[xsd-validator]: third_party/wff/README.md
50+
[xsd-validator]: third_party/wff/README.md
51+
[wff-features]: https://developer.android.com/training/wearables/wff/features

play-validations/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ in Google Play reviews, but these represent reasonable settings for evaluation:
3939

4040
```shell
4141
java -jar ./memory-footprint.jar --watch-face MyWatchFace.apk \
42-
--schema-version 1 \
42+
--schema-version 2 \
4343
--ambient-limit-mb 10 \
4444
--active-limit-mb 100 \
4545
--apply-v1-offload-limitations \

third_party/wff/README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The watch face format specifcation allows you to validate your watch faces and
66
operation of watch face generating tools. The specification is
77
[provided as XSD files][xsd-files].
88

9+
There are different versions of the specification, which have different
10+
capabilities and compatibilities. Please see [this guide][wff-features] for more
11+
details.
12+
913
## Format validator
1014

1115
In addition to the XSD files, a validator is provided that can be used to check
@@ -18,20 +22,21 @@ cd third_party/wff
1822
./gradlew :specification:validator:build
1923
```
2024

21-
The resulting JAR file can then be found at: `specification/validator/build/libs/dwf-format-1-validator-1.0.jar`
25+
The resulting JAR file can then be found at: `specification/validator/build/libs/dwf-format-2-validator-1.0.jar`
2226

2327
### Usage
2428

2529
To check whether a watch face is valid, invoke the validator as follows:
2630

2731
```shell
28-
java -jar dwf-format-1-validator-1.0.jar <format-version> <any options> <your-watchface.xml> <more-watchface.xml>
32+
java -jar dwf-format-2-validator-1.0.jar <format-version> <any options> <your-watchface.xml> <more-watchface.xml>
2933
```
3034

3135
For example:
3236

3337
```shell
34-
java -jar dwf-format-1-validator-1.0.jar 1 ~/MyWatchface/res/raw/watchface.xml
38+
java -jar dwf-format-2-validator-1.0.jar 2 ~/MyWatchface/res/raw/watchface.xml
3539
```
3640

37-
[xsd-files]: specification/documents/1
41+
[xsd-files]: specification/documents/1
42+
[wff-features]: https://developer.android.com/training/wearables/wff/features
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2023 Samsung Electronics Co., Ltd All Rights Reserved
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
19+
<xs:include schemaLocation="common/attributes/geometricAttributes.xsd"/>
20+
21+
<xs:complexType name="_bitmapImportDataType">
22+
<xs:attribute name="name" type="xs:string" use="required"/>
23+
<xs:attribute name="resource" type="xs:string" use="required"/>
24+
<xs:attributeGroup ref="sizeAttributesRequired"/>
25+
<xs:attributeGroup ref="margins"/>
26+
</xs:complexType>
27+
28+
<xs:element name="BitmapFonts">
29+
<xs:complexType>
30+
<xs:annotation>
31+
<xs:documentation>
32+
User-defined bitmap fonts can be declared in this scope.
33+
</xs:documentation>
34+
</xs:annotation>
35+
36+
<xs:choice maxOccurs="unbounded">
37+
<xs:element name="BitmapFont" minOccurs="1" maxOccurs="unbounded">
38+
<xs:complexType>
39+
<xs:annotation>
40+
<xs:documentation>
41+
User-defined bitmap font can be declared with this element.
42+
Put the name for the family attribute in the font element.
43+
</xs:documentation>
44+
</xs:annotation>
45+
46+
<xs:choice minOccurs="1" maxOccurs="unbounded">
47+
<xs:choice>
48+
<xs:element name="Character" type="_bitmapImportDataType"/>
49+
<xs:element name="Word" type="_bitmapImportDataType"/>
50+
</xs:choice>
51+
</xs:choice>
52+
53+
<xs:attribute name="name" type="xs:string" use="required"/>
54+
</xs:complexType>
55+
56+
<xs:unique name="Validation.Unique.BitmapFont.Child.Name">
57+
<xs:selector xpath="*"/>
58+
<xs:field xpath="@name"/>
59+
</xs:unique>
60+
</xs:element>
61+
</xs:choice>
62+
</xs:complexType>
63+
</xs:element>
64+
</xs:schema>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2023 Samsung Electronics Co., Ltd All Rights Reserved
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
19+
<xs:include schemaLocation="../group/renderModeType.xsd"/>
20+
<xs:include schemaLocation="../common/attributes/geometricAttributes.xsd"/>
21+
<xs:include schemaLocation="../common/transform/pivotType.xsd"/>
22+
<xs:include schemaLocation="../common/variant/variantElements.xsd" />
23+
<xs:include schemaLocation="hourHand.xsd"/>
24+
<xs:include schemaLocation="minuteHand.xsd"/>
25+
<xs:include schemaLocation="secondHand.xsd"/>
26+
27+
<xs:element name="AnalogClock">
28+
<xs:annotation>
29+
<xs:documentation>
30+
AnalogClock is a container that represents a traditional clock with
31+
rotating hands.
32+
</xs:documentation>
33+
</xs:annotation>
34+
<xs:complexType>
35+
<xs:all>
36+
<xs:element ref="HourHand" minOccurs="0" maxOccurs="2"/>
37+
<xs:element ref="MinuteHand" minOccurs="0" maxOccurs="2"/>
38+
<xs:element ref="SecondHand" minOccurs="0" maxOccurs="2"/>
39+
<xs:element ref="Localization" minOccurs="0" maxOccurs="1"/>
40+
<xs:element ref="Variant" minOccurs="0" maxOccurs="unbounded"/>
41+
</xs:all>
42+
43+
<xs:attributeGroup ref="geometricAttributesRequired"/>
44+
<xs:attributeGroup ref="pivot2D"/>
45+
<xs:attribute name="angle" type="angleType"/>
46+
<xs:attribute ref="alpha"/>
47+
<xs:attribute name="scaleX" type='xs:float'/>
48+
<xs:attribute name="scaleY" type='xs:float'/>
49+
<xs:attribute name="renderMode" type="renderModeType" default="SOURCE"/>
50+
<xs:attribute name="tintColor" type='colorAttributeType'/>
51+
</xs:complexType>
52+
</xs:element>
53+
</xs:schema>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2023 Samsung Electronics Co., Ltd All Rights Reserved
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
19+
<xs:include schemaLocation="../group/renderModeType.xsd"/>
20+
<xs:include schemaLocation="../common/attributes/geometricAttributes.xsd"/>
21+
<xs:include schemaLocation="../common/transform/pivotType.xsd"/>
22+
<xs:include schemaLocation="../userConfiguration/listConfigurationElement.xsd"/>
23+
<xs:include schemaLocation="../common/variant/variantElements.xsd" />
24+
<xs:include schemaLocation="timeText.xsd"/>
25+
26+
<xs:element name="DigitalClock">
27+
<xs:annotation>
28+
<xs:documentation>
29+
DigitalClock is a container for text-based formatted time.
30+
</xs:documentation>
31+
</xs:annotation>
32+
<xs:complexType>
33+
<xs:all>
34+
<xs:element ref="Localization" minOccurs="0" maxOccurs="1"/>
35+
<xs:element ref="Variant" minOccurs="0" maxOccurs="unbounded"/>
36+
<xs:element ref="TimeText" minOccurs="1" maxOccurs="unbounded"/>
37+
</xs:all>
38+
39+
<xs:attributeGroup ref="geometricAttributesRequired"/>
40+
<xs:attributeGroup ref="pivot2D"/>
41+
<xs:attribute name="angle" type="angleType"/>
42+
<xs:attribute ref="alpha"/>
43+
<xs:attribute name="scaleX" type='xs:float'/>
44+
<xs:attribute name="scaleY" type='xs:float'/>
45+
<xs:attribute name="renderMode" type="renderModeType" default="SOURCE"/>
46+
<xs:attribute name="tintColor" type='colorAttributeType'/>
47+
</xs:complexType>
48+
</xs:element>
49+
</xs:schema>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2023 Samsung Electronics Co., Ltd All Rights Reserved
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
19+
<xs:include schemaLocation="../common/attributes/geometricAttributes.xsd"/>
20+
<xs:include schemaLocation="../common/transform/pivotType.xsd"/>
21+
<xs:include schemaLocation="../userConfiguration/listConfigurationElement.xsd"/>
22+
<xs:include schemaLocation="../common/variant/variantElements.xsd" />
23+
24+
<xs:element name="HourHand">
25+
<xs:annotation>
26+
<xs:documentation>
27+
A image that represents an hour hand, it rotates 360 degree in 12 hours.
28+
</xs:documentation>
29+
</xs:annotation>
30+
<xs:complexType>
31+
<xs:choice maxOccurs="unbounded">
32+
<xs:element ref="Variant" minOccurs="0" maxOccurs="unbounded"/>
33+
</xs:choice>
34+
35+
<xs:attribute name="resource" type="xs:string" use="required"/>
36+
<xs:attributeGroup ref="geometricAttributesRequired"/>
37+
<xs:attributeGroup ref="pivot2D"/>
38+
<xs:attribute ref="alpha"/>
39+
<xs:attribute name="tintColor" type='colorAttributeType'/>
40+
</xs:complexType>
41+
</xs:element>
42+
</xs:schema>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2023 Samsung Electronics Co., Ltd All Rights Reserved
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
19+
<xs:include schemaLocation="../common/attributes/geometricAttributes.xsd"/>
20+
<xs:include schemaLocation="../common/transform/pivotType.xsd"/>
21+
<xs:include schemaLocation="../userConfiguration/listConfigurationElement.xsd"/>
22+
<xs:include schemaLocation="../common/variant/variantElements.xsd" />
23+
24+
<xs:element name="MinuteHand">
25+
<xs:annotation>
26+
<xs:documentation>
27+
A image that represent a minute hand, it rotates 360 degree in 1 hour.
28+
</xs:documentation>
29+
</xs:annotation>
30+
<xs:complexType>
31+
<xs:choice maxOccurs="unbounded">
32+
<xs:element ref="Variant" minOccurs="0" maxOccurs="unbounded"/>
33+
</xs:choice>
34+
35+
<xs:attribute name="resource" type="xs:string" use="required"/>
36+
<xs:attributeGroup ref="geometricAttributesRequired"/>
37+
<xs:attributeGroup ref="pivot2D"/>
38+
<xs:attribute ref="alpha"/>
39+
<xs:attribute name="tintColor" type='colorAttributeType'/>
40+
</xs:complexType>
41+
</xs:element>
42+
</xs:schema>

0 commit comments

Comments
 (0)