Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
* @yrezgui @kkuan2011
/compose/ @android/devrel-compose
/car/ @android/devrel-car
/watchface/ @android/devrel-wear
/wear/ @android/devrel-wear
/wearcompanion/ @android/devrel-wear
/xr/ @android/devrel-xr
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ include(
":kotlin",
":compose:snippets",
":datastore",
":watchface",
":wear",
":wearcompanion",
":views",
Expand Down
1 change: 1 addition & 0 deletions watchface/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
46 changes: 46 additions & 0 deletions watchface/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
alias(libs.plugins.android.application)
}

android {
namespace = "com.example.simpledigital"
compileSdk = 36

defaultConfig {
applicationId = "com.example.simpledigital"
minSdk = 36
targetSdk = 36
versionCode = 1
versionName = "1.0.0"
}

buildTypes {
debug {
isMinifyEnabled = true
}
release {
// TODO:Add your signingConfig here to build release builds
isMinifyEnabled = true
// Ensure shrink resources is false, to avoid potential for them
// being removed.
isShrinkResources = false

signingConfig = signingConfigs.getByName("debug")
}
}
}
41 changes: 41 additions & 0 deletions watchface/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2023 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-feature android:name="android.hardware.type.watch" />

<!-- Note: hasCode is required to be false for Watch Face Format -->
<application
android:label="@string/watch_face_name"
android:hasCode="false">

<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />
<!-- [START android_watchface_version_manifest] -->
<property
android:name="com.google.wear.watchface.format.version"
android:value="4" />
<!-- [END android_watchface_version_manifest] -->
<!-- [START android_watchface_publisher_manifest] -->
<property
android:name="com.google.wear.watchface.format.publisher"
android:value="{toolName}-{toolVersion}" />
<!-- [END android_watchface_publisher_manifest] -->
</application>
</manifest>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/digit1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/digit12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/digit2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/digit3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/digit4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/hour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/minute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/drawable/second.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added watchface/src/main/res/font/pacifico.ttf
Binary file not shown.
26 changes: 26 additions & 0 deletions watchface/src/main/res/raw/watchface.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<WatchFace width="450" height="450">
<Scene>
<!-- Content to be rendered -->
<PartText x="0" y="0" width="450" height="450">
<Text align="CENTER">
<Font size="32">Snippets</Font>
</Text>
</PartText>
</Scene>
</WatchFace>
49 changes: 49 additions & 0 deletions watchface/src/main/res/raw/watchface_ambient.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<WatchFace width="450" height="450">
<Scene>
<!-- [START android_watch_face_ambient_mode] -->
<Group name="logo_interactive" x="100" y="100" width="200" height="200">
<!-- Hide these elements in ambient mode -->
<Variant mode="AMBIENT" target="alpha" value="0" />
<!-- Components to show in interactive mode -->
<!-- [START_EXCLUDE] -->
<PartText x="0" y="0" width="200" height="50">
<Text>
<Font family="SYNC_TO_DEVICE" size="16">
<![CDATA[Interactive]]>
</Font>
</Text>
</PartText>
<!-- [END_EXCLUDE] -->
</Group>
<Group name="logo_ambient" x="100" y="100" width="200" height="200" alpha="0">
<Variant mode="AMBIENT" target="alpha" value="255" />
<!-- Components to show in ambient mode -->
<!-- [START_EXCLUDE] -->
<PartText x="0" y="0" width="200" height="50">
<Text>
<Font family="SYNC_TO_DEVICE" size="16">
<![CDATA[Ambient]]>
</Font>
</Text>
</PartText>
<!-- [END_EXCLUDE] -->
</Group>
<!-- [END android_watch_face_ambient_mode] -->
</Scene>
</WatchFace>
30 changes: 30 additions & 0 deletions watchface/src/main/res/raw/watchface_basic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- [START android_watch_face_xml_basic] -->
<WatchFace width="450" height="450">
<Scene>
<!-- Content to be rendered -->
<!-- [START_EXCLUDE] -->
<PartText x="0" y="0" width="450" height="450">
<Text align="CENTER">
<Font size="32">Snippets</Font>
</Text>
</PartText>
<!-- [END_EXCLUDE] -->
</Scene>
</WatchFace>
<!-- [END android_watch_face_xml_basic] -->
78 changes: 78 additions & 0 deletions watchface/src/main/res/raw/watchface_boolean_configuration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<WatchFace width="450" height="450">
<!-- [START android_watch_face_boolean_configuration_setup] -->
<!-- Under WatchFace element -->
<UserConfigurations>
<!-- show_date and show_date_label defined in res/values/strings.xml -->
<BooleanConfiguration id="show_date"
displayName="show_date_label"
screenReaderText="show_date_label"
defaultValue="TRUE"
/>
</UserConfigurations>
<!-- [END android_watch_face_boolean_configuration_setup] -->

<Scene>
<!-- [START android_watch_face_boolean_configuration_use] -->
<!-- Within the main Scene of the watch face -->
<BooleanConfiguration id="show_date">
<BooleanOption id="TRUE">
<!-- ...Content when date required -->
<!-- [START_EXCLUDE] -->
<PartText x="0" y="50" width="450" height="250">
<Text align="CENTER">
<Font family="pacifico" size="48">Show date</Font>
</Text>
</PartText>
<!-- [END_EXCLUDE] -->
</BooleanOption>
<BooleanOption id="FALSE">
<!-- ...Content when date not required -->
<!-- [START_EXCLUDE] -->
<PartText x="0" y="50" width="450" height="250">
<Text align="CENTER">
<Font family="pacifico" size="48">Don't show date</Font>
</Text>
</PartText>
<!-- [END_EXCLUDE] -->
</BooleanOption>
</BooleanConfiguration>
<!-- [END android_watch_face_boolean_configuration_use] -->

<Condition>
<!-- [START android_watch_face_boolean_configuration_complex] -->
<Expressions>
<Expression name="my_expression">
<!-- Use show_date as part of a more complex evaluation -->
<![CDATA[[CONFIGURATION.show_date] == "TRUE" && [HOUR_0_23] < 15]]>
</Expression>
</Expressions>
<Compare expression="my_expression">
<!-- Content goes here -->
<!-- [START_EXCLUDE] -->
<PartText x="0" y="150" width="450" height="250">
<Text align="CENTER">
<Font family="pacifico" size="48">Complex</Font>
</Text>
</PartText>
<!-- [END_EXCLUDE] -->
</Compare>
</Condition>
<!-- [END android_watch_face_boolean_configuration_complex] -->
</Scene>
</WatchFace>
80 changes: 80 additions & 0 deletions watchface/src/main/res/raw/watchface_clocks.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<WatchFace width="450" height="450">
<Scene>
<!-- [START android_watch_face_dial] -->
<PartImage x="0" y="0" width="450" height="450">
<Image resource="watch_face_dial" />
</PartImage>
<!-- [END android_watch_face_dial] -->

<!-- [START android_watch_face_dial_manual] -->
<!-- Content for the "12" -->
<Group x="200" y="0" width="50" height="450">
<PartText x="0" y="0" width="50" height="50">
<Text>
<Font family="SYNC_TO_DEVICE" size="16" color="#FF00FF">
<![CDATA[12]]>
</Font>
</Text>
</PartText>
</Group>
<!-- Content for the "1" -->
<Group x="200" y="0" width="50" height="450" angle="30">
<PartText x="0" y="0" width="50" height="50">
<Text>
<Font family="SYNC_TO_DEVICE" size="16" color="#FF00FF">
<![CDATA[1]]>
</Font>
</Text>
</PartText>
</Group>
<!-- etc -->
<!-- [END android_watch_face_dial_manual] -->

<!-- [START android_watch_face_digital_clock] -->
<DigitalClock x="125" y="50" width="200" height="50">
<TimeText x="0" y="0" width="200" height="50" format="hh:mm">
<Font family="SYNC_TO_DEVICE" size="16" />
</TimeText>
</DigitalClock>
<!-- [END android_watch_face_digital_clock] -->

<!-- [START android_watch_face_digital_clock_localization] -->
<DigitalClock x="125" y="100" width="200" height="50">
<Localization timeZone="Europe/London" />
<!-- TimeText goes here -->
<!-- START_EXCLUDE -->
<TimeText x="0" y="0" width="200" height="50" format="hh:mm">
<Font family="SYNC_TO_DEVICE" size="16" />
</TimeText>
<!-- END_EXCLUDE -->
</DigitalClock>
<!-- [END android_watch_face_digital_clock_localization] -->

<!-- [START android_watch_face_analog_clock] -->
<AnalogClock x="0" y="0" width="450" height="450">
<HourHand resource="hour" x="220" y="55" width="20" height="190"
pivotX="0.5" pivotY="0.9210" />
<MinuteHand resource="minute" x="222" y="30" width="16" height="220"
pivotX="0.5" pivotY="0.9" />
<SecondHand resource="second" x="226" y="20" width="8" height="245"
pivotX="0.5" pivotY="0.8571" />
</AnalogClock>
<!-- [END android_watch_face_analog_clock] -->
</Scene>
</WatchFace>
Loading