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

final @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

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

Public constructors

Builder

public final Builder(
    @NonNull Icon photoImage,
    @NonNull ComplicationText contentDescription
)
Parameters
@NonNull Icon photoImage

The Icon to be displayed

@NonNull ComplicationText contentDescription

Localized description for use by screen readers

Public methods

setTapAction

@NonNull
public final PhotoImageComplicationData.Builder setTapAction(@Nullable PendingIntent tapAction)

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

setValidTimeRange

@NonNull
public final PhotoImageComplicationData.Builder setValidTimeRange(@Nullable TimeRange validTimeRange)

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