Photos

Shows single or multiple photos, set using the companion app.

Introduced in Wear OS 6

Syntax

<Photos source="string" defaultImageResource="string"
    change="TAP | ON_VISIBLE" changeAfterEvery="integer"
    width="integer" height="integer">
</Photos>

Attributes

The Photos element has the following attributes. Some attributes are required while others are optional.

Required attributes

The following attributes are required:

source

The name of source of the photos. Must correspond to the name used in the id in the PhotosConfiguration definition.

For example, if an id of my_photos is used in PhotosConfiguration then use [CONFIGURATION.my_photos], as shown in the following snippet:

<UserConfigurations>
  <PhotosConfiguration id="my_photos" configType="SINGLE"/>
</UserConfigurations>
<Scene>
  <PartImage ...>
    <Photos source="[CONFIGURATION.my_photos]"
            defaultImageResource="placeholder_photo"/>
  </PartImage>
</Scene>
defaultImageResource

The default image to show. Shown if the user has not selected a photo using the companion app.

Optional attributes

The following attributes are optional:

change

A space-separated list of events that cause the photo to be changed. This applies only when the PhotosConfiguration specifies multiple images can be shown. Can include one or more of the following values:

  • TAP - when the user taps the photo element.
  • ON_VISIBLE - when the photo element becomes visible.
changeAfterEvery

Applies only to the ON_VISIBLE change type and specifies after how many device wake-ups the photo should change. Must be an value between 3 and 10 inclusive.

width

If specified, applies a crop of this width to the photo.

height

If specified, applies a crop of this height to the photo.