From dcab4687db1be19367c8a83853876092f9aad767 Mon Sep 17 00:00:00 2001 From: Bert McMeen Date: Sun, 15 May 2016 18:22:55 -0700 Subject: [PATCH] docs: Iterating on Wear docs - Complications Bug: 28425614 Change-Id: I1313f80ae28efdd6d2677399a23acb10e4dbf7da --- .../wear/preview/features/complications.jd | 280 +++++++++--------- .../preview/images/complication-type-exs.png | Bin 66588 -> 88724 bytes .../images/complications-data-flow.png | Bin 16126 -> 67908 bytes .../images/complications-main-image.png | Bin 0 -> 123015 bytes docs/html/wear/preview/program.jd | 4 +- 5 files changed, 150 insertions(+), 134 deletions(-) create mode 100644 docs/html/wear/preview/images/complications-main-image.png diff --git a/docs/html/wear/preview/features/complications.jd b/docs/html/wear/preview/features/complications.jd index 155f7335e8ef6..a0157de10ffea 100644 --- a/docs/html/wear/preview/features/complications.jd +++ b/docs/html/wear/preview/features/complications.jd @@ -1,46 +1,52 @@ page.title=Watch Face Complications meta.keywords="wear-preview" page.tags="wear-preview" -page.image=images/cards/card-n-sdk_2x.png - +page.image=/wear/preview/images/complications-main-image.png @jd:body

- A complication is a feature of a watch face beyond hours and - minutes. For example, a battery indicator is a complication. + A complication is any feature in a watch face that displays more than hours and + minutes. For example, a battery indicator is a complication. The + Complications API is for both watch faces and data provider apps.

-

- The Complications API is for both watch faces and data provider apps. -

+
+ Complications +

Watch faces can display extra information without needing code for @@ -49,6 +55,36 @@ page.image=images/cards/card-n-sdk_2x.png API.

+

+ Along with reviewing this page, download the Android Wear 2.0 Preview + Reference (see the Complications API additions) and review the Javadoc for complications. +

+ +

+ Apps that provide data to watch faces for complications are called + "complication data providers." These apps are not responsible for controlling + how their data is rendered on the watch face. + This allows a watch face to integrate the data naturally with the + watch face design. + The consuming watch faces are responsible for drawing + the complications. +

+ +

+ Watch faces can receive complication data of + various types (e.g. small text + data or icon data) and then display it. +

+ +

+ As indicated in the diagram below, Android Wear mediates the flow of data + from providers to watch faces. +

+ + + +

For creating or modifying watch faces, see Adding complications to a watch @@ -60,33 +96,6 @@ page.image=images/cards/card-n-sdk_2x.png "#exposing_data_to_complications">Exposing data to complications.

-

- Along with reviewing this page, download the Android Wear 2.0 Preview - Reference and review the API additions in - the Javadoc for complications. -

- -

- Apps that provide data to watch faces for complications are called - "complication data providers." These apps lack control over how their - data is rendered. The consuming watch faces are responsible for drawing - the complications. -

- -

- As indicated in the diagram below, Android Wear mediates the flow of data - from providers to watch faces. -

- - Complications data flow - -

- Through this process, watch faces can receive complication data of - various types (e.g. small text - data or icon data) and then display it. -

-

Adding Complications to a Watch Face

@@ -205,15 +214,17 @@ android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST

The service's manifest entry should also include an android:icon attribute. The provided icon should be a - single-color white icon. This icon should represent the provider and will - be shown in the provider chooser. + single-color white icon. Vector drawables are recommended for the icons. + An icon should represent the provider and will be shown in the provider + chooser.

Include metadata to specify the supported types, update period, and configuration action, if required; for details, download the Android Wear 2.0 Preview Reference and see the keys listed for the - ComplicationProviderService class (in the Javadoc). + ComplicationProviderService class (in the Javadoc; see + API Additions).

@@ -266,11 +277,7 @@ android.support.wearable.complications.UPDATE_PERIOD_SECONDS

Then create the configuration activity with an intent filter for that action. The configuration activity must reside in the same package as the - provider. -

- -

- The configuration activity must return RESULT_OK or + provider. The configuration activity must return RESULT_OK or RESULT_CANCELED, to tell the system whether the provider should be set.

@@ -281,14 +288,15 @@ android.support.wearable.complications.UPDATE_PERIOD_SECONDS

- For details, download the Android Wear 2.0 Preview Reference, containing - the Javadoc, and see the following in the - ComplicationProviderService class: + For details, download the Android Wear 2.0 Preview Reference (see + API Additions), containing the Javadoc, and + see the following in the ComplicationProviderService class:

 METADATA_KEY_PROVIDER_CONFIG_ACTION
-
+ +

Using Complication Types

@@ -340,6 +348,16 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION gauges can be shown without including text.

+

+ Examples of Complication Types +

+ +

+ The following shows examples of complication types: +

+ + +

Types and fields @@ -352,16 +370,16 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION - - - - @@ -374,7 +392,8 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION Short text - - - - - - - - - - - - - - + + + + + + + + + + + + + +
+ Type + Required fields + Optional fields + Notes
- IconShort title + Icon
+ Short title
Exactly one of Icon/Short title is expected to be shown if either or @@ -382,37 +401,6 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION
- LONG_TEXT - - Long text - - Long titleIcon*Small image - - Title is expected to be shown if provided. -
- RANGED_VALUE - - ValueMin valueMax value - - IconShort textShort title - - Optional fields are not guaranteed to be displayed. Uses include for - numerical data within bounds, such as for a percentage. -
ICON @@ -428,6 +416,42 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION
+ RANGED_VALUE + + Value
+ Min value
+ Max value +
+ Icon
+ Short text
+ Short title +
+ Optional fields are not guaranteed to be displayed. +
+ LONG_TEXT + + Long text + + Long title
+ Icon
+ Small image +
+ Title is expected to be shown if provided. +
SMALL_IMAGE @@ -467,16 +491,16 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION - - - - @@ -514,16 +538,6 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION
+ Type + Required fields + Optional fields + Notes
-

- Examples of Complication Types -

-

- The following shows examples of complication types: -

- - Complication types -

Using Fields for Complication Data

@@ -543,10 +557,10 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION - - @@ -561,13 +575,23 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION + + + + + @@ -586,7 +610,7 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION Long title @@ -596,7 +620,7 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION Value @@ -608,7 +632,7 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION @@ -619,28 +643,18 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION - - - - - @@ -649,7 +663,7 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION Large image @@ -681,8 +695,10 @@ METADATA_KEY_PROVIDER_CONFIG_ACTION

- The Complications API includes the following new classes in the Wearable - Support Library: + The Complications API includes new classes in the Wearable Support + Library. For more information, download the + Android Wear 2.0 Preview Reference.

+ Field + Description
+ Icon + + A single-color image representing the data or the source of the data. + Must be tintable. Vector drawables are recommended for this field. +
Short title - Descriptive field for small complications.Should not exceed 7 - characters.May only be meaningful in combination with Short + Descriptive field for small complications. Should not exceed 7 + characters. May only be meaningful in combination with Short text.
- Descriptive field for large, text-based complications.May only be + Descriptive field for large, text-based complications. May only be meaningful in combination with Long text.
- A numerical (float) representation of the data.Expected to be + A numerical (float) representation of the data. Expected to be depicted relative to the bounds the Min value and Max value fields (but not required to be between those bounds). The lower bound for the range within which Value should be - depicted.Only meaningful in combination with Value and + depicted. Only meaningful in combination with Value and Max value.
The upper bound for the range within which value should be - depicted.Only meaningful in combination with Value and + depicted. Only meaningful in combination with Value and Min value.
- Icon - - A single-color image representing the data or the source of the - data.Must be tintable. -
Small image - A small image to represent the data or the source of the data.May be - full color.Not expected to fill the entire watch face. + A small image to represent the data or the source of the data. May be + full color. Not expected to fill the entire watch face.
- An image with sufficient resolution to fill the watch face.May be + An image with sufficient resolution to fill the watch face. May be full color.