1<?xml version="1.0" encoding="UTF-8"?> 2<!-- 3 Copyright 2014 The Android Open Source Project 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 19 20<sample> 21 <name>WatchFace</name> 22 <group>Wearable</group> 23 <package>com.example.android.wearable.watchface</package> 24 25 <minSdk>18</minSdk> 26 <targetSdkVersion>27</targetSdkVersion> 27 28 <minSdkVersionWear>24</minSdkVersionWear> 29 <compileSdkVersionWear>26</compileSdkVersionWear> 30 <targetSdkVersionWear>26</targetSdkVersionWear> 31 32 <multiDexEnabled>true</multiDexEnabled> 33 34 35 <dependency>com.google.android.support:wearable:2.3.0</dependency> 36 <dependency_wearable>com.android.support:palette-v7:27.1.0</dependency_wearable> 37 <dependency_wearable>com.android.support:wear:27.1.0</dependency_wearable> 38 39 40 <wearable> 41 <has_handheld_app>true</has_handheld_app> 42 </wearable> 43 44 <strings> 45 <intro> 46<![CDATA[ 47This sample demonstrates how to create watch faces for Wear and use complications 48with your Wear 2.0 watch faces. 49]]> 50 </intro> 51 </strings> 52 53 <template src="base"/> 54 <template src="Wear"/> 55 56 <metadata> 57 <status>PUBLISHED</status> 58 <categories>Wearable</categories> 59 <technologies>Android</technologies> 60 <languages>Java</languages> 61 <solutions>Mobile</solutions> 62 <level>INTERMEDIATE</level> 63 <icon>screenshots/icon-web.png</icon> 64 <screenshots> 65 <img>screenshots/analog-face.png</img> 66 <img>screenshots/analog-watch-side-config-all.png</img> 67 <img>screenshots/analog-watch-side-config-1.png</img> 68 <img>screenshots/analog-watch-side-config-2.png</img> 69 <img>screenshots/digital-face.png</img> 70 <img>screenshots/digital-phone-side-config.png</img> 71 <img>screenshots/digital-watch-side-config.png</img> 72 <img>screenshots/interactive-face.png</img> 73 <img>screenshots/tilt-face.png</img> 74 </screenshots> 75 <api_refs> 76 <android>android.support.wearable.complications.ComplicationData</android> 77 <android>android.support.wearable.complications.ComplicationHelperActivity</android> 78 <android>android.support.wearable.complications.ComplicationProviderInfo</android> 79 <android>android.support.wearable.complications.ComplicationText</android> 80 <android>android.support.wearable.complications.ProviderChooserIntent</android> 81 <android>android.support.wearable.view.WearableRecyclerView</android> 82 <android>android.support.wearable.watchface.CanvasWatchFaceService</android> 83 <android>android.support.wearable.watchface.WatchFaceService</android> 84 <android>android.support.wearable.watchface.WatchFaceStyle</android> 85 </api_refs> 86 87 <!-- 1-3 line description of the sample here. 88 89 Avoid simply rearranging the sample's title. What does this sample actually 90 accomplish, and how does it do it? --> 91 <description> 92 A simple sample that demonstrates watch faces and complications for Wear 2.0. 93 </description> 94 95 <intro> 96<![CDATA[ 97This sample demonstrates how to create watch faces for Wear. 98 99The analog watch face covers best practices for Wear 2.0 including complications and a new 100configuration Activity for configuring both the watch face styles and the complications themselves. 101We recommend you reuse the configuration code and follow the UX patterns in your watch face's 102configuration activity. You can see a preview in the screenshots section of the README. 103 104The analog watch face has three main classes: 105 106- AnalogComplicationWatchFaceService.java (watchface folder) - Renders the watch face and active 107complications. 108 109- AnalogComplicationConfigActivity.java (config folder) - Allows user to adjust watch face settings 110(arm and background colors) and watch face complications. 111 112- AnalogComplicationConfigData.java (models folder) - Populates the configuration screen in the 113previous step by returning a list of items. Each item represents something you can customize on the 114watch face. Items include a preview of the watch face (where you can pick your complications), 115marker color, background color, unread notifications, and background image complication. You can 116extend this and add your own. 117 118 119We include several older watch faces to show best practices for Wear 1.0. If you are targeting 120older devices, you may want to review those watch faces (digital, opengl, and interactive). 121 122The digital watch face includes a watch-side and phone-side configuration example. 123 124This sample includes both a phone app and a wearable app. 125 126Because watch face apps do not have a default Activity in their project, you will need to set your 127Configurations to "Do not launch Activity" for both the Wear and Application modules. If you are 128unsure how to do this, please review the "Run Starter project" section in the 129[Google Watch Face Code Lab][1]. 130 131[1]: https://codelabs.developers.google.com/codelabs/watchface/index.html 132]]> 133 </intro> 134 </metadata> 135 136</sample> 137