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:
sourceThe name of source of the photos. Must correspond to the name used in the
idin thePhotosConfigurationdefinition.For example, if an
idofmy_photosis used inPhotosConfigurationthen 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>defaultImageResourceThe default image to show. Shown if the user has not selected a photo using the companion app. This has a maximum size of 50 KB.
Optional attributes
The following attributes are optional:
changeA space-separated list of events that cause the photo to be changed. This applies only when the
PhotosConfigurationspecifies 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.
changeAfterEveryApplies only to the
ON_VISIBLEchangetype and specifies after how many device wake-ups the photo should change. Must be an value between 3 and 10 inclusive.widthIf specified, applies a crop of this width to the photo.
heightIf specified, applies a crop of this height to the photo.
Recommended for you
- Note: link text is displayed when JavaScript is off
- Image
- Complication