PhotoImageComplicationData.Builder


public final class PhotoImageComplicationData.Builder


Builder for PhotoImageComplicationData.

You must at a minimum set the photoImage and contentDescription fields.

Summary

Public constructors

Builder(
    @NonNull Icon photoImage,
    @NonNull ComplicationText contentDescription
)

Public methods

@NonNull PhotoImageComplicationData

Builds the PhotoImageComplicationData.

final @NonNull PhotoImageComplicationData.Builder

Sets optional pending intent to be invoked when the complication is tapped.

final @NonNull PhotoImageComplicationData.Builder
setValidTimeRange(TimeRange validTimeRange)

Sets optional time range during which the complication has to be shown.

Public constructors

Builder

Added in 1.0.0
public Builder(
    @NonNull Icon photoImage,
    @NonNull ComplicationText contentDescription
)
Parameters
@NonNull Icon photoImage

The Icon to be displayed

@NonNull ComplicationText contentDescription

The content description field for accessibility and is used to describe what data the image represents. If the image is purely stylistic, and does not convey any information to the user, then provide an empty content description. If no content description is provided, a generic content description will be used instead. Please do not include the word 'complication' in the description.

Public methods

setTapAction

Added in 1.0.0
public final @NonNull PhotoImageComplicationData.Builder setTapAction(PendingIntent tapAction)

Sets optional pending intent to be invoked when the complication is tapped.

setValidTimeRange

Added in 1.0.0
public final @NonNull PhotoImageComplicationData.Builder setValidTimeRange(TimeRange validTimeRange)

Sets optional time range during which the complication has to be shown.