• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

.google/23-Mar-2024-2620

Application/23-Mar-2024-803445

Wearable/23-Mar-2024-5,7963,612

gradle/wrapper/23-Mar-2024-76

screenshots/23-Mar-2024-

CONTRIB.mdD23-Mar-20241.6 KiB3627

CONTRIBUTING.mdD23-Mar-20241.5 KiB3627

LICENSED23-Mar-202411.1 KiB204170

README.mdD23-Mar-20244.3 KiB9564

build.gradleD23-Mar-202414 150

gradlewD23-Mar-20245 KiB165122

gradlew.batD23-Mar-20242.3 KiB9166

settings.gradleD23-Mar-202437 31

README.md

1
2Android WatchFace Sample
3===================================
4
5A simple sample that demonstrates watch faces and complications for Wear 2.0.
6
7Introduction
8------------
9
10This sample demonstrates how to create watch faces for Android Wear.
11
12The analog watch face covers best practices for Wear 2.0 including complications and a new
13configuration Activity for configuring both the watch face styles and the complications themselves.
14We recommend you reuse the configuration code and follow the UX patterns in your watch face's
15configuration activity. You can see a preview in the screenshots section of the README.
16
17The analog watch face has three main classes:
18
19- AnalogComplicationWatchFaceService.java (watchface folder) - Renders the watch face and active
20complications.
21
22- AnalogComplicationConfigActivity.java (config folder) - Allows user to adjust watch face settings
23(arm and background colors) and watch face complications.
24
25- AnalogComplicationConfigData.java (models folder) - Populates the configuration screen in the
26previous step by returning a list of items. Each item represents something you can customize on the
27watch face. Items include a preview of the watch face (where you can pick your complications),
28marker color, background color, unread notifications, and background image complication. You can
29extend this and add your own.
30
31
32We include several older watch faces to show best practices for Wear 1.0. If you are targeting
33older devices, you may want to review those watch faces (digital, opengl, and interactive).
34
35The digital watch face includes a watch-side and phone-side configuration example.
36
37This sample includes both a phone app and a wearable app.
38
39Because watch face apps do not have a default Activity in their project, you will need to set your
40Configurations to "Do not launch Activity" for both the Wear and Application modules. If you are
41unsure how to do this, please review the "Run Starter project" section in the
42[Google Watch Face Code Lab][1].
43
44[1]: https://codelabs.developers.google.com/codelabs/watchface/index.html
45
46Pre-requisites
47--------------
48
49- Android SDK 27
50- Android Build Tools v27.0.2
51- Android Support Repository
52
53Screenshots
54-------------
55
56<img src="screenshots/analog-face.png" height="400" alt="Screenshot"/> <img src="screenshots/analog-watch-side-config-all.png" height="400" alt="Screenshot"/> <img src="screenshots/analog-watch-side-config-1.png" height="400" alt="Screenshot"/> <img src="screenshots/analog-watch-side-config-2.png" height="400" alt="Screenshot"/> <img src="screenshots/digital-face.png" height="400" alt="Screenshot"/> <img src="screenshots/digital-phone-side-config.png" height="400" alt="Screenshot"/> <img src="screenshots/digital-watch-side-config.png" height="400" alt="Screenshot"/> <img src="screenshots/interactive-face.png" height="400" alt="Screenshot"/> <img src="screenshots/tilt-face.png" height="400" alt="Screenshot"/>
57
58Getting Started
59---------------
60
61This sample uses the Gradle build system. To build this project, use the
62"gradlew build" command or use "Import Project" in Android Studio.
63
64Support
65-------
66
67- Google+ Community: https://plus.google.com/communities/105153134372062985968
68- Stack Overflow: http://stackoverflow.com/questions/tagged/android
69
70If you've found an error in this sample, please file an issue:
71https://github.com/googlesamples/android-WatchFace
72
73Patches are encouraged, and may be submitted by forking this project and
74submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
75
76License
77-------
78
79Copyright 2017 The Android Open Source Project, Inc.
80
81Licensed to the Apache Software Foundation (ASF) under one or more contributor
82license agreements.  See the NOTICE file distributed with this work for
83additional information regarding copyright ownership.  The ASF licenses this
84file to you under the Apache License, Version 2.0 (the "License"); you may not
85use this file except in compliance with the License.  You may obtain a copy of
86the License at
87
88http://www.apache.org/licenses/LICENSE-2.0
89
90Unless required by applicable law or agreed to in writing, software
91distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
92WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
93License for the specific language governing permissions and limitations under
94the License.
95