ComplicationDataSourceInfo

public final class ComplicationDataSourceInfo


Holder of details of a complication data source, for use by watch faces (for example, to show the current complication data source in settings). A ComplicationDataSourceInfoRetriever can be used to obtain references of this class for each of a watch face's complications.

Summary

Public fields

final @NonNull String

The name of the application containing the complication data source.

final @Nullable ComponentName

The complication data source's {@link ComponentName}.

final @NonNull ComplicationData

Lazily constructed fallback preview ComplicationData based on this ComplicationDataSourceInfo.

final @NonNull Icon

The icon for the complication data source.

final @NonNull String

The name of the complication data source.

final @NonNull ComplicationType

The type of the complication provided by the data source.

Public constructors

ComplicationDataSourceInfo(
    @NonNull String appName,
    @NonNull String name,
    @NonNull Icon icon,
    @NonNull ComplicationType type,
    @Nullable ComponentName componentName
)

Public fields

appName

@NonNull
public final @NonNull String appName

The name of the application containing the complication data source.

componentName

@Nullable
public final @Nullable ComponentName componentName

The complication data source's {@link ComponentName}.

This field is populated only on Android R and above and it is null otherwise.

fallbackPreviewData

@NonNull
public final @NonNull ComplicationData fallbackPreviewData

Lazily constructed fallback preview ComplicationData based on this ComplicationDataSourceInfo. This is useful when ComplicationDataSourceInfoRetriever.retrievePreviewComplicationData returns null (e.g. on a pre-android R device).

icon

@NonNull
public final @NonNull Icon icon

The icon for the complication data source.

name

@NonNull
public final @NonNull String name

The name of the complication data source.

type

@NonNull
public final @NonNull ComplicationType type

The type of the complication provided by the data source.

Public constructors

ComplicationDataSourceInfo

public final ComplicationDataSourceInfo(
    @NonNull String appName,
    @NonNull String name,
    @NonNull Icon icon,
    @NonNull ComplicationType type,
    @Nullable ComponentName componentName
)