ShortTextComplicationData.Builder


class ShortTextComplicationData.Builder


Builder for ShortTextComplicationData.

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

Summary

Public constructors

Builder(text: ComplicationText, contentDescription: ComplicationText)

Public functions

open ShortTextComplicationData

Builds the ShortTextComplicationData.

ShortTextComplicationData.Builder

Sets optional icon associated with the complication data.

ShortTextComplicationData.Builder
setSmallImage(smallImage: SmallImage?)

Sets optional image associated with the complication data.

ShortTextComplicationData.Builder

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

ShortTextComplicationData.Builder

Sets optional title associated with the complication data.

ShortTextComplicationData.Builder
setValidTimeRange(validTimeRange: TimeRange?)

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

Public constructors

Builder

Added in 1.0.0
Builder(text: ComplicationText, contentDescription: ComplicationText)
Parameters
text: ComplicationText

The main localized ComplicationText. This must be less than 7 characters long

contentDescription: ComplicationText

Defines localized text that briefly describes content of the complication. This property is used primarily for accessibility. Since some complications do not have textual representation this attribute can be used for providing such. Please do not include the word 'complication' in the description.

Public functions

build

Added in 1.0.0
open fun build(): ShortTextComplicationData

Builds the ShortTextComplicationData.

setMonochromaticImage

Added in 1.0.0
fun setMonochromaticImage(monochromaticImage: MonochromaticImage?): ShortTextComplicationData.Builder

Sets optional icon associated with the complication data.

setSmallImage

Added in 1.2.0
fun setSmallImage(smallImage: SmallImage?): ShortTextComplicationData.Builder

Sets optional image associated with the complication data.

setTapAction

Added in 1.0.0
fun setTapAction(tapAction: PendingIntent?): ShortTextComplicationData.Builder

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

setTitle

Added in 1.0.0
fun setTitle(title: ComplicationText?): ShortTextComplicationData.Builder

Sets optional title associated with the complication data.

setValidTimeRange

Added in 1.0.0
fun setValidTimeRange(validTimeRange: TimeRange?): ShortTextComplicationData.Builder

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